# Callback Payloads

JondaX POSTs processed results to the endpoint URL you configure on the Integration page.

In the examples below, `[api-header]` and `[api-key]` are placeholders for the header name and value you configured — JondaX sends your chosen header on every callback.

> All sample data is synthetic and does not represent real individuals.


## JSON — Inline

**Content-Type:** `application/json`

```http
POST /api/results HTTP/1.1
Host: api.example.com
Content-Type: application/json
[api-header]: [api-key]

{
  "customerId": 11,
  "uploadId": "16227c8c-aa20-443d-ad50-528034f54d7a",
  "fileName": "E20UNMDMCB_96dpi_1.png",
  "transactionId": 484,
  "outputFormat": "JSON",
  "totalTests": 3,
  "Results": [
    {
      "Date": "2024-03-14",
      "Biomarker-Name": "Haemoglobin",
      "Result": "17.00",
      "Low-Ref-Range": "13.00",
      "High-Ref-Range": "17.50",
      "Unit-of-measurement": "g/dL",
      "Comment": ""
    },
    {
      "Date": "2024-03-14",
      "Biomarker-Name": "Haematocrit",
      "Result": "0.52 H",
      "Low-Ref-Range": "0.38",
      "High-Ref-Range": "0.50",
      "Unit-of-measurement": "",
      "Comment": ""
    },
    {
      "Date": "2024-03-14",
      "Biomarker-Name": "Basophils",
      "Result": "<0.1",
      "Low-Ref-Range": "",
      "High-Ref-Range": "<0.3",
      "Unit-of-measurement": "/nL",
      "Comment": ""
    }
  ]
}
```

### JSON field reference

| Field | Type | Description |
|  --- | --- | --- |
| `customerId` | integer | Your account identifier |
| `uploadId` | string | UUID of the upload |
| `fileName` | string | Original uploaded filename |
| `transactionId` | integer | Internal transaction identifier |
| `outputFormat` | string | Always `"JSON"` for this format |
| `totalTests` | integer | Total number of biomarkers in this result |
| `Results` | array | Array of extracted biomarker results. Empty (`[]`) only in error callbacks |
| `Results[].Date` | string | Test date (`YYYY-MM-DD`). Can be empty string |
| `Results[].Biomarker-Name` | string | Standardized biomarker name |
| `Results[].Result` | string | Test result value. May be numeric (`"17.00"`), qualitative (`"NEGATIVE"`), range (`"1-3"`), or flagged (`"0.52 H"`). Can be empty string |
| `Results[].Low-Ref-Range` | string | Lower reference range. Can be empty string |
| `Results[].High-Ref-Range` | string | Upper reference range. May include comparator prefix e.g. `"<0.3"`. Can be empty string |
| `Results[].Unit-of-measurement` | string | Measurement unit. Can be empty string |
| `Results[].Comment` | string | Additional notes. Can be empty string |


### With "Original results in output" enabled

When this toggle is on, each item in `Results[]` gains an `Original` field with the unprocessed source data:

```json
{
  "customerId": 11,
  "uploadId": "16227c8c-aa20-443d-ad50-528034f54d7a",
  "fileName": "E20UNMDMCB_96dpi_1.png",
  "transactionId": 484,
  "outputFormat": "JSON",
  "totalTests": 1,
  "Results": [
    {
      "Date": "2024-03-14",
      "Biomarker-Name": "Haemoglobin",
      "Result": "17.00",
      "Low-Ref-Range": "13.00",
      "High-Ref-Range": "17.50",
      "Unit-of-measurement": "g/dL",
      "Comment": "",
      "Original": {
        "Biomarker-Name": "HGB",
        "Result": "17.0",
        "Unit-of-measurement": "g/dL",
        "Low-Ref-Range": "13.0",
        "High-Ref-Range": "17.5"
      }
    }
  ]
}
```

## JSON — File Upload

**Content-Type:** `multipart/form-data`. Filename uses the pattern `report-{transactionId}-{timestamp}.json`.

The request has two parts: the result file and a `metadata` JSON field.

```http
POST /api/results HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data;
[api-header]: [api-key]

------------------------------
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{
  "customerId": 11,
  "uploadId": "16227c8c-aa20-443d-ad50-528034f54d7a",
  "fileName": "E20UNMDMCB_96dpi_1.png",
  "transactionId": 484,
  "outputFormat": "JSON",
  "totalTests": 10
}
------------------------------
Content-Disposition: form-data; name="file"; filename="report-491-1783326841635.json"
Content-Type: application/json

(JSON results body — same structure as inline format)
------------------------------
```

