dicom-worklist
v1.2.0
Published
DICOM Modality Worklist (MWL) C-FIND client for Node.js. Query scheduled procedures from any PACS supporting MWL SOP Class.
Maintainers
Readme
dicom-worklist
DICOM Modality Worklist (MWL) client for Node.js.
Query scheduled procedures from any PACS that supports the Modality Worklist Information Model - FIND SOP Class (1.2.840.10008.5.1.4.31).
Built on top of dcmjs-dimse.
Install
npm install dicom-worklistQuick Start
const { WorklistClient } = require('dicom-worklist');
const client = new WorklistClient({
host: 'localhost',
port: 4242,
calledAet: 'ORTHANC',
callingAet: 'MY_SCU',
});
// Query today's scheduled procedures
const items = await client.queryToday();
for (const item of items) {
console.log(
`${item.scheduled_time} | ${item.modality} | ${item.station_name} | ${item.exam_description}`
);
}API
new WorklistClient(options)
| Option | Type | Default | Description |
|---|---|---|---|
| host | string | 'localhost' | PACS hostname or IP |
| port | number | 4242 | DICOM port |
| calledAet | string | 'ORTHANC' | Called AE Title (PACS) |
| callingAet | string | 'WORKLIST_SCU' | Calling AE Title (this client) |
| timeout | number | 30000 | Timeout in ms |
client.echo()
Tests the DICOM association with a C-ECHO request.
Returns Promise<{ ok: boolean, error?: string }>.
client.queryWorklist(filters?)
Performs a MWL C-FIND query.
| Filter | Type | Default | Description |
|---|---|---|---|
| date | string | today (YYYYMMDD) | Scheduled date filter |
| modality | string | '' (all) | Filter by modality (e.g. 'CT', 'MR') |
| stationAet | string | '' (all) | Filter by station AE Title |
Returns Promise<Array<WorklistItem>>.
client.queryToday()
Shortcut for queryWorklist() with today's date.
WorklistItem
Each item returned by queryWorklist has the following shape:
{
patient_name: 'DOE^JOHN^M', // Full DICOM patient name (LAST^FIRST^MIDDLE)
patient_id: 'WL-001',
modality: 'CT',
exam_description: 'CT CHEST WITHOUT CONTRAST',
body_part: 'CHEST',
station_name: 'CT-SIEMENS-01',
station_aet: 'CT_SIEMENS_01',
scheduled_date: '20260101',
scheduled_time: '08:30',
accession_number: 'ACC001',
}Utility functions
For privacy compliance (LGPD/GDPR), use the exported getInitials() helper:
const { WorklistClient, getInitials } = require('dicom-worklist');
const items = await client.queryToday();
for (const item of items) {
console.log(getInitials(item.patient_name)); // 'J.D.'
}PACS Configuration
Your PACS must:
- Have the Worklist plugin enabled
- List this client's AE Title in its allowed modalities
Orthanc example (orthanc.json)
{
"Worklists": {
"Enable": true,
"Database": "/var/lib/orthanc/worklists"
},
"DicomModalities": {
"my_client": ["MY_SCU", "*", 11112]
}
}Testing
With Orthanc running on localhost:4242:
npm testHow It Works
This library performs a DICOM C-FIND at the MWL level using the ModalityWorklistInformationModelFind SOP Class. The query dataset is built manually (not via CFindRequest.createWorklistFindRequest()) to avoid encoding issues with certain VR types that cause DCMTK-based servers to abort the association.
License
MIT
