# records.json holds one patient's FHIR medication records.
curl -X POST "https://api.haau3.com/v1/fhir/r4/\$reconcile-medications" \
-H "Authorization: Bearer $HAAU3_API_KEY" \
-H "Content-Type: application/fhir+json" \
-d @records.jsonimport { readFile } from "node:fs/promises";
import { Haau3, type fhir4 } from "@haau3/sdk";
const haau3 = new Haau3(); // reads HAAU3_API_KEY
// request.json holds one patient's medication records, as a Bundle.
const body: fhir4.Bundle = JSON.parse(await readFile("request.json", "utf8"));
const bundle = await haau3.reconcileMedications(body);
console.log(bundle.entry?.length ?? 0);
import json
from haau3 import Haau3, fhir
client = Haau3() # reads HAAU3_API_KEY
# request.json holds one patient's medication records, as a Bundle.
with open("request.json") as file:
body: fhir.Bundle = json.load(file)
bundle = client.reconcile_medications(body)
print(len(bundle.get("entry", [])))
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/haau3/haau3-go"
"github.com/haau3/haau3-go/fhir"
)
func main() {
ctx := context.Background()
client, err := haau3.NewClient() // reads HAAU3_API_KEY
if err != nil {
log.Fatal(err)
}
data, err := os.ReadFile("request.json") // one patient's medication records
if err != nil {
log.Fatal(err)
}
body, err := fhir.DecodeResource(data)
if err != nil {
log.Fatal(err)
}
bundle, err := client.ReconcileMedications(ctx, body)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(bundle.Entry))
}
{
"resourceType": "Bundle",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-bundle"
]
},
"type": "collection",
"timestamp": "2026-09-25T12:00:00Z",
"entry": [
{
"fullUrl": "urn:uuid:cca79014-be8b-4a29-b062-d4df7bd4ea4c",
"resource": {
"resourceType": "MedicationRequest",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-request"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-evidence",
"valueCoding": {
"code": "patient-reported",
"system": "https://haau3.com/fhir/CodeSystem/medlist-evidence",
"display": "Patient-reported use"
}
}
],
"medicationCodeableConcept": {
"coding": [
{
"code": "861821",
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"display": "metformin hydrochloride 500 MG / sitagliptin phosphate 50 MG Oral Tablet [Janumet]"
},
{
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-added-coding",
"valueCode": "rxnorm-clinical-drug"
}
],
"code": "2709491",
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"display": "metformin hydrochloride 500 MG / sitagliptin phosphate 50 MG Oral Tablet",
"id": "haau3-added-coding"
}
],
"text": "Janumet 50 mg-500 mg tablet"
},
"subject": {
"reference": "http://example.org/fhir/Patient/example"
},
"requester": {
"display": "Example Prescriber, MD"
},
"dosageInstruction": [
{
"text": "1 tablet twice a day"
}
],
"status": "active",
"intent": "order",
"reportedBoolean": false,
"authoredOn": "2026-08-30"
}
},
{
"fullUrl": "urn:uuid:e9f58b63-dfcf-427b-a99a-5bd212786511",
"resource": {
"resourceType": "Provenance",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-provenance"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-ruleset-version",
"valueString": "2026-09-27.v3"
},
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-rxnorm-release",
"valueString": "09082026"
}
],
"contained": [
{
"resourceType": "Organization",
"id": "haau3",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization|6.1.0"
]
},
"telecom": [
{
"system": "url",
"value": "https://haau3.com"
}
],
"active": true,
"name": "haau3"
}
],
"target": [
{
"reference": "urn:uuid:cca79014-be8b-4a29-b062-d4df7bd4ea4c"
}
],
"agent": [
{
"who": {
"reference": "#haau3"
},
"type": {
"coding": [
{
"code": "assembler",
"system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
"display": "Assembler"
}
]
}
}
],
"entity": [
{
"what": {
"reference": "http://example.org/fhir/MedicationRequest/janumet-order"
},
"role": "source"
},
{
"what": {
"reference": "http://example.org/fhir/MedicationStatement/janumet-statement"
},
"role": "source"
}
],
"recorded": "2026-09-25T12:00:00Z",
"occurredDateTime": "2026-09-25T12:00:00Z"
}
},
{
"fullUrl": "urn:uuid:f7203088-a8ca-494f-9df4-d4d5795d69b9",
"resource": {
"resourceType": "Provenance",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-additions-provenance"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-ruleset-version",
"valueString": "2026-09-27.v3"
},
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-rxnorm-release",
"valueString": "09082026"
}
],
"contained": [
{
"resourceType": "Organization",
"id": "haau3",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization|6.1.0"
]
},
"telecom": [
{
"system": "url",
"value": "https://haau3.com"
}
],
"active": true,
"name": "haau3"
}
],
"target": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/targetElement",
"valueUri": "haau3-added-coding"
}
],
"reference": "urn:uuid:cca79014-be8b-4a29-b062-d4df7bd4ea4c"
}
],
"agent": [
{
"who": {
"reference": "#haau3"
},
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
"code": "author",
"display": "Author"
}
]
}
}
],
"activity": {
"coding": [
{
"code": "APPEND",
"system": "http://terminology.hl7.org/CodeSystem/v3-DataOperation",
"display": "append"
}
]
},
"recorded": "2026-09-25T12:00:00Z",
"occurredDateTime": "2026-09-25T12:00:00Z"
}
},
{
"fullUrl": "urn:uuid:6ed091b4-5154-4341-a5a0-db38571c584b",
"resource": {
"resourceType": "MedicationRequest",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-request"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-evidence",
"valueCoding": {
"code": "patient-reported",
"system": "https://haau3.com/fhir/CodeSystem/medlist-evidence",
"display": "Patient-reported use"
}
}
],
"reportedReference": {
"reference": "http://example.org/fhir/Patient/example"
},
"medicationCodeableConcept": {
"coding": [
{
"code": "311354",
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"display": "lisinopril 5 MG Oral Tablet"
}
],
"text": "lisinopril 5 mg tablet"
},
"subject": {
"reference": "http://example.org/fhir/Patient/example"
},
"requester": {
"reference": "http://example.org/fhir/Patient/example"
},
"dosageInstruction": [
{
"text": "5 mg once daily"
}
],
"status": "active",
"intent": "plan"
}
},
{
"fullUrl": "urn:uuid:37832b15-3a07-4084-b779-6bb3078cab3b",
"resource": {
"resourceType": "Provenance",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-provenance"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-ruleset-version",
"valueString": "2026-09-27.v3"
},
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-rxnorm-release",
"valueString": "09082026"
}
],
"contained": [
{
"resourceType": "Organization",
"id": "haau3",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization|6.1.0"
]
},
"telecom": [
{
"system": "url",
"value": "https://haau3.com"
}
],
"active": true,
"name": "haau3"
}
],
"target": [
{
"reference": "urn:uuid:6ed091b4-5154-4341-a5a0-db38571c584b"
}
],
"agent": [
{
"who": {
"reference": "#haau3"
},
"type": {
"coding": [
{
"code": "assembler",
"system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
"display": "Assembler"
}
]
}
}
],
"entity": [
{
"what": {
"reference": "http://example.org/fhir/MedicationStatement/lisinopril-statement"
},
"role": "source"
}
],
"recorded": "2026-09-25T12:00:00Z",
"occurredDateTime": "2026-09-25T12:00:00Z"
}
},
{
"fullUrl": "urn:uuid:8f0d3f75-6138-4cb4-bea4-6b539e3c2894",
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"details": {
"text": "This record names no medication and was not reconciled."
},
"severity": "warning",
"code": "required",
"diagnostics": "http://example.org/fhir/MedicationRequest/unnamed-order"
}
]
}
}
]
}Reconcile one patient's medication records
FHIR system-level operation $reconcile-medications. POST one patient’s MedicationRequest, MedicationStatement, MedicationDispense and MedicationAdministration records, with the Medications they reference, as a collection or searchset Bundle; every entry needs a fullUrl. The response is one reconciled medication list: a collection Bundle holding one reconciled MedicationRequest per clinical drug, a Provenance for each naming the records behind it, and an OperationOutcome when a record was skipped. To evaluate the list as of another date, POST a Parameters resource with resource parts, or one bundle part, and an asOf part. This operation receives patient data, so send real patient data only under an executed business associate agreement (BAA) on the Team or Scale plan. Without both, send only test data marked as such, the request and every resource in it labelled with the meta.security coding HTEST from http://terminology.hl7.org/CodeSystem/v3-ActReason; anything else is refused with 403 phi-agreement-required. Nothing a request carries is stored or logged, apart from the request’s ids, and the operation is not offered inside a batch. The contract is published at https://fhir.haau3.com/OperationDefinition-reconcile-medications.html.
# records.json holds one patient's FHIR medication records.
curl -X POST "https://api.haau3.com/v1/fhir/r4/\$reconcile-medications" \
-H "Authorization: Bearer $HAAU3_API_KEY" \
-H "Content-Type: application/fhir+json" \
-d @records.jsonimport { readFile } from "node:fs/promises";
import { Haau3, type fhir4 } from "@haau3/sdk";
const haau3 = new Haau3(); // reads HAAU3_API_KEY
// request.json holds one patient's medication records, as a Bundle.
const body: fhir4.Bundle = JSON.parse(await readFile("request.json", "utf8"));
const bundle = await haau3.reconcileMedications(body);
console.log(bundle.entry?.length ?? 0);
import json
from haau3 import Haau3, fhir
client = Haau3() # reads HAAU3_API_KEY
# request.json holds one patient's medication records, as a Bundle.
with open("request.json") as file:
body: fhir.Bundle = json.load(file)
bundle = client.reconcile_medications(body)
print(len(bundle.get("entry", [])))
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/haau3/haau3-go"
"github.com/haau3/haau3-go/fhir"
)
func main() {
ctx := context.Background()
client, err := haau3.NewClient() // reads HAAU3_API_KEY
if err != nil {
log.Fatal(err)
}
data, err := os.ReadFile("request.json") // one patient's medication records
if err != nil {
log.Fatal(err)
}
body, err := fhir.DecodeResource(data)
if err != nil {
log.Fatal(err)
}
bundle, err := client.ReconcileMedications(ctx, body)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(bundle.Entry))
}
{
"resourceType": "Bundle",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-bundle"
]
},
"type": "collection",
"timestamp": "2026-09-25T12:00:00Z",
"entry": [
{
"fullUrl": "urn:uuid:cca79014-be8b-4a29-b062-d4df7bd4ea4c",
"resource": {
"resourceType": "MedicationRequest",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-request"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-evidence",
"valueCoding": {
"code": "patient-reported",
"system": "https://haau3.com/fhir/CodeSystem/medlist-evidence",
"display": "Patient-reported use"
}
}
],
"medicationCodeableConcept": {
"coding": [
{
"code": "861821",
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"display": "metformin hydrochloride 500 MG / sitagliptin phosphate 50 MG Oral Tablet [Janumet]"
},
{
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-added-coding",
"valueCode": "rxnorm-clinical-drug"
}
],
"code": "2709491",
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"display": "metformin hydrochloride 500 MG / sitagliptin phosphate 50 MG Oral Tablet",
"id": "haau3-added-coding"
}
],
"text": "Janumet 50 mg-500 mg tablet"
},
"subject": {
"reference": "http://example.org/fhir/Patient/example"
},
"requester": {
"display": "Example Prescriber, MD"
},
"dosageInstruction": [
{
"text": "1 tablet twice a day"
}
],
"status": "active",
"intent": "order",
"reportedBoolean": false,
"authoredOn": "2026-08-30"
}
},
{
"fullUrl": "urn:uuid:e9f58b63-dfcf-427b-a99a-5bd212786511",
"resource": {
"resourceType": "Provenance",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-provenance"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-ruleset-version",
"valueString": "2026-09-27.v3"
},
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-rxnorm-release",
"valueString": "09082026"
}
],
"contained": [
{
"resourceType": "Organization",
"id": "haau3",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization|6.1.0"
]
},
"telecom": [
{
"system": "url",
"value": "https://haau3.com"
}
],
"active": true,
"name": "haau3"
}
],
"target": [
{
"reference": "urn:uuid:cca79014-be8b-4a29-b062-d4df7bd4ea4c"
}
],
"agent": [
{
"who": {
"reference": "#haau3"
},
"type": {
"coding": [
{
"code": "assembler",
"system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
"display": "Assembler"
}
]
}
}
],
"entity": [
{
"what": {
"reference": "http://example.org/fhir/MedicationRequest/janumet-order"
},
"role": "source"
},
{
"what": {
"reference": "http://example.org/fhir/MedicationStatement/janumet-statement"
},
"role": "source"
}
],
"recorded": "2026-09-25T12:00:00Z",
"occurredDateTime": "2026-09-25T12:00:00Z"
}
},
{
"fullUrl": "urn:uuid:f7203088-a8ca-494f-9df4-d4d5795d69b9",
"resource": {
"resourceType": "Provenance",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-additions-provenance"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-ruleset-version",
"valueString": "2026-09-27.v3"
},
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-rxnorm-release",
"valueString": "09082026"
}
],
"contained": [
{
"resourceType": "Organization",
"id": "haau3",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization|6.1.0"
]
},
"telecom": [
{
"system": "url",
"value": "https://haau3.com"
}
],
"active": true,
"name": "haau3"
}
],
"target": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/targetElement",
"valueUri": "haau3-added-coding"
}
],
"reference": "urn:uuid:cca79014-be8b-4a29-b062-d4df7bd4ea4c"
}
],
"agent": [
{
"who": {
"reference": "#haau3"
},
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
"code": "author",
"display": "Author"
}
]
}
}
],
"activity": {
"coding": [
{
"code": "APPEND",
"system": "http://terminology.hl7.org/CodeSystem/v3-DataOperation",
"display": "append"
}
]
},
"recorded": "2026-09-25T12:00:00Z",
"occurredDateTime": "2026-09-25T12:00:00Z"
}
},
{
"fullUrl": "urn:uuid:6ed091b4-5154-4341-a5a0-db38571c584b",
"resource": {
"resourceType": "MedicationRequest",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-request"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-evidence",
"valueCoding": {
"code": "patient-reported",
"system": "https://haau3.com/fhir/CodeSystem/medlist-evidence",
"display": "Patient-reported use"
}
}
],
"reportedReference": {
"reference": "http://example.org/fhir/Patient/example"
},
"medicationCodeableConcept": {
"coding": [
{
"code": "311354",
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"display": "lisinopril 5 MG Oral Tablet"
}
],
"text": "lisinopril 5 mg tablet"
},
"subject": {
"reference": "http://example.org/fhir/Patient/example"
},
"requester": {
"reference": "http://example.org/fhir/Patient/example"
},
"dosageInstruction": [
{
"text": "5 mg once daily"
}
],
"status": "active",
"intent": "plan"
}
},
{
"fullUrl": "urn:uuid:37832b15-3a07-4084-b779-6bb3078cab3b",
"resource": {
"resourceType": "Provenance",
"meta": {
"profile": [
"https://haau3.com/fhir/StructureDefinition/haau3-reconciled-medication-provenance"
]
},
"extension": [
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-ruleset-version",
"valueString": "2026-09-27.v3"
},
{
"url": "https://haau3.com/fhir/StructureDefinition/medlist-rxnorm-release",
"valueString": "09082026"
}
],
"contained": [
{
"resourceType": "Organization",
"id": "haau3",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization|6.1.0"
]
},
"telecom": [
{
"system": "url",
"value": "https://haau3.com"
}
],
"active": true,
"name": "haau3"
}
],
"target": [
{
"reference": "urn:uuid:6ed091b4-5154-4341-a5a0-db38571c584b"
}
],
"agent": [
{
"who": {
"reference": "#haau3"
},
"type": {
"coding": [
{
"code": "assembler",
"system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
"display": "Assembler"
}
]
}
}
],
"entity": [
{
"what": {
"reference": "http://example.org/fhir/MedicationStatement/lisinopril-statement"
},
"role": "source"
}
],
"recorded": "2026-09-25T12:00:00Z",
"occurredDateTime": "2026-09-25T12:00:00Z"
}
},
{
"fullUrl": "urn:uuid:8f0d3f75-6138-4cb4-bea4-6b539e3c2894",
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"details": {
"text": "This record names no medication and was not reconciled."
},
"severity": "warning",
"code": "required",
"diagnostics": "http://example.org/fhir/MedicationRequest/unnamed-order"
}
]
}
}
]
}Authorizations
A live platform API key (haau3_sk_live_…), sent as Authorization: Bearer <key>. It works for every service outside the Sandbox. Create one on the API keys page at https://platform.haau3.com.
Headers
An id of your own for this request, as a UUID. It comes back in the X-Correlation-Id header and is kept with haau3's record of the request. Any value that is not a UUID is ignored. See https://docs.haau3.com/errors#request-ids.