### Metadata field reference

| Field | Type | Description |
|  --- | --- | --- |
| `customerId` | integer | Your account identifier |
| `uploadId` | string | UUID of the upload |
| `fileName` | string | Result filename (pattern: `report-{transactionId}-{timestamp}.{ext}`) |
| `transactionId` | integer | Internal transaction identifier |
| `outputFormat` | string | Format used — `JSON`, `HL7`, `FHIR_JSON`, `FHIR_XML`, `CSV`, or `PARQUET` |
| `totalTests` | integer | Number of biomarkers in this result |


This `metadata` part is included on **all File-type** callbacks (HL7, FHIR JSON, FHIR XML, CSV, Parquet).

## HL7 — File Upload

**Content-Type:** `multipart/form-data`. File part content-type: `application/hl7-v2`. Filename uses the pattern `report-{transactionId}-{timestamp}.hl7`.

**HL7 version:** v2.3

### HL7 segments

| Segment | Name | Presence |
|  --- | --- | --- |
| MSH | Message Header | Always |
| PID | Patient Identification | Always |
| PV1 | Patient Visit | Always |
| ORC | Common Order | Always |
| OBR | Observation Request | Always |
| OBX | Observation Result | Always (one per biomarker) |
| NTE | Notes and Comments | Optional |


### OBX value types

Each `OBX` segment uses value type `NM` (numeric) when the result is a pure number, and `ST` (string) for qualitative results such as `"Positive"` or `"Negative"`.

OBX-3 (observation identifier) always uses the format `{transformedTestName}^{transformedTestName}` — the same name repeated on both sides of the `^` separator. LOINC codes are not included in the HL7 output.

Units containing `^` are escaped as `\S\` per HL7 encoding rules (e.g. `10^6/uL` → `10\S\6/uL`).

### Example

```http
POST /api/hl7/results HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data;
[api-header]: [api-key]

------------------------------
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{
  "customerId": 11,
  "uploadId": "16227c8c-aa20-443d-ad50-528034f54d7a",
  "fileName": "E20UNMDMCB_96dpi_1.png",
  "transactionId": 484,
  "outputFormat": "HL7",
  "totalTests": 10
}
------------------------------
Content-Disposition: form-data; name="file"; filename="report-488-1783326903921.hl7"
Content-Type: application/hl7-v2

MSH|^~\&|JONDAHEALTH|||||||||ORU^R01|||2.3
PID|||||
PV1||||||||||||||||||||
ORC|1||||||||||||||||||||||||||||LAB
OBR|||||||||||||||||20240129000000
OBX|1|NM|HGB^HGB||14.5|g/dL|12.00-15.50||||F|||20240129000000
OBX|2|NM|GLU^GLU||95|mg/dL|70.00-100.00||||F|||20240129000000
------------------------------
```

## FHIR JSON — File Upload

**Content-Type:** `multipart/form-data`. File part content-type: `application/json`. File part name: `file`. Filename uses the pattern `report-{transactionId}-{timestamp}.json`.

**FHIR version:** R4

The bundle is a `transaction` type. Resources in order: `Organization`, `Patient`, `Encounter`, `ServiceRequest`, one `Observation` per biomarker, `DiagnosticReport`.

Patient and encounter data are anonymized placeholders — no PII is included.

Numeric results use `valueQuantity`. Qualitative results use `valueString`. `Observation.code.coding` uses `{ "code": "TestName", "display": "TestName" }`.

```http
POST /api/fhir/json/results HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data;
[api-header]: [api-key]

