Download OpenAPI specification:Download
The DIBBs Message Refiner service offers a REST API to pare down an incoming message to only the user-specified elements.
You can run the Message Refiner run using Docker, any other OCI container runtime (e.g., Podman), or directly from the Python source code.
To run the Message Refiner with Docker, follow these steps.
Confirm that you have Docker installed by running docker -v
. If you don't see a response similar to what's shown below, follow these instructions to install Docker.
Download a copy of the Docker image from the PHDI repository by running docker pull ghcr.io/cdcgov/dibbs-ecr-viewer/message-refiner:latest
Run the service with docker run -p 8080:8080 message-refiner:latest
.
Congratulations, the Message Refiner should now be running on localhost:8080
!
We recommend running the Message Refiner from a container, but if that isn't feasible for a given use -case, you can also run the service directly from Python using the steps below.
git clone https://github.com/CDCgov/dibbs-ecr-viewer
./dibbs-ecr-viewer/containers/message-refiner/
.python -m venv .venv
.source .venv/bin/activate
(MacOS and Linux), venv\Scripts\activate
(Windows Command Prompt), or .venv\Scripts\Activate.ps1
(Windows Power Shell).pip install -r requirements.txt
into your virtual environment.localhost:8080
with python -m uvicorn app.main:app --host 0.0.0.0 --port 8080
.To build the Docker image for the Message Refiner from source instead of downloading it from the PHDI repository follow these steps.
git clone https://github.com/CDCgov/dibbs-ecr-viewer
./dibbs-ecr-viewer/containers/message-refiner/
.docker build -t message-refiner .
.When viewing these docs from the /redoc
endpoint on a running instance of the Message Refiner or the DIBBs website, detailed documentation on the API will be available below.
flowchart LR
subgraph requests["Requests"]
direction TB
subgraph GET["fas:fa-download <code>GET</code>"]
hc["<code>/</code>\n(health check)"]
end
subgraph PUT["fas:fa-upload <code>PUT</code>"]
ecr["<code>/ecr</code>\n(refine eICR)"]
end
end
subgraph service[REST API Service]
direction TB
subgraph mr["fab:fa-docker container"]
refiner["fab:fa-python <code>message-refiner<br>HTTP:8080/</code>"]
end
subgraph tcr["fab:fa-docker container"]
tcr-service["fab:fa-python <code>trigger-code-reference<br>HTTP:8081/</code>"] <==> db["fas:fa-database SQLite DB"]
end
mr <==> |<code>/get-value-sets</code>| tcr
end
subgraph response["Responses"]
subgraph JSON["fa:fa-file-alt <code>JSON</code>"]
rsp-hc["fa:fa-file-code <code>OK</code> fa:fa-thumbs-up"]
end
subgraph XML["fas:fa-chevron-left fas:fa-chevron-right <code>XML</code>"]
rsp-ecr["fas:fa-file-code Refined eICR"]
end
end
hc -.-> mr -.-> rsp-hc
ecr ===> mr ===> rsp-ecr
For further details on <section>
, <entry>
, and <templateId>
elements, please see eICR-Notes.md for an explanation of trigger code <templateId>
s, which sections they're in, and the <observation>
data that should be returned in the refined eICR output.
This endpoint refines an incoming XML eCR message based on sections to include and/or trigger code conditions to include, based on the parameters included in the endpoint.
The return will be a formatted, refined XML, limited to just the data specified.
Sections To Include (string) or Sections To Include (null) (Sections To Include) The sections of an ECR to include in the refined message. Multiples can be delimited by a comma. Valid LOINC codes for sections are:
| |
Conditions To Include (string) or Conditions To Include (null) (Conditions To Include) The SNOMED condition codes to use to search for relevant clinical services in the ECR. Multiples can be delimited by a comma. |
"<ClinicalDocument xmlns=\"urn:hl7-org:v3\">...</ClinicalDocument>"