Skip to content

Why doesn't findscu return all null values #862

@sfc-gh-jyost

Description

@sfc-gh-jyost

I don't understand why some findscu results will return ' ' if the tag is null or not there and sometimes returns nothing. Is there a way to force it?

Below my code for PATIENT level. My results are below that...

def findscu(f_aet,f_port,f_host):
    ae = AE()
    ae.add_requested_context(PatientRootQueryRetrieveInformationModelFind)
    # Create our Identifier (query) dataset
 
    #PATIENT LEVEL
    ds.PatientName= ''
    ds.PatientID=''
    ds.PatientBirthDate=''
    ds.PatientSex=''
    ds.EthnicGroup=''
    ds.PatientComments=''   
    ds.OtherPatientIDs=''
    ds.PatientSize=''
    ds.PatientWeight=''
    ds.PregnancyStatus=''
    ds.RequestingPhysician='' 
    
    # <<<<<<< examination_level
    ds.QueryRetrieveLevel = qrlevel #'PATIENT'
    # Associate with the peer AE at IP 127.0.0.1 and port 11112
    ####remove hardcode aet and port
    assoc = ae.associate(f_host, f_port)
    st.text("host= " + f_host)
    st.text(f_port)
    if assoc.is_established:
        # Send the C-FIND request
       responses = assoc.send_c_find(ds, PatientRootQueryRetrieveInformationModelFind)
       results_list = []
       for (status, identifier) in responses:
           if status:
               #st.text('C-FIND query status: 0x{0:04X}'.format(status.Status))
               #append the results
               results_list.append(identifier)
  
        assoc.release()
        return results_list
    else:
        return None

results

(0008, 0005) Specific Character Set              CS: ''
(0008, 0052) Query/Retrieve Level                CS: 'PATIENT'
(0008, 0054) Retrieve AE Title                   AE: 'ANY-SCP'
(0010, 0010) Patient's Name                      PN: 'aa'
(0010, 0020) Patient ID                          LO: '33'
(0010, 0030) Patient's Birth Date                DA: '19600101'
(0010, 0040) Patient's Sex                       CS: 'M'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions