Skip to content

Send an HL7 v3 interaction or CDA document

post /api/v1/hl7v3

An HL7 v3 order or result interaction, or a CDA document, with or without a SOAP envelope. Answered with an accept acknowledgement (MCCI_IN000002UV01) in the same envelope style: AA when applied or not needed, AE or AR with the reason. The token needs the optional hl7v3:write scope.

Scope: hl7v3:write (hl7 tokens).

Rate limit: Per-token HL7 limit.

Audited as order.receive in the practice's audit log.

Request body

XML, up to 2 MiB

application/hl7-v3+xml

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns="urn:hl7-org:v3">
  <templateId root="2.16.840.1.113883.10.20.22.1.1"/>
  <id root="2.25.1234567890"/>
  <inFulfillmentOf><order><id root="2.25.1" extension="SYNACC0001"/></order></inFulfillmentOf>
  <!-- synthetic report body -->
</ClinicalDocument>

application/xml

text/xml

application/soap+xml

Responses

200

Accept acknowledgement

application/xml

400

Not well-formed v3 or CDA: acknowledgement with AR. Problem: validation

application/xml

401

Problem: unauthenticated

403

Problem: forbidden, tenant-suspended, trial-expired

413

Problem: too-large

415

Problem: unsupported-media-type

429

Problem: rate-limited

500

Problem: internal

503

Problem: tenant-migrating

Errors

Status Type Meaning
401 unauthenticated Not authenticated
403 forbidden Not allowed
500 internal Internal error
429 rate-limited Rate limited
503 tenant-migrating Practice is being moved
403 tenant-suspended Practice is read-only
403 trial-expired Trial has ended
415 unsupported-media-type Unsupported content type
413 too-large Message too large
400 validation Invalid request

Examples

curl

curl -X POST 'https://app.pacspilot.com/api/v1/hl7v3' \
  -H "Authorization: Bearer $PACSPILOT_TOKEN" \
  -H 'Content-Type: application/hl7-v3+xml' \
  --data-binary '<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns="urn:hl7-org:v3">
  <templateId root="2.16.840.1.113883.10.20.22.1.1"/>
  <id root="2.25.1234567890"/>
  <inFulfillmentOf><order><id root="2.25.1" extension="SYNACC0001"/></order></inFulfillmentOf>
  <!-- synthetic report body -->
</ClinicalDocument>'

JavaScript

const res = await fetch("https://app.pacspilot.com/api/v1/hl7v3", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PACSPILOT_TOKEN}`,
    "Content-Type": "application/hl7-v3+xml",
  },
  body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ClinicalDocument xmlns=\"urn:hl7-org:v3\">\n  <templateId root=\"2.16.840.1.113883.10.20.22.1.1\"/>\n  <id root=\"2.25.1234567890\"/>\n  <inFulfillmentOf><order><id root=\"2.25.1\" extension=\"SYNACC0001\"/></order></inFulfillmentOf>\n  <!-- synthetic report body -->\n</ClinicalDocument>",
});
console.log(res.status, await res.text());

Python

import os
import requests

data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ClinicalDocument xmlns=\"urn:hl7-org:v3\">\n  <templateId root=\"2.16.840.1.113883.10.20.22.1.1\"/>\n  <id root=\"2.25.1234567890\"/>\n  <inFulfillmentOf><order><id root=\"2.25.1\" extension=\"SYNACC0001\"/></order></inFulfillmentOf>\n  <!-- synthetic report body -->\n</ClinicalDocument>"

res = requests.request(
    "POST",
    "https://app.pacspilot.com/api/v1/hl7v3",
    headers={"Authorization": f"Bearer {os.environ['PACSPILOT_TOKEN']}", "Content-Type": "application/hl7-v3+xml"},
    data=data.encode("utf-8"),
)
print(res.status_code, res.text)