An ECG without an orderfrom a PDF on disk to PACS and EHR

The ECG is recorded first and nobody ordered it. The cart saves a PDF on a server disk, a tool watches that folder and stores the PDF in the PACS, and the EHR creates the order afterwards. It is the external-images flow, used inside the hospital. Click any step in the diagram or the list, or use the arrow keys.

  • DICOM
  • HL7 v2
  • Internal action
  • Dashed = reply
ECG folder, PACS and EHR message sequenceAn ECG PDF is saved to a server folder, a watcher tool wraps it in DICOM and stores it in PACS, PACS answers, sends an IAN to the EHR, the EHR creates a request with an accession number, sends an HL7 ORM to PACS, PACS updates the study and returns an ACK.Folder + watcherserver disk, import toolPACS serverEHR / EMRSave ECG as PDFTo a shared folder1Watch the folderBuild a DICOM object2C-STORE (Encapsulated PDF)3C-STORE-RSP (Success)4IAN (N-CREATE)5Create ECG requestAssign accession number6ORM^O01 (NW)7Match on Study UIDStore accession number8ACK^O019

Tip: click an arrow or box in the diagram to jump to that step. Time flows top to bottom.

Step 1 of 9

The ECG is saved as a PDF on a server disk

Core step

What happens

The ECG is recorded without an order in the hospital system. The cart (or the ECG management system) writes a PDF to a folder on a server disk. Nothing in the PACS or the EHR knows about it yet.

Why it is needed

This is the difference with a normal exam. There is no worklist entry, so the PDF carries no accession number and no Study Instance UID.

Technical details

  • File = ECG report as PDF (sometimes with an XML or text file beside it)
  • Patient ID and name = in the file name, the PDF text or a sidecar file
  • Accession number = none

All steps at a glance

Glossary

Watcher tool
A small service that monitors a folder, picks up each new file and sends it on. It is not part of the DICOM standard; every site builds or buys its own.
Encapsulated PDF
A DICOM object that carries a PDF file as its payload, so a document can be stored, queried and shown in the PACS like an image study.
IAN
Instance Availability Notification. A DICOM message saying “these objects are now ready”.
Accession number
The unique ID of one imaging request. It links a study to its order and report.
Study Instance UID
The globally unique ID of the study. Here the watcher tool creates it, because the PDF has none.
ORM / ACK
ORM is an HL7 order message. ACK is the receiver’s reply: “got it” or “error”.
MRN
Medical Record Number. The patient’s ID in the hospital.

Summary

  • The ECG is recorded without an order, so the PDF has no accession number and no Study Instance UID.
  • A watcher tool creates the Study Instance UID, wraps the PDF in an Encapsulated PDF object (1.2.840.10008.5.1.4.1.1.104.1) and sends it with C-STORE.
  • The tool moves or deletes the file only after the PACS answers with status 0000.
  • From the IAN onward the flow is the same as for external images: the EHR creates the request and the accession number and returns it in an HL7 ORM^O01.
  • The accession number goes in OBR-18 (IHE) and the Study Instance UID in ZDS-1; in the HL7 v2.5.1 option the message is an OMI^O23 with IPC-1 and IPC-3.
  • The weak spot is patient identity: if the ECG cart has a wrong or mistyped Patient ID, the order is created for the wrong patient or cannot be matched.

