> ## Documentation Index
> Fetch the complete documentation index at: https://hmis-docs.derrickmugabwa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Mock modality

> Query DICOM worklists and transmit real DICOM sample images in the demo stack.

The mock modality behaves like imaging equipment at the network boundary. It communicates with the PACS using DICOM rather than calling HMIS or OIE.

## Connection defaults

| Setting          | Value                   |
| ---------------- | ----------------------- |
| PACS host        | `orthanc`               |
| PACS DICOM port  | `4242`                  |
| Called AE Title  | `HMIS_PACS`             |
| Calling AE Title | `HMIS_MODALITY`         |
| Browser UI       | `http://localhost:8091` |

## Query a worklist

<Steps>
  <Step title="Enter the accession">
    Enter or scan the HMIS accession number, such as `ACC000123`.
  </Step>

  <Step title="Query DICOM MWL">
    The mock sends a Modality Worklist C-FIND request directly to Orthanc and displays the matching patient and procedure fields.
  </Step>

  <Step title="Select the worklist item">
    Selecting the worklist item supplies the order identity that must be written into the DICOM study.
  </Step>
</Steps>

## Load a sample image

Use only a deidentified DICOM sample. The modality is currently useful for DX samples and can be extended for other modalities.

The selected worklist supplies these important DICOM values:

| DICOM value           | Source                              |
| --------------------- | ----------------------------------- |
| `PatientID`           | HMIS patient identifier through MWL |
| `PatientName`         | HMIS patient name through MWL       |
| `PatientBirthDate`    | HMIS date of birth through MWL      |
| `PatientSex`          | HMIS sex through MWL                |
| `AccessionNumber`     | HMIS radiology examination          |
| `StudyInstanceUID`    | PACS worklist item when provided    |
| `Modality`            | Mapped HMIS procedure               |
| Procedure description | Mapped HMIS service                 |

The mock creates new series and SOP Instance UIDs for the transmitted objects. It must not retain the sample file's original patient or accession identity.

## Transmit

Select **Transmit** to send the DICOM object directly to the PACS with C-STORE. A successful DICOM association and C-STORE response confirms transport only; wait for the PACS to declare the study stable before expecting the HMIS link.

<Warning>
  Mark the HMIS examination `pending` before transmitting during the demo. If the stable-study event reaches HMIS while the requisition is still `open`, HMIS quarantines it because the examination has not been marked performed.
</Warning>
