Expression: oStudiesInfoList.Count() gets error
error calling external function Count
Extract from programmer's guide:
Objects in SDK and their functions and properties are defined in type library.Type library is linked in pacsclnt.exe as a resource. SDK can use in every prog. languages which support OLE automation.
Example in VBscript:
Option Explicit
Dim bOK
Dim oPACS
Dim oStudiesManagement
Dim oStudiesInfoList
Dim oStudiesInfo
Dim oStudiesSeqID
Dim msg
' Create TomoCon PACS client object
Set oPACS = CreateObject("PACSClient.App")
' Set connection parameters
oPACS.PACSHostName = "pacs"
oPACS.PACSPortNumber = 104
oPACS.UserName = "PacsUser"
oPACS.UserPassword = "Password"
' Get studies management object
Set oStudiesManagement = oPACS.StudyManagement
' Find new studies
Set oStudiesInfoList = oStudiesManagement.GetNewStudiesInfo
msg = "Found " & oStudiesInfoList.Count & " new studies"
If oStudiesInfoList.Count > 0 Then
msg = msg & vbCRLF & "SeqID = " & oStudiesInfoList.SeqID
End If
MsgBox msg
' Display found study infos
Dim I
For I = 0 To oStudiesInfoList.Count-1
Dim sPatientName
Dim sPatientID
Dim sPatientSex
Dim sPatientBirthDate
Set oStudiesInfo = oStudiesInfoList.Item(I)
bOK = oStudiesInfo.GetPatientName(sPatientName)
bOK = oStudiesInfo.GetPatientID(sPatientID)
bOK = oStudiesInfo.GetPatientSex(sPatientSex)
bOK = oStudiesInfo.GetPatientBirthDate(sPatientBirthDate)
msg = "Study " & I+1 & " of " & oStudiesInfoList.Count & vbCRLF & _
vbCRLF & _
"Patient's name: " & sPatientName & vbCRLF & _
"Patient's birth date: " & sPatientBirthDate & vbCRLF & _
"Patient's sex: " & sPatientSex & vbCRLF & _
MsgBox msg
Next
If oStudiesInfoList.Count > 0 Then
Dim ret
ret = MsgBox("Delete new studies info?", vbYesNoCancel)
If ret = vbYes Then
oStudiesManagement.DeleteNewStudiesInfo(oStudiesInfoList.SeqID)
End If
End If
and my code in PB
Integer li_rc
String ls_pacshostname,ls_pacsportnumber,ls_pacsusername,ls_pacsuserpassword
ls_PacsHostName=f_fromdb_settings_sys ('PACS', 'PacsHostName', '')
ls_PacsPortNumber=f_fromdb_settings_sys ('PACS', 'PacsPortNumber', '')
ls_PacsUserName=f_fromdb_settings_sys ('PACS', 'PacsUserName', '')
ls_PacsUserPassword=f_fromdb_settings_sys ('PACS', 'PacsUserPassword', '')
OleObject oPACS
oPACS = Create OleObject
li_rc = oPACS.ConnectToNewObject ("PACSClient.App")
IF li_rc < 0 THEN
DESTROY oPACS
MessageBox("Connecting to COM Object Failed", &
"Error: " + String(li_rc))
Return
END IF
oPACS.PACSHostName=ls_PacsHostName
oPACS.PACSPortNumber=ls_PacsPortNumber
oPACS.UserName=ls_PacsUserName
oPACS.UserPassword=ls_PacsUserPassword
OleObject oStudiesManagement
oStudiesManagement = Create OleObject
oStudiesManagement.setautomationpointer(oPACS.StudyManagement)
OleObject oStudiesFilter
oStudiesFilter = Create OleObject
oStudiesFilter.setautomationpointer(oStudiesManagement.NewStudyFindFilter)
oStudiesFilter.SetPatientID(gch_rod_cis)
OleObject oStudiesInfoList
oStudiesInfoList = Create OleObject
oStudiesInfoList.setautomationpointer(oStudiesManagement.FindStudy(oStudiesFilter))
ls_pacsportnumber=string(oStudiesInfoList.Count) //error never mind .Count or .Count()
Messagebox('',ls_pacsportnumber)
OleObject oStudiesInfo
oStudiesInfo = Create OleObject
oStudiesInfo.setautomationpointer(oStudiesInfoList)
To wit I dont know it's possible to do it in PB7 but programmer's guide writes exactly 'SDK can use in every prog. languages which support OLE automation.' so it would be...
Thanks for help.