PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
Handler

Worklist handler function type.

Worklist handler function typeCalled by worklist_scp to retrieve matching scheduled procedure items for a Modality Worklist C-FIND query.

The handler should query the RIS/HIS database or worklist repository and return matching scheduled procedure step items.

Parameters
query_keysThe query dataset containing search criteria:
  • Patient demographics (PatientName, PatientID, etc.)
  • Scheduled Procedure Step Sequence with:
    • ScheduledStationAETitle (0040,0001)
    • ScheduledProcedureStepStartDate (0040,0002)
    • ScheduledProcedureStepStartTime (0040,0003)
    • Modality (0008,0060)
    • ScheduledPerformingPhysicianName (0040,0006)
calling_aeThe calling AE title of the requesting modality
Returns
Vector of matching worklist item datasets (empty if no matches)

Implementation

worklist_handler handler = [&database](
const dicom_dataset& query,
const std::string& calling_ae) {
std::vector<dicom_dataset> results;
// Extract filter criteria from Scheduled Procedure Step Sequence
auto sps_seq = query.get_sequence(tags::scheduled_procedure_step_sequence);
std::string station_ae, start_date, modality;
if (!sps_seq.empty()) {
station_ae = sps_seq[0].get_string(tags::scheduled_station_ae_title);
start_date = sps_seq[0].get_string(tags::scheduled_procedure_step_start_date);
modality = sps_seq[0].get_string(tags::modality);
}
// Query database and build worklist items
return database.query_worklist(station_ae, start_date, modality);
};