curl -X POST "https://api.haau3.com/v1/fhir/r4" \
-H "Authorization: Bearer $HAAU3_API_KEY" \
-H "Content-Type: application/fhir+json" \
-d '{
"resourceType": "Bundle",
"type": "batch",
"entry": [
{
"request": {
"method": "GET",
"url": "CodeSystem/$lookup?system=http://loinc.org&code=2345-7&property=SHORTNAME"
}
},
{
"request": {
"method": "GET",
"url": "CodeSystem/$lookup?system=http://loinc.org&code=8867-4&property=SHORTNAME"
}
},
{ "request": { "method": "GET", "url": "InsurancePlan/$counties?state=DE" } }
]
}'import { Haau3 } from "@haau3/sdk";
const haau3 = new Haau3(); // reads HAAU3_API_KEY
const results = await haau3.batch((b) => [
b.codeSystemLookup({ system: "http://loinc.org", code: "2345-7", property: "SHORTNAME" }),
b.codeSystemLookup({ system: "http://loinc.org", code: "8867-4", property: "SHORTNAME" }),
b.listInsurancePlanCounties({ state: "DE" }),
]);
for (const result of results) console.log(result.ok ? result.status : result.error.message);
from haau3 import BatchOk, Haau3, calls
client = Haau3() # reads HAAU3_API_KEY
results = client.batch(
calls.code_system_lookup(system="http://loinc.org", code="2345-7", property="SHORTNAME"),
calls.code_system_lookup(system="http://loinc.org", code="8867-4", property="SHORTNAME"),
calls.list_insurance_plan_counties(state="DE"),
)
for result in results:
print(result.status if isinstance(result, BatchOk) else result.error)
package main
import (
"context"
"fmt"
"log"
"github.com/haau3/haau3-go"
)
func main() {
ctx := context.Background()
client, err := haau3.NewClient() // reads HAAU3_API_KEY
if err != nil {
log.Fatal(err)
}
entry1 := haau3.Calls.CodeSystemLookup(haau3.CodeSystemLookupParams{Code: "2345-7", System: new("http://loinc.org"), Property: []string{"SHORTNAME"}})
entry2 := haau3.Calls.CodeSystemLookup(haau3.CodeSystemLookupParams{Code: "8867-4", System: new("http://loinc.org"), Property: []string{"SHORTNAME"}})
entry3 := haau3.Calls.ListInsurancePlanCounties(haau3.ListInsurancePlanCountiesParams{State: "DE"})
if err := client.Batch(ctx, []haau3.Entry{entry1, entry2, entry3}); err != nil {
log.Fatal(err)
}
show(entry1.Result())
show(entry2.Result())
show(entry3.Result())
}
// show prints that one entry of the batch answered, or why it failed.
func show[T any](_ T, err error) {
if err != nil {
fmt.Println(err)
return
}
fmt.Println("ok")
}
{
"resourceType": "Bundle",
"type": "batch-response",
"entry": [
{
"response": {
"status": "200"
},
"resource": {
"resourceType": "Parameters",
"parameter": [
{
"name": "code",
"valueCode": "2345-7"
},
{
"name": "system",
"valueString": "http://loinc.org"
},
{
"name": "name",
"valueString": "LOINC"
},
{
"name": "version",
"valueString": "2.83"
},
{
"name": "display",
"valueString": "Glucose [Mass/volume] in Serum or Plasma"
},
{
"name": "status",
"valueCode": "active"
},
{
"name": "property",
"part": [
{
"name": "code",
"valueCode": "SHORTNAME"
},
{
"name": "value",
"valueString": "Glucose SerPl-mCnc"
}
]
}
]
}
},
{
"response": {
"status": "200"
},
"resource": {
"resourceType": "Parameters",
"parameter": [
{
"name": "code",
"valueCode": "8867-4"
},
{
"name": "system",
"valueString": "http://loinc.org"
},
{
"name": "name",
"valueString": "LOINC"
},
{
"name": "version",
"valueString": "2.83"
},
{
"name": "display",
"valueString": "Heart rate"
},
{
"name": "status",
"valueCode": "active"
},
{
"name": "property",
"part": [
{
"name": "code",
"valueCode": "SHORTNAME"
},
{
"name": "value",
"valueString": "Heart rate"
}
]
}
]
}
},
{
"response": {
"status": "200"
},
"resource": {
"resourceType": "Parameters",
"parameter": [
{
"name": "county",
"part": [
{
"name": "code",
"valueCoding": {
"system": "http://terminology.hl7.org/CodeSystem/FIPS64",
"code": "10001",
"display": "Kent County"
}
},
{
"name": "state",
"valueString": "DE"
}
]
},
{
"name": "county",
"part": [
{
"name": "code",
"valueCoding": {
"system": "http://terminology.hl7.org/CodeSystem/FIPS64",
"code": "10003",
"display": "New Castle County"
}
},
{
"name": "state",
"valueString": "DE"
}
]
},
{
"name": "county",
"part": [
{
"name": "code",
"valueCoding": {
"system": "http://terminology.hl7.org/CodeSystem/FIPS64",
"code": "10005",
"display": "Sussex County"
}
},
{
"name": "state",
"valueString": "DE"
}
]
},
{
"name": "source",
"valueString": "U.S. Census Bureau, 2020 FIPS codes for counties and county equivalents: https://www2.census.gov/geo/docs/reference/codes2020/national_county2020.txt"
}
]
}
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}Run several operations in one request (batch)
POST a FHIR Bundle with type: batch to send several requests in one round trip. Each entry’s request.url is relative to this base and may be any read, search or operation of any service on it, except $reconcile-medications, which a batch refuses by name. Entries are independent: one that fails, such as a lookup of an unknown code, does not fail the others, and each carries its own status in the batch-response. For example, a batch of 50 terminology lookups measured about 4.8 ms per code, against 181 ms each when sent one at a time. Transaction bundles are not accepted: nothing on this base writes, so all or nothing would only turn one bad entry into a wholly failed request. A batch carries at most 100 entries in at most 1 MiB, and has 60 seconds: an entry still running then answers 504 inside the 200. See https://docs.haau3.com/errors#limits.
curl -X POST "https://api.haau3.com/v1/fhir/r4" \
-H "Authorization: Bearer $HAAU3_API_KEY" \
-H "Content-Type: application/fhir+json" \
-d '{
"resourceType": "Bundle",
"type": "batch",
"entry": [
{
"request": {
"method": "GET",
"url": "CodeSystem/$lookup?system=http://loinc.org&code=2345-7&property=SHORTNAME"
}
},
{
"request": {
"method": "GET",
"url": "CodeSystem/$lookup?system=http://loinc.org&code=8867-4&property=SHORTNAME"
}
},
{ "request": { "method": "GET", "url": "InsurancePlan/$counties?state=DE" } }
]
}'import { Haau3 } from "@haau3/sdk";
const haau3 = new Haau3(); // reads HAAU3_API_KEY
const results = await haau3.batch((b) => [
b.codeSystemLookup({ system: "http://loinc.org", code: "2345-7", property: "SHORTNAME" }),
b.codeSystemLookup({ system: "http://loinc.org", code: "8867-4", property: "SHORTNAME" }),
b.listInsurancePlanCounties({ state: "DE" }),
]);
for (const result of results) console.log(result.ok ? result.status : result.error.message);
from haau3 import BatchOk, Haau3, calls
client = Haau3() # reads HAAU3_API_KEY
results = client.batch(
calls.code_system_lookup(system="http://loinc.org", code="2345-7", property="SHORTNAME"),
calls.code_system_lookup(system="http://loinc.org", code="8867-4", property="SHORTNAME"),
calls.list_insurance_plan_counties(state="DE"),
)
for result in results:
print(result.status if isinstance(result, BatchOk) else result.error)
package main
import (
"context"
"fmt"
"log"
"github.com/haau3/haau3-go"
)
func main() {
ctx := context.Background()
client, err := haau3.NewClient() // reads HAAU3_API_KEY
if err != nil {
log.Fatal(err)
}
entry1 := haau3.Calls.CodeSystemLookup(haau3.CodeSystemLookupParams{Code: "2345-7", System: new("http://loinc.org"), Property: []string{"SHORTNAME"}})
entry2 := haau3.Calls.CodeSystemLookup(haau3.CodeSystemLookupParams{Code: "8867-4", System: new("http://loinc.org"), Property: []string{"SHORTNAME"}})
entry3 := haau3.Calls.ListInsurancePlanCounties(haau3.ListInsurancePlanCountiesParams{State: "DE"})
if err := client.Batch(ctx, []haau3.Entry{entry1, entry2, entry3}); err != nil {
log.Fatal(err)
}
show(entry1.Result())
show(entry2.Result())
show(entry3.Result())
}
// show prints that one entry of the batch answered, or why it failed.
func show[T any](_ T, err error) {
if err != nil {
fmt.Println(err)
return
}
fmt.Println("ok")
}
{
"resourceType": "Bundle",
"type": "batch-response",
"entry": [
{
"response": {
"status": "200"
},
"resource": {
"resourceType": "Parameters",
"parameter": [
{
"name": "code",
"valueCode": "2345-7"
},
{
"name": "system",
"valueString": "http://loinc.org"
},
{
"name": "name",
"valueString": "LOINC"
},
{
"name": "version",
"valueString": "2.83"
},
{
"name": "display",
"valueString": "Glucose [Mass/volume] in Serum or Plasma"
},
{
"name": "status",
"valueCode": "active"
},
{
"name": "property",
"part": [
{
"name": "code",
"valueCode": "SHORTNAME"
},
{
"name": "value",
"valueString": "Glucose SerPl-mCnc"
}
]
}
]
}
},
{
"response": {
"status": "200"
},
"resource": {
"resourceType": "Parameters",
"parameter": [
{
"name": "code",
"valueCode": "8867-4"
},
{
"name": "system",
"valueString": "http://loinc.org"
},
{
"name": "name",
"valueString": "LOINC"
},
{
"name": "version",
"valueString": "2.83"
},
{
"name": "display",
"valueString": "Heart rate"
},
{
"name": "status",
"valueCode": "active"
},
{
"name": "property",
"part": [
{
"name": "code",
"valueCode": "SHORTNAME"
},
{
"name": "value",
"valueString": "Heart rate"
}
]
}
]
}
},
{
"response": {
"status": "200"
},
"resource": {
"resourceType": "Parameters",
"parameter": [
{
"name": "county",
"part": [
{
"name": "code",
"valueCoding": {
"system": "http://terminology.hl7.org/CodeSystem/FIPS64",
"code": "10001",
"display": "Kent County"
}
},
{
"name": "state",
"valueString": "DE"
}
]
},
{
"name": "county",
"part": [
{
"name": "code",
"valueCoding": {
"system": "http://terminology.hl7.org/CodeSystem/FIPS64",
"code": "10003",
"display": "New Castle County"
}
},
{
"name": "state",
"valueString": "DE"
}
]
},
{
"name": "county",
"part": [
{
"name": "code",
"valueCoding": {
"system": "http://terminology.hl7.org/CodeSystem/FIPS64",
"code": "10005",
"display": "Sussex County"
}
},
{
"name": "state",
"valueString": "DE"
}
]
},
{
"name": "source",
"valueString": "U.S. Census Bureau, 2020 FIPS codes for counties and county equivalents: https://www2.census.gov/geo/docs/reference/codes2020/national_county2020.txt"
}
]
}
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "<string>",
"details": {
"text": "<string>"
},
"diagnostics": "<string>",
"expression": [
"<string>"
]
}
]
}Authorizations
Your platform API key (haau3_sk_…), sent as Authorization: Bearer <key>.
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.