Download OpenAPI specification:Download
The DIBBs Validation service offers a REST API for validating healthcare messages (e.g., whether messages are in the proper format and contain user-defined fields of interest).
You can run the Validation service using Docker, any other OCI container runtime (e.g., Podman), or directly from the Python source code.
To run the Validation service with Docker, follow these steps.
❯ docker -v
Docker version 20.10.21, build baeda1f
docker pull ghcr.io/cdcgov/dibbs-ecr-viewer/validation:latest
. docker run -p 8080:8080 validation:latest
.Congratulations, the Validation service should now be running on localhost:8080
!
We recommend running the Validation service 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/validation/
.python -m venv .venv
.source .venv/bin/activate
(MacOS and Linux), venv\Scripts\activate
(Windows Command Prompt), or .venv\Scripts\Activate.ps1
(Windows PowerShell).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 Validation service from source code instead of downloading it from the PHDI repository, follow these steps.
git clone https://github.com/CDCgov/dibbs-ecr-viewer
./dibbs-ecr-viewer/containers/validation/
.docker buildx build --platform linux/amd64 -t validation .
.When viewing these docs from the /redoc
endpoint on a running instance of the Validation service or the DIBBs website, detailed documentation on the API will be available below.
The request must have these keys included. The message
must be escaped
{
"message_type": "ecr",
"include_error_types": "errors",
"message": "<ClinicalDocument xmlns=\\\"urn:hl7-org:v3\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\">\\n<realmCode code=\\\"US\\\"/>\\n<typeId extension=\\\"POCD_HD000040\\\" root=\\\"2.16.840.1.113883.1.3\\\"/>\\n<templateId root=\\\"1.2.840.114350.1.72.1.51693\\\"/>\\n<templateId root=\\\"2.16.840.1.113883.10.20.22.1.1\\\"/>\\n<templateId extension=\\\"2015-08-01\\\" root=\\\"2.16.840.1.113883.10.20.22.1.1\\\"/>\\n<templateId extension=\\\"2016-12-01\\\" root=\\\"2.16.840.1.113883.10.20.15.2\\\"/>\\n<id root=\\\"8675309a-7754-r2d2-c3p0-973d9f777777\\\"/>\\n<code code=\\\"55751-2\\\" codeSystem=\\\"2.16.840.1.113883.6.1\\\" codeSystemName=\\\"LOINC\\\" displayName=\\\"Initial Public Health Case Report\\\"/>\\n<title>Initial Public Health Case Report</title>\\n<effectiveTime value=\\\"20230409130417-0700\\\"/>\\n<confidentialityCode code=\\\"N\\\" codeSystem=\\\"2.16.840.1.113883.5.25\\\" displayName=\\\"Normal\\\"/>\\n<languageCode code=\\\"en-US\\\"/>\\n<setId assigningAuthorityName=\\\"EPC\\\" extension=\\\"8675309a-7754-r2d2-c3p0-973d9f777777\\\" root=\\\"1.2.840.114350.1.13.297.3.7.1.1\\\"/>\\n<versionNumber value=\\\"2\\\"/>\\n<recordTarget>\\n<patientRole>\\n<id extension=\\\"MRN1234567890\\\" root=\\\"1.2.840.114350.1.13.297.3.7.3.688884.100\\\"/>\\n<addr use=\\\"HP\\\">\\n<streetAddressLine>4720 MEGA ST. NW</streetAddressLine>\\n<city>NORTH CANTON</city>\\n<state>OH</state>\\n<postalCode>44720</postalCode>\\n<country>USA</country>\\n<useablePeriod xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:type=\\\"IVL_TS\\\">\\n <low value=\\\"20181129\\\"/>\\n<high nullFlavor=\\\"NA\\\"/>\\n</useablePeriod>\\n</addr>\\n<telecom nullFlavor=\\\"UNK\\\"/>\\n<patient>\\n<name use=\\\"L\\\">\\n<given>Jon</given>\\n<family>Shepherd</family>\\n<validTime>\\n<low nullFlavor=\\\"NA\\\"/>\\n<high nullFlavor=\\\"NA\\\"/>\\n</validTime>\\n</name> ... </ClinicalDocument>"
}
graph TD
A[Validation]
subgraph API Endpoints
direction TB
N[POST /validate]
end
A --> N
style A fill:#f9f,stroke:#333,stroke-width:4px,color:#000
style API Endpoints fill:#bfb,stroke:#333,stroke-width:2px
This endpoint checks if the value presented in the 'message' key is a valid example of the type of message specified in the 'message_type'.
message_type required | string (Message Type) Enum: "ecr" "elr" "vxu" "fhir" The type of message to be validated. |
include_error_types required | string (Include Error Types) A comma separated list of the types of errors that should be included in the return response. Valid types are fatal, errors, warnings, information |
message required | string (Message) The message to be validated. |
Rr Data (string) or Rr Data (null) (Rr Data) If validating an eICR message, the accompanying Reportability Response data. |
{- "message_type": "ecr",
- "include_error_types": "string",
- "message": "string",
- "rr_data": "string"
}
{- "message_valid": "True",
- "validation_results": {
- "details": "Validation completed with no fatal errors!"
}
}