Search code examples
fo-dicom

Can I query the MWL (Modality Worklist) by accession number in FO-DICOM?


How can I query the MWL using FO-DICOM by accession number? When I call the CreateWorklistQuery method accession number is not one of the parameters i can use.


Solution

  • It's very easy to do. A WorklistQuery is a Dataset, that contains some DicomTags that are queried. Some of those DicomTags may contain values, then the Worklist Server has to use those values as filters.

    So basically a WorklistQuery is a normal DicomDataset, that you can extend and manipulate. The helper-methods DicomCFindRequest.CreateWorklistQuery() is a helper-method that creates common used datasets. But you can then update/change this DicomDataset before sending to the server.

    var accessionNumberToFilter = "ABCD1234";
    [....]
    var findRequest = DicomCFindRequest.CreateWorklistQuery(); // create a basic query Dataset without any filters
    findRequest.Dataset.AddOrUpdate(DicomTag.AccessionNumber, accessionNumberToFilter);
    [....]
    await client.AddRequestAsync(findRequest);
    await client.SendAsync();