> ## 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.

# Architecture

> Vendor-neutral responsibilities and data flow for radiology integration.

The radiology integration keeps HMIS independent of any particular PACS or modality vendor. HMIS exchanges normalized clinical messages with OIE; PACS-specific APIs remain inside OIE channels.

```mermaid theme={null}
flowchart LR
  H[HMIS] -->|Accession lookup| O[Open Integration Engine]
  O -->|PACS-specific worklist API| P[PACS]
  M[Modality] -->|DICOM MWL C-FIND| P
  M -->|DICOM C-STORE| P
  P -->|Stable study event or vendor API| O
  O -->|Normalized study JSON| H
  H -->|Study Instance UID viewer link| V[OHIF or another viewer]
  V -->|DICOMweb| P
```

## Component responsibilities

| Component     | Responsibility                                                                                                       |
| ------------- | -------------------------------------------------------------------------------------------------------------------- |
| HMIS          | Orders, billing state, accession numbers, examination details, reporting, authorization, audit, and viewer links     |
| OIE           | Authentication, routing, PACS-specific API conversion, polling/webhooks, normalization, retries, and transport audit |
| PACS          | Modality worklist, DICOM object storage, study indexing, DICOMweb, and study availability                            |
| Modality      | Query the PACS worklist and send acquired DICOM objects directly to the PACS                                         |
| Viewer        | Retrieve studies from the PACS through DICOMweb                                                                      |
| Mock modality | Local DICOM MWL and C-STORE simulation only                                                                          |

<Warning>
  The modality does not send images through OIE. In the tested flow it performs DICOM MWL and C-STORE directly against the PACS. OIE handles control-plane integration between HMIS and PACS.
</Warning>

## Vendor-neutral boundary

HMIS knows only the immutable `pacs_code`, accession number, normalized study identity, and a viewer URL template. It does not call Orthanc REST endpoints.

The demo uses Orthanc, but a different PACS can be introduced by replacing these OIE adapter details:

* the worklist publication destination;
* the stable-study notification or polling mechanism;
* PACS authentication and connection details;
* the viewer URL template and DICOMweb deployment.

The HMIS worklist and study-ingestion API contracts remain unchanged.
