Guide
Errors
Status codes, FHIR OperationOutcome and HL7 ACK errors.
FHIR errors
Errors are returned as a FHIR OperationOutcome with a machine-readable code and a human diagnostics text:
json
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "not-found",
"diagnostics": "Patient/0000 not found"
}
]
}| HTTP | issue.code | Meaning |
|---|---|---|
| 400 | invalid · required · structure | A parameter or the body is wrong or missing |
| 401 | login | Missing, malformed, unknown, revoked or expired key |
| 403 | forbidden | Key lacks the scope, the plan has no API access, or the practice is not active |
| 404 | not-found · not-supported | No such record (or not visible to the API), or an unsupported resource type |
| 405 | not-supported | That operation is not available |
| 409 | duplicate | A patient with the same ID or passport number exists |
| 422 | invalid · processing | The resource is valid FHIR but cannot be stored (e.g. invalid SA ID number) |
| 429 | throttled | Rate limit; wait Retry-After seconds |
| 500 | exception | Unexpected error; safe to retry with back-off |
| 503 | API temporarily unavailable |
HL7 errors
HL7 endpoints always answer with an ACK. MSA-1 is AA (accepted), AE (error: the message was understood but could not be processed) or AR (rejected: unparseable, unsupported or not authorised). Errors include an ERR segment with the reason:
hl7
MSH|^~\&|CLINICVIEW|CLINICVIEW|LABSYS|LANCET|20261122114203||ACK^R01^ACK|ACK1764063723001|P|2.5.1
MSA|AE|MSG00042|Patient not found: send our order number in OBR-2 or our patient number in PID-3
ERR|||207^Application internal error^HL70357|E||||Patient not found: send our order number in OBR-2 or our patient number in PID-3Resend AE messages only after fixing the cause; AR for authentication or rate limits can be retried.