NetReceiveNActionRequest Example for Visual Basic
Private Sub LEADDICOMNet1_NetReceiveNActionRequest (ByVal hNet As Long, ByVal nPresentationID As Integer, ByVal nMessageID As Integer, ByVal pszClass As String, ByVal pszInstance As String, ByVal nAction As Integer, ByVal hDS As Long)
Dim nRet As Integer
Dim NewNode As Node
Dim szReply As String
Dim lParent As Long
Dim szName As String
Set NewNode = TreeView1.Nodes.Add(, , , "Command Set - " & "N-ACTION-REQUEST")
NewNode.EnsureVisible
lParent = NewNode.Index
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Presentation ID: " & CStr(nPresentationID))
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Message ID: " & CStr(nMessageID))
nRet = LEADDICOM1.FindUID(pszClass)
If (nRet = 0) Then
szName = LEADDICOM1.CurrentUID.Name
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Requested SOP Class: " & szName & " - " & pszClass)
Else
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Requested SOP Class: " & pszClass)
End If
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Requested SOP Instance: " & pszInstance)
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Action: " & CStr(nAction))
'this function should perform the action command
nRet = PerformACTIONCommand(pszClass, pszInstance, hDS)
If (nRet <> DICOM_SUCCESS) Then nRet = COMMAND_STATUS_PROCESSING_FAILURE
'send a response
LEADDICOMNet1.SendNActionResponse hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet, nAction, hDS
End Sub