Search code examples
c#dicomfo-dicom

With Fo-Dicom, how do you make a case-insensitive MWL CFindRequest?


I can make these great worklist queries like this one...

//Worklist MWL PATIENTID query
var cf = DicomCFindRequest.CreateWorklistQuery();
cf.Dataset.AddOrUpdate(DicomTag.PatientID, szPatientIDsearch);
cf.OnResponseReceived = (DicomCFindRequest rq, DicomCFindResponse rp) =>
{
       if (rp.HasDataset)
       {
           worklistItems.Add(rp.Dataset);
       }
};
Dicom.Network.Client.DicomClient client = new Dicom.Network.Client.DicomClient(IPAddress, mwlserver.port, false, Preferences.SendingAETitle, mwlserver.AETitle, 5000, 10000, 50, 5);
await client.AddRequestAsync(cf);
await client.SendAsync();

But how do you make the Patient ID (0010,0020) or a Patient's Name (0010,0010) case insensitive? Is there a DICOM Tag to add/set in MWL Request?


Solution

  • As an MWL SCU, controlling the case sensitivity of MWL Query is practically (explained below) not possible. Also, this is more about specifications; not about toolkit. So FO-DICOM or other, does not make much difference.

    Workflow of MWL communication is explained in this answer which may help you.

    • You are acting as MWL SCU.
    • You send MWL Query (C-FIND) to third party MWL SCP.
    • SCPs generally store Order data in RDBMS; this answer assumes it (does not matter any way).
    • Based on your filter parameters (DICOM Tags you send (Patient ID (0010,0020) or a Patient's Name (0010,0010) as you said in question)), SCP will generate SQL Query.
    • SCP will then execute this SQL Query on its RDBMS and will get the rows.
    • Data from these rows will be mapped to each MWL Response (see link above for description) which will be sent back to you.

    As you can see now, case sensitivity is controlled entirely on SCP while generating and executing the query (or say behaviour of underlying RDBMS).
    You as SCU cannot control this behaviour.

    Is there a DICOM Tag to add/set in MWL Request?

    No; there is no standard DICOM Tag that SCU can add/set in C-FIND request that indicates SCP to run case sensitive/insensitive query.

    As @kritzel_sw said in the comment:

    With standard worklist it is impossible to control this from the SCU side. With extended negotiation it would be possible to do this, but I have never seen that implemented in practice. – kritzel_sw

    Extended Negotiation may be the solution; but in practice, I never come across any SCP implemented it.
    As an SCU, you should not rely on optional features of SCP.