------------------------------
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{
  "customerId": 11,
  "uploadId": "16227c8c-aa20-443d-ad50-528034f54d7a",
  "fileName": "E20UNMDMCB_96dpi_1.png",
  "transactionId": 484,
  "outputFormat": "FHIR_JSON",
  "totalTests": 17
}
------------------------------
Content-Disposition: form-data; name="file"; filename="report-479-1783330402859.json"
Content-Type: application/json

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [
    {
      "request": { "method": "POST", "url": "Organization" },
      "fullUrl": "urn:uuid:b9c05243-38ad-48e8-b17e-f8004fe29b77",
      "resource": {
        "resourceType": "Organization",
        "identifier": [{ "value": "JONDAHEALTH" }]
      }
    },
    {
      "request": { "method": "POST", "url": "Patient" },
      "fullUrl": "urn:uuid:be9c10c7-8aa9-44c3-99bc-e4d0dd9221c5",
      "resource": {
        "resourceType": "Patient",
        "managingOrganization": { "reference": "urn:uuid:b9c05243-38ad-48e8-b17e-f8004fe29b77" }
      }
    },
    {
      "request": { "method": "POST", "url": "Encounter" },
      "fullUrl": "urn:uuid:8678f7f1-157f-43bf-82e9-d5cd3a3682f1",
      "resource": {
        "resourceType": "Encounter",
        "status": "unknown",
        "class": { "code": "AMB" },
        "subject": { "reference": "urn:uuid:be9c10c7-8aa9-44c3-99bc-e4d0dd9221c5" },
        "identifier": [{ "type": { "text": "EncounterNumber" }, "use": "official", "value": "ENC-479-1783330402859" }]
      }
    },
    {
      "request": { "method": "POST", "url": "ServiceRequest" },
      "fullUrl": "urn:uuid:da4280de-9fcd-4916-9faa-69436250fb1a",
      "resource": {
        "resourceType": "ServiceRequest",
        "status": "active",
        "intent": "order",
        "subject": { "reference": "urn:uuid:be9c10c7-8aa9-44c3-99bc-e4d0dd9221c5" },
        "encounter": { "reference": "urn:uuid:8678f7f1-157f-43bf-82e9-d5cd3a3682f1" },
        "category": [{ "coding": [{ "system": "http://snomed.info/sct", "code": "103693007", "display": "Diagnostic procedure" }], "text": "Diagnostic procedure" }],
        "code": { "coding": [{ "code": "LAB-ORDER" }] },
        "identifier": [
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "FILL", "display": "Filler Identifier" }], "text": "FillerId" } },
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "PLAC", "display": "Placer Identifier" }], "text": "PlacerId" } }
        ]
      }
    },
    {
      "request": { "method": "POST", "url": "Observation" },
      "fullUrl": "urn:uuid:65e3a996-e388-4e3f-9760-6edf28739fb4",
      "resource": {
        "resourceType": "Observation",
        "status": "final",
        "subject": { "reference": "urn:uuid:be9c10c7-8aa9-44c3-99bc-e4d0dd9221c5" },
        "encounter": { "reference": "urn:uuid:8678f7f1-157f-43bf-82e9-d5cd3a3682f1" },
        "effectiveDateTime": "2022-03-02T00:00:00.000Z",
        "category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "laboratory" }] }],
        "code": { "coding": [{ "code": "Color", "display": "Color" }] },
        "valueString": "YELLOW"
      }
    },
    {
      "request": { "method": "POST", "url": "Observation" },
      "fullUrl": "urn:uuid:98deab5e-cedc-4c93-bbb9-98288dc374a1",
      "resource": {
        "resourceType": "Observation",
        "status": "final",
        "subject": { "reference": "urn:uuid:be9c10c7-8aa9-44c3-99bc-e4d0dd9221c5" },
        "encounter": { "reference": "urn:uuid:8678f7f1-157f-43bf-82e9-d5cd3a3682f1" },
        "effectiveDateTime": "2022-03-02T00:00:00.000Z",
        "category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "laboratory" }] }],
        "code": { "coding": [{ "code": "pH", "display": "pH" }] },
        "valueQuantity": { "value": 5, "unit": "", "system": "http://unitsofmeasure.org", "code": "" },
        "referenceRange": [{ "low": { "value": 5, "system": "http://unitsofmeasure.org" }, "high": { "value": 6, "system": "http://unitsofmeasure.org" }, "text": "5.00-6.00" }]
      }
    },
    {
      "request": { "method": "POST", "url": "DiagnosticReport" },
      "fullUrl": "urn:uuid:4506d4e6-9228-4a7e-9497-5f6fade90b8e",
      "resource": {
        "resourceType": "DiagnosticReport",
        "status": "unknown",
        "subject": { "reference": "urn:uuid:be9c10c7-8aa9-44c3-99bc-e4d0dd9221c5" },
        "encounter": { "reference": "urn:uuid:8678f7f1-157f-43bf-82e9-d5cd3a3682f1" },
        "basedOn": [{ "reference": "urn:uuid:da4280de-9fcd-4916-9faa-69436250fb1a" }],
        "category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0074", "code": "LAB", "display": "Laboratory" }], "text": "Laboratory" }],
        "code": { "coding": [{ "code": "LAB-REPORT" }] },
        "result": [
          { "reference": "urn:uuid:65e3a996-e388-4e3f-9760-6edf28739fb4" },
          { "reference": "urn:uuid:98deab5e-cedc-4c93-bbb9-98288dc374a1" }
        ],
        "identifier": [
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "FILL", "display": "Filler Identifier" }], "text": "FillerId" } },
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "PLAC", "display": "Placer Identifier" }], "text": "PlacerId" } }
        ]
      }
    }
  ]
}
------------------------------
```

## FHIR JSON — Inline

**Content-Type:** `application/fhir+json`

The raw FHIR R4 Bundle is POSTed directly as the request body — no multipart wrapper, no `metadata` field. The bundle structure is identical to the File format.

> Because the FHIR Bundle body must remain R4-compliant, envelope fields (`customerId`, `uploadId`, etc.) cannot be added inside the body without breaking the standard. Instead, JondaX delivers this metadata as custom `X-JondaX-*` HTTP request headers on every inline FHIR JSON callback.


```http
POST /api/results HTTP/1.1
Host: api.example.com
Content-Type: application/fhir+json
[api-header]: [api-key]
X-JondaX-Customer-Id: 11
X-JondaX-Upload-Id: 16227c8c-aa20-443d-ad50-528034f54d7a
X-JondaX-File-Name: E20UNMDMCB_96dpi_1.png
X-JondaX-Transaction-Id: 484
X-JondaX-Output-Format: FHIR_JSON
X-JondaX-Total-Tests: 3

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [
    {
      "request": { "method": "POST", "url": "Organization" },
      "fullUrl": "urn:uuid:5ab2cbc4-08ea-43a8-8f3e-4a0a0c7cc77f",
      "resource": {
        "resourceType": "Organization",
        "identifier": [{ "value": "JONDAHEALTH" }]
      }
    },
    {
      "request": { "method": "POST", "url": "Patient" },
      "fullUrl": "urn:uuid:373bda8e-ab23-4ce6-9243-62290243d271",
      "resource": {
        "resourceType": "Patient",
        "managingOrganization": { "reference": "urn:uuid:5ab2cbc4-08ea-43a8-8f3e-4a0a0c7cc77f" }
      }
    },
    {
      "request": { "method": "POST", "url": "Encounter" },
      "fullUrl": "urn:uuid:941400a0-9573-4383-8fbf-8a3cb87051b4",
      "resource": {
        "resourceType": "Encounter",
        "status": "unknown",
        "class": { "code": "AMB" },
        "subject": { "reference": "urn:uuid:373bda8e-ab23-4ce6-9243-62290243d271" },
        "identifier": [{ "type": { "text": "EncounterNumber" }, "use": "official", "value": "ENC-475-1783389025762" }]
      }
    },
    {
      "request": { "method": "POST", "url": "ServiceRequest" },
      "fullUrl": "urn:uuid:1e605c7d-a0db-4039-b692-49344d016156",
      "resource": {
        "resourceType": "ServiceRequest",
        "status": "active",
        "intent": "order",
        "subject": { "reference": "urn:uuid:373bda8e-ab23-4ce6-9243-62290243d271" },
        "encounter": { "reference": "urn:uuid:941400a0-9573-4383-8fbf-8a3cb87051b4" },
        "category": [{ "coding": [{ "system": "http://snomed.info/sct", "code": "103693007", "display": "Diagnostic procedure" }], "text": "Diagnostic procedure" }],
        "code": { "coding": [{ "code": "LAB-ORDER" }] },
        "identifier": [
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "FILL", "display": "Filler Identifier" }], "text": "FillerId" } },
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "PLAC", "display": "Placer Identifier" }], "text": "PlacerId" } }
        ]
      }
    },
    {
      "request": { "method": "POST", "url": "Observation" },
      "fullUrl": "urn:uuid:f5864374-eeb9-4c01-935b-5028b7d7fdd7",
      "resource": {
        "resourceType": "Observation",
        "status": "final",
        "subject": { "reference": "urn:uuid:373bda8e-ab23-4ce6-9243-62290243d271" },
        "encounter": { "reference": "urn:uuid:941400a0-9573-4383-8fbf-8a3cb87051b4" },
        "effectiveDateTime": "2026-04-23T00:00:00.000Z",
        "category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "laboratory" }] }],
        "code": { "coding": [{ "code": "Glucose Tolerance Test (OGTT)", "display": "Glucose Tolerance Test (OGTT)" }] },
        "valueQuantity": {
          "value": 5,
          "unit": "mmol/l",
          "system": "http://unitsofmeasure.org",
          "code": "mmol/l"
        },
        "referenceRange": [{ "low": { "value": 4.11, "unit": "mmol/l", "system": "http://unitsofmeasure.org", "code": "mmol/l" }, "high": { "value": 6.05, "unit": "mmol/l", "system": "http://unitsofmeasure.org", "code": "mmol/l" }, "text": "4.11-6.05" }]
      }
    },
    {
      "request": { "method": "POST", "url": "DiagnosticReport" },
      "fullUrl": "urn:uuid:135b802d-2562-48b2-b1e3-3affb9a34616",
      "resource": {
        "resourceType": "DiagnosticReport",
        "status": "unknown",
        "subject": { "reference": "urn:uuid:373bda8e-ab23-4ce6-9243-62290243d271" },
        "encounter": { "reference": "urn:uuid:941400a0-9573-4383-8fbf-8a3cb87051b4" },
        "basedOn": [{ "reference": "urn:uuid:1e605c7d-a0db-4039-b692-49344d016156" }],
        "category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0074", "code": "LAB", "display": "Laboratory" }], "text": "Laboratory" }],
        "code": { "coding": [{ "code": "LAB-REPORT" }] },
        "result": [{ "reference": "urn:uuid:f5864374-eeb9-4c01-935b-5028b7d7fdd7" }],
        "identifier": [
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "FILL", "display": "Filler Identifier" }], "text": "FillerId" } },
          { "use": "official", "type": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "PLAC", "display": "Placer Identifier" }], "text": "PlacerId" } }
        ]
      }
    }
  ]
}
```

### Metadata headers reference

| Header | Type | Description |
|  --- | --- | --- |
| `X-JondaX-Customer-Id` | integer | Your account identifier |
| `X-JondaX-Upload-Id` | string | UUID of the upload |
| `X-JondaX-File-Name` | string | Original uploaded filename |
| `X-JondaX-Transaction-Id` | integer | Internal transaction identifier |
| `X-JondaX-Output-Format` | string | Always `FHIR_JSON` for this format |
| `X-JondaX-Total-Tests` | integer | Total number of biomarkers in this result |


## FHIR XML — File Upload

**Content-Type:** `multipart/form-data`. File part content-type: `application/fhir+xml`. File part name: `file`. Filename uses the pattern `report-{transactionId}-{timestamp}.xml`.

**FHIR version:** R4

Structure mirrors the FHIR JSON bundle exactly — same resources in the same order, serialized as XML. Each `<entry>` contains `<fullUrl>`, `<resource>`, and `<request>`.

```http
POST /api/fhir/xml/results HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data;
[api-header]: [api-key]

