# Lab results

Attach laboratory results to DHIS2 tracker cases, from HL7 v2 and FHIR sources.

A case is registered in a DHIS2 tracker program when a specimen is collected. The laboratory analyses the specimen and reports the result through its own systems, as an HL7 v2 ORU message or as a FHIR Observation. Zato receives the result, identifies the case by the specimen ID, and writes the result to the case in DHIS2.

This section describes each stage of the integration. The pages build on one another and are read in order.

## Processing flow {#processing-flow}

```yaml
name: Laboratory result to DHIS2 case
actors:
  - id: laboratory
    label: Laboratory
  - id: zato
    label: Zato
  - id: dhis2
    label: DHIS2
steps:
  - from: laboratory
    to: zato
    label: HL7 v2 ORU message or FHIR Observation
    align: left
  - from: zato
    to: zato
    label: Test and result codes become DHIS2 option codes
  - from: zato
    to: dhis2
    label: GET /api/tracker/events - the case by specimen ID
  - from: dhis2
    to: zato
    kind: return
    label: Enrollment and organisation unit of the case
  - from: zato
    to: dhis2
    label: POST /api/tracker - the lab result event
  - from: dhis2
    to: zato
    kind: return
    label: Import summary
  - from: zato
    to: laboratory
    kind: return
    label: HL7 v2 acknowledgement
    align: left
```

## The DHIS2 program {#the-dhis2-program}

The integration assumes a tracker program with two program stages, in line with the DHIS2 laboratory interoperability reference implementation:

- A **lab request** stage, completed when the specimen is collected. It holds the specimen ID, which is the only value the laboratory and DHIS2 have in common.
- A **lab result** stage, which is repeatable. Each result is one event on this stage, and a corrected result updates the same event rather than adding a new one.

The services on the following pages look up the lab request event by its specimen ID, read the enrollment and organisation unit from it, and write the result to the lab result stage of the same enrollment.

## Pages in this section {#pages-in-this-section}

- [Setup](https://zato.io/docs/dev/healthcare/dhis2/lab-results/setup.html) - The security definition, the REST connections and the configuration files
- [Write a result](https://zato.io/docs/dev/healthcare/dhis2/lab-results/write.html) - Find the case by specimen ID and write the result event
- [Results over HL7 v2](https://zato.io/docs/dev/healthcare/dhis2/lab-results/hl7.html) - Receive ORU messages over MLLP and acknowledge them
- [Results from FHIR](https://zato.io/docs/dev/healthcare/dhis2/lab-results/fhir.html) - Poll a FHIR server for new Observations
- [Held results](https://zato.io/docs/dev/healthcare/dhis2/lab-results/held.html) - Results that arrive before their case exists
- [Weekly counts](https://zato.io/docs/dev/healthcare/dhis2/lab-results/weekly.html) - Aggregate counts for a DHIS2 data set

## See also {#see-also}

- [DHIS2 overview](https://zato.io/docs/dev/healthcare/dhis2/index.html) - All DHIS2 integration pages
- [HL7 v2 over MLLP](https://zato.io/docs/dev/healthcare/hl7v2/mllp/index.html) - Channels that receive HL7 v2 messages
- [FHIR](https://zato.io/docs/dev/healthcare/hl7/fhir/index.html) - Connections to FHIR servers

## Learn more {#learn-more}

- [Healthcare interface engine](https://zato.io/docs/dev/healthcare/) - Clinical messages, FHIR, conversion and operations
- [HL7 v2 parsing](https://zato.io/docs/dev/healthcare/hl7/v2/parsing/) - Messages as typed objects, with field access and validation
- [MLLP channels](https://zato.io/docs/dev/healthcare/hl7v2/mllp/) - Receiving and sending HL7 v2 over MLLP sockets
- [FHIR integrations](https://zato.io/docs/dev/healthcare/hl7/fhir/) - Read and write FHIR resources, with paths, bundles and extensions
- [HL7 v2 to FHIR](https://zato.io/docs/dev/healthcare/hl7/to-fhir/) - Converting v2 messages into FHIR bundles, codes and references included
- [EDIFACT](https://zato.io/docs/dev/healthcare/edifact/) - Parsing interchanges, dialects and the transports they arrive on
- [Transformation](https://zato.io/docs/dev/healthcare/transformation/) - One message in, another standard out, in ordinary Python
- [Audit log](https://zato.io/docs/dev/healthcare/audit-log.html) - Every message with its acknowledgment, searchable by patient identifier
- [AI in clinical interfaces](https://zato.io/docs/dev/healthcare/ai/) - Services calling LLMs and AI agents calling clinical services as tools
