SendNGetRequest Example for Visual Basic
Dim nRet As Integer
Dim szClassUID As String
Dim szInstance As String
Dim nVR As Integer
Dim hPDU As Long
Dim nID As Integer
'send an N-GET-REQUEST to the server
'gszGetFile is a global variable used in the NetReceiveNGetResponse event
gszGetFile = InputBox("Select filename for retrieved data set", "Get Request", "d:\temp\N_GET_REQ.dic")
If (Len(gszGetFile) < 1) Then Exit Sub
szClassUID = InputBox("What class do you wish to get?", "Get Request", UID_SC_IMAGE_STORAGE)
If (Len(szClassUID) < 1) Then Exit Sub
szInstance = InputBox("What instance do you wish to get?", "Get Request", "1.1.1.1")
If (Len(szInstance) < 1) Then Exit Sub
'here, you must create a list of the identifiers
'that you wish to get from the server
LEADDICOMNet1.RequestAttributeCount = 4
LEADDICOMNet1.RequestAttributes(0) = TAG_PATIENT_NAME
LEADDICOMNet1.RequestAttributes(1) = TAG_PATIENT_ID
LEADDICOMNet1.RequestAttributes(2) = TAG_PATIENT_SEX
LEADDICOMNet1.RequestAttributes(3) = TAG_NUMBER_OF_PATIENT_RELATED_INSTANCES
hPDU = LEADDICOMNet1.GetAssociate (LEADDICOMNet1.hNet)
'now, send a request
nID = LEADDICOMNet1.FindPresentationAbstract (hPDU, szClassUID)
If (nID = 0) Then
nRet = LEADDICOM1.FindUID(szClassUID)
If (nRet = 0) Then
MsgBox "Abstract Syntax, " & LEADDICOM1.CurrentUID.Name & ", Not Supported by Association!"
Else
MsgBox "Abstract Syntax, " & szClassUID & ", Not Supported by Association!"
End If
Exit Sub
End If
LEADDICOMNet1.SendNGetRequest LEADDICOMNet1.hNet, nID, 1, szClassUID, szInstance