------------------------------
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{
  "customerId": 11,
  "uploadId": "adbd198e-75c5-4a4b-9285-b3debb538091",
  "fileName": "report-478-1783389535381.xml",
  "transactionId": 478,
  "outputFormat": "FHIR_XML",
  "totalTests": 26
}
------------------------------
Content-Disposition: form-data; name="file"; filename="report-478-1783389535381.xml"
Content-Type: application/fhir+xml

<?xml version="1.0" encoding="UTF-8"?>
<Bundle xmlns="http://hl7.org/fhir">
  <type value="transaction"/>
  <entry>
    <fullUrl value="urn:uuid:6b5c1f31-2188-4d36-bece-fb46d31e94d7"/>
    <resource>
      <Organization>
        <identifier>
          <value value="JONDAHEALTH"/>
        </identifier>
      </Organization>
    </resource>
    <request>
      <method value="POST"/>
      <url value="Organization"/>
    </request>
  </entry>
  <entry>
    <fullUrl value="urn:uuid:75ec5b50-f3f9-42b7-8861-7709f02a969d"/>
    <resource>
      <Patient>
        <managingOrganization>
          <reference value="urn:uuid:6b5c1f31-2188-4d36-bece-fb46d31e94d7"/>
        </managingOrganization>
      </Patient>
    </resource>
    <request>
      <method value="POST"/>
      <url value="Patient"/>
    </request>
  </entry>
  <entry>
    <fullUrl value="urn:uuid:454e63bb-8164-4566-b916-fd01493cee24"/>
    <resource>
      <Encounter>
        <status value="unknown"/>
        <class>
          <code value="AMB"/>
        </class>
        <subject>
          <reference value="urn:uuid:75ec5b50-f3f9-42b7-8861-7709f02a969d"/>
        </subject>
        <identifier>
          <use value="official"/>
          <type>
            <text value="EncounterNumber"/>
          </type>
          <value value="ENC-478-1783389535380"/>
        </identifier>
      </Encounter>
    </resource>
    <request>
      <method value="POST"/>
      <url value="Encounter"/>
    </request>
  </entry>
  <entry>
    <fullUrl value="urn:uuid:a570c0ff-85fa-41b1-9e11-7ef346c9d04e"/>
    <resource>
      <ServiceRequest>
        <status value="active"/>
        <intent value="order"/>
        <subject>
          <reference value="urn:uuid:75ec5b50-f3f9-42b7-8861-7709f02a969d"/>
        </subject>
        <encounter>
          <reference value="urn:uuid:454e63bb-8164-4566-b916-fd01493cee24"/>
        </encounter>
        <category>
          <coding>
            <system value="http://snomed.info/sct"/>
            <code value="103693007"/>
            <display value="Diagnostic procedure"/>
          </coding>
          <text value="Diagnostic procedure"/>
        </category>
        <code>
          <coding>
            <code value="LAB-ORDER"/>
          </coding>
        </code>
        <identifier>
          <use value="official"/>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
              <code value="FILL"/>
              <display value="Filler Identifier"/>
            </coding>
            <text value="FillerId"/>
          </type>
        </identifier>
        <identifier>
          <use value="official"/>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
              <code value="PLAC"/>
              <display value="Placer Identifier"/>
            </coding>
            <text value="PlacerId"/>
          </type>
        </identifier>
      </ServiceRequest>
    </resource>
    <request>
      <method value="POST"/>
      <url value="ServiceRequest"/>
    </request>
  </entry>
  <entry>
    <fullUrl value="urn:uuid:0bc2f8c0-ae01-4a33-8bc7-c0fe6e3f7fa2"/>
    <resource>
      <Observation>
        <status value="final"/>
        <category>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/observation-category"/>
            <code value="laboratory"/>
          </coding>
        </category>
        <code>
          <coding>
            <code value="L443 Color"/>
            <display value="L443 Color"/>
          </coding>
        </code>
        <subject>
          <reference value="urn:uuid:75ec5b50-f3f9-42b7-8861-7709f02a969d"/>
        </subject>
        <encounter>
          <reference value="urn:uuid:454e63bb-8164-4566-b916-fd01493cee24"/>
        </encounter>
        <effectiveDateTime value="2024-03-27T00:00:00.000Z"/>
        <valueString value="YELLOW"/>
      </Observation>
    </resource>
    <request>
      <method value="POST"/>
      <url value="Observation"/>
    </request>
  </entry>
  <entry>
    <fullUrl value="urn:uuid:e50cfe02-cec9-4017-bcab-56793b90845f"/>
    <resource>
      <Observation>
        <status value="final"/>
        <category>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/observation-category"/>
            <code value="laboratory"/>
          </coding>
        </category>
        <code>
          <coding>
            <code value="L446 pH"/>
            <display value="L446 pH"/>
          </coding>
        </code>
        <subject>
          <reference value="urn:uuid:75ec5b50-f3f9-42b7-8861-7709f02a969d"/>
        </subject>
        <encounter>
          <reference value="urn:uuid:454e63bb-8164-4566-b916-fd01493cee24"/>
        </encounter>
        <effectiveDateTime value="2024-03-27T00:00:00.000Z"/>
        <valueQuantity>
          <value value="6"/>
          <unit value=""/>
          <system value="http://unitsofmeasure.org"/>
          <code value=""/>
        </valueQuantity>
      </Observation>
    </resource>
    <request>
      <method value="POST"/>
      <url value="Observation"/>
    </request>
  </entry>
