Testing HL7 and worklist integrations on production traffic
- Environment (0008,1010)
- Hospital edge nodes with Mirth Connect → cloud platform; a test server identical to production
- Area (0008,1030)
- Integration testing
- Period (0008,0020)
- 2025 · about 2 months to build
- My role (0008,1070)
- Design and development; used by the integration team
- Stack (0018,1030)
- Go · HL7 v2 · DICOM Modality Worklist · C-STORE · pcap
- Status (0040,0252)
- COMPLETED
Background
A radiology exam starts as an HL7 v2 message long before any image exists. The hospital's RIS or EHR sends an ORM order: new order, then status changes such as scheduled, started and completed. The integration engine turns that order into an entry in the Modality Worklist (MWL).
The modality, a CT or MR scanner for example, asks for its worklist with a C-FIND query. The technologist picks the patient, and the scanner copies fields from the worklist entry into every image: Patient ID, Accession Number, Study Instance UID, procedure description. The images then go out with C-STORE. At the end, the radiologist's report comes back as an ORU message.
Each step depends on the previous one. If the order is mapped wrong, the worklist entry is wrong, and the images carry the wrong data into the archive. Every modality model fills its fields a little differently, and every hospital fills its HL7 a little differently. That is why an integration that works on clean sample data can still break on the first day of real traffic.
A pcap is a packet capture: a file with the raw network traffic between systems, here HL7 and DICOM exchanges, that can be taken apart later.
Indication
New integrations were tested on a test server identical to production, with the same Mirth Connect setup. The customer prepared fake data by hand and sent it in. The setup was the same as production; the data was not.
With hand-made data there was no way to see what real traffic looks like: which HL7 fields arrive empty, how each modality queries the worklist and fills the study from it. Modality Worklist could not be tuned per modality, and the HL7-to-platform mapping could not be checked against real messages.
The gaps showed up at go-live. The first days brought dozens of bugs, most of them from a worklist that was not fully configured: studies arrived without the expected Study Instance UID or with the wrong Study Description. Statuses broke too: scheduled and completed were not handled correctly, so worklists filled up with exams that were already done. Every check needed people on both sides, sending a test order or running a C-FIND by hand, with up to 10 people involved in one round.
Technique
Step 1: capture and split. Start from a pcap of production traffic. Take it apart into HL7 messages and DICOM exchanges, and link them into exams by Accession Number and Patient ID, so an order, its worklist query and its images are known to belong together.
Step 2: keep the structure, drop the values. From all the exams, pick the ones that are unique in structure: a particular set of DICOM tags, a particular set of filled HL7 fields. For each field, store only what it looks like, not what it contains. An Accession Number, for example, becomes a rule: digits here, letters there, this length, these extra characters. New values are generated from those rules. No patient data is kept, so de-identification is not a separate step; there is simply nothing to remove.
Step 3: replay the whole workflow. A Go application with its own interface turns the templates back into traffic, on the same test server. It does not send isolated messages; it plays the full sequence: a new HL7 order, its status changes, the worklist entry being created, a C-FIND for the worklist exactly as a real modality would send it, and then a study built from the answer, sent with C-STORE through the edge node into the platform. Every step is configurable: which steps run, in what order, with which test suite. A scenario can run on repeat, faster or slower, so the same tool checks both that the workflow is right and that the system holds the load.
flowchart TB
subgraph learn["1 · LEARN FROM PRODUCTION"]
direction LR
p1[("pcap")] --> p2["Split<br/>HL7 · DICOM"] --> p3["Link by<br/>Accession + Patient ID"] --> p4["Templates<br/>structure only, no values"]
end
subgraph replay["2 · REPLAY ON THE TEST SERVER"]
direction LR
r1["Go replayer"] -->|ORM order + statuses| r2["Edge node<br/>Mirth Connect"]
r1 -->|MWL C-FIND| r2
r2 -->|worklist entry| r1
r1 -->|C-STORE study| r2
r2 --> r3["Cloud platform"]
end
learn --> replay
classDef on stroke:#38bdf8,color:#eef0f2
class p4,r1 onFindings
- Production shape, no production data. Templates keep which tags and fields are present and how values look, never the values themselves.
- Whole workflows, not single messages. Order, status changes, worklist query and study are played in sequence, the way a hospital and a modality actually produce them.
- The modality step is simulated. The replayer queries the worklist like a real modality and builds the study from the answer, so worklist bugs show up on the test server instead of at go-live.
- Statuses tested end to end. Scheduled and completed now go through the same path as in production, so a worklist that keeps finished exams is caught before launch.
- Functional and load testing with one tool. The same scenario runs once to check correctness, or on repeat at a higher rate to check stability.
- Less coordination. One setup session replaces rounds of people on both sides sending orders and running queries by hand. Then the integration team configures the platform, a soft go-live, and the full go-live.
- What stays manual. The content of ORU reports still needed small adjustments, such as extra text. That is what radiologists and referring physicians want to see, not a system fault.
Impression
| Tag | Data |
|---|---|
| (0040,A30A) | Test data, beforePrepared by hand by the customer |
| (0040,A30A) | Test data, afterGenerated from the structure of production traffic |
| (0040,A30A) | What is replayedSingle messages → full workflow |
| (0040,A30A) | Bugs in the first days of go-liveDozens → close to zero |
| (0040,A30A) | Patient data storedNone, structure only |
| (0040,A30A) | People per test roundUp to 10 → one setup session |
| (0040,A30A) | Build timeAbout 2 months |
Lessons
- A copy of production is not enough if the data is fake. The same servers with hand-made messages miss exactly the cases that break at go-live.
- Keep the structure, not the values. Which fields are filled and what they look like is what matters for testing. Without stored values there is nothing to de-identify.
- Test the workflow, not the message. Most worklist bugs only appear when a modality queries the worklist and builds a study from it, so simulate that step too.
- Statuses deserve their own test. An order that never reaches completed in the worklist looks fine in every single message and still clutters the technologist's screen.
- Know what tooling can't settle. Report wording is a clinical preference. Plan a short review with the people who read the reports.
Related service
| (0009,1105) | HL7 integration on Mirth Connect and Open Integration Engine → |
| (0009,1101) | Custom edge integration → |