NetReceiveNSetRequest Example for Visual Basic
Private Sub LEADDICOMNet1_NetReceiveNSetRequest (ByVal hNet As Long, ByVal nPresentationID As Integer, ByVal nMessageID As Integer, ByVal pszClass As String, ByVal pszInstance As String, 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-SET-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, , "Affected SOP Class: " & szName & " - " & pszClass)
Else
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Affected SOP Class: " & pszClass)
End If
Set NewNode = TreeView1.Nodes.Add(lParent, tvwChild, , "Affected SOP Instance: " & pszInstance)
'this function will change the values of the requested SOP Instance
'to the values specefied in the data set elements in hDS
'this function should search all the managed SOP Instances for a
'match, and then change the requested elements.
'This is a function you must write
'nRet = PerformNSETCommand(pszClass, pszInstance, hDS)
If (nRet <> DICOM_SUCCESS) Then nRet = COMMAND_STATUS_NO_SUCH_OBJECT_INSTANCE
'send a response
LEADDICOMNet1.SendNSetResponse hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet, 0
End Sub