</Bundle>
------------------------------
```

## CSV — File Upload

**Content-Type:** `multipart/form-data`. File part content-type: `text/csv`. Filename uses the pattern `report-{transactionId}-{timestamp}.csv`.

The file is UTF-8 encoded with a BOM (`\uFEFF`) prepended so Excel renders special characters correctly. Line endings are CRLF (`\r\n`) per RFC 4180.

### Column order

`Date`, `Biomarker-Name`, `Result`, `Low-Ref-Range`, `High-Ref-Range`, `Unit-of-measurement`, `Comment`

Columns are identical to the JSON format fields — one biomarker per row, with a header row as the first line.

### CSV field reference

| Column | Description |
|  --- | --- |
| `Date` | Test date (`YYYY-MM-DD`). Can be empty |
| `Biomarker-Name` | Standardized (transformed) biomarker name |
| `Result` | Test result value — translated/converted value when available, otherwise original |
| `Low-Ref-Range` | Lower reference range — translated value when available, otherwise original. Can be empty |
| `High-Ref-Range` | Upper reference range — translated value when available, otherwise original. Can be empty |
| `Unit-of-measurement` | Measurement unit — transformed unit when available, otherwise original. Can be empty |
| `Comment` | Additional notes. Can be empty |


Values containing commas, quotes, or newlines are wrapped in double quotes per RFC 4180. Embedded double quotes are doubled (`""`).

### Example

```http
POST /api/results HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data;
[api-header]: [api-key]