The 9 steps in plain text

  1. The ECG is saved as a PDF on a server disk

    The ECG is recorded without an order in the hospital system. The cart (or the ECG management system) writes a PDF to a folder on a server disk. Nothing in the PACS or the EHR knows about it yet.

    Why: This is the difference with a normal exam. There is no worklist entry, so the PDF carries no accession number and no Study Instance UID.

  2. A watcher tool finds the file

    A separate tool monitors the folder. When a new PDF has been written completely, it reads the patient data, creates a new Study Instance UID and wraps the PDF in a DICOM Encapsulated PDF object.

    Why: The PACS speaks DICOM, not file shares. The tool is the bridge, and it must invent the identifiers the PDF does not have.

  3. The tool stores the PDF in PACS

    The tool opens an association to the PACS and stores the object with C-STORE. The PACS stores it like any other study, but it is not linked to a request.

    Why: From here the PACS sees an ordinary study without an accession number, the same situation as images from outside the hospital.

  4. PACS confirms the store

    The PACS answers with a status. Only on Success should the tool mark the file as done, for example by moving it to a "processed" folder. On any failure it keeps the file and retries.

    Why: If the tool deletes the file before the PACS has confirmed, an ECG can be lost without anyone noticing.

  5. PACS notifies the EHR with an IAN

    The PACS sends the EHR an Instance Availability Notification: “new images are ready, and this is where to fetch them.” It is only a notification; no document travels in it.

    Why: The EHR cannot look inside the PACS. This is how it learns that an ECG exists that nobody ordered.

  6. EHR creates the request and accession number

    The EHR checks which patient the ECG belongs to, creates an internal request for it (an ECG done without a prior order) and generates a unique accession number.

    Why: The EHR owns accession numbers. Creating the order afterwards gives the ECG a place in the record, and in billing and reporting.

  7. EHR sends HL7 ORM back to PACS

    The EHR sends the new number to the PACS as an HL7 text message, together with the Study Instance UID that names the exact study.

    Why: The accession number alone does not tell the PACS which study it belongs to. The UID removes the guesswork.

  8. PACS reconciles the study

    The PACS looks up the study by its UID, saves the accession number with it and, depending on the vendor, also writes it into the object headers.

    Why: This is the moment the ECG is linked to its request and can be found from the patient record.

  9. PACS acknowledges

    The PACS replies “done” (or “error”) to the EHR.

    Why: Without a reply the EHR cannot know the PACS applied the number, and the two systems can silently drift apart.

Common questions

How do I get an ECG PDF from a folder into PACS?

When an ECG is made without an order, a watcher tool picks up the PDF from the server folder, wraps it in a DICOM Encapsulated PDF object with a new Study Instance UID and stores it in the PACS with C-STORE. From there the flow is the same as for external images: the PACS sends the EHR an IAN, the EHR creates the missing request and accession number, and sends it back in an HL7 ORM^O01 with the Study Instance UID. The PACS stores the number on the study and replies with an HL7 ACK.

Which DICOM object holds an ECG PDF?

The Encapsulated PDF Storage SOP Class (1.2.840.10008.5.1.4.1.1.104.1). The PDF is the Encapsulated Document (0042,0011), and the MIME type (0042,0012) must be application/pdf, the only value this IOD allows. This stores the report as a document. It is not the ECG signal: a recording with the waveform itself uses a waveform SOP Class such as 12-lead ECG Waveform Storage (1.2.840.10008.5.1.4.1.1.9.1.1).

Why does the PACS send an IAN if the tool already knows the study?

The tool only talks to the PACS. The EHR has no idea that an ECG without an order exists until the PACS tells it. The IAN is the trigger for the EHR to create the request. Some sites let the watcher tool notify the EHR directly instead, or start the flow with an HL7 message.

What can go wrong with a watched folder?

The tool may read a file that is still being written, so wait until it is complete. A PDF can be sent twice after a restart, so the tool needs a record of what it has already done. The tool must not delete a file before the PACS confirms the store. And the Patient ID taken from the file name or PDF text must be checked, because a wrong ID makes the order land on the wrong patient.

Why not order the ECG first, so there is a worklist entry?

When the ECG is ordered first, the cart can use the modality worklist and the study gets its accession number at the start, as in the worklist lesson. This lesson covers the case where the exam happens first, which is common for bedside and emergency ECGs.

Is the accession number in OBR-3 or OBR-18?

In the IHE Radiology profile the accession number is in OBR-18 and OBR-3 is the filler order number. In the HL7 v2.5.1 option it is in IPC-1. Some interfaces are set up differently, so check the interface specification of both systems.

Try it yourself

← All lessons