------------------------------
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{
  "customerId": 11,
  "uploadId": "16227c8c-aa20-443d-ad50-528034f54d7a",
  "fileName": "E20UNMDMCB_96dpi_1.png",
  "transactionId": 484,
  "outputFormat": "CSV",
  "totalTests": 10
}
------------------------------
Content-Disposition: form-data; name="file"; filename="report-487-1783327368748.csv"
Content-Type: text/csv

Date,Biomarker-Name,Result,Low-Ref-Range,High-Ref-Range,Unit-of-measurement,Comment
2022-03-16,WBC,6.30,4.00,10.00,10^3/uL,
2022-03-16,HGB,14.5,12.00,15.50,g/dL,
2022-03-16,PLT,250,150.00,400.00,10^3/uL,
------------------------------
```

> The CSV file always includes the header row as the first line. Empty values appear as empty fields between delimiters (e.g. `,,`).


## Parquet — File Upload

**Content-Type:** `multipart/form-data`. File part content-type: `application/octet-stream`. Filename uses the pattern `report-{transactionId}-{timestamp}.parquet`.

The Parquet file contains the same columns as the CSV format in the same order. All columns are typed as `UTF8` (string) in the Parquet schema.

### Schema

| Column | Parquet type | Description |
|  --- | --- | --- |
| `Date` | `UTF8` | Test date (`YYYY-MM-DD`). Can be empty string |
| `Biomarker-Name` | `UTF8` | Standardized (transformed) biomarker name |
| `Result` | `UTF8` | Test result value |
| `Low-Ref-Range` | `UTF8` | Lower reference range. Can be empty string |
| `High-Ref-Range` | `UTF8` | Upper reference range. Can be empty string |
| `Unit-of-measurement` | `UTF8` | Measurement unit. Can be empty string |
| `Comment` | `UTF8` | Additional notes. Can be empty string |


### Example request

```http
POST /api/results HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data;
[api-header]: [api-key]

------------------------------
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{
  "customerId": 11,
  "uploadId": "16227c8c-aa20-443d-ad50-528034f54d7a",
  "fileName": "E20UNMDMCB_96dpi_1.png",
  "transactionId": 484,
  "outputFormat": "PARQUET",
  "totalTests": 100
}
------------------------------
Content-Disposition: form-data; name="file"; filename="report-708-1783326991576.parquet"
Content-Type: application/octet-stream

(binary Parquet data)
------------------------------
```

### Reading Parquet in common languages

```python
# Python — pandas
import pandas as pd
df = pd.read_parquet("report-231-1777433560479.parquet")
print(df)
```

```js
// Node.js — @dsnp/parquetjs
const { ParquetReader } = require('@dsnp/parquetjs');
const reader = await ParquetReader.openBuffer(buffer);
const cursor = reader.getCursor();
let record;
while ((record = await cursor.next()) !== null) {
  console.log(record);
}
await reader.close();
```

> Parquet is recommended for large result sets or data pipeline integrations. For simpler integrations, CSV carries the same data with no binary parsing required.