Laboratories (HL7 v2)
Send lab results (ORU^R01)
Laboratories post results; ClinicView files them on the patient and alerts the clinician.
POST
/api/hl7Scope hl7.writePost one HL7 v2 ORU^R01 message per request, segments separated by carriage returns (\r). The answer is an HL7 ACK.
Matching the patient: put our order id in OBR-2 (it is in every order we send), or our patient number in PID-3; a unique South African ID number (^^^ZAF^NI) also works.
Corrections: a result with the same filler order, set id and test replaces the earlier one and asks the clinician to acknowledge it again. OBX-11 P is stored as pending (not shown to patients); F/C as final.
POST /api/hl7
curl -X POST "https://system.clinicview.co.za/api/hl7" \
-H "Authorization: Bearer $CLINICVIEW_API_KEY" \
-H "Accept: x-application/hl7-v2+er7" \
-H "Content-Type: x-application/hl7-v2+er7" \
--data-binary $'MSH|^~\\&|LABSYS|LANCET|CLINICVIEW|PRACTICE|20261122114200||ORU^R01^ORU_R01|MSG00042|P|2.5.1\rPID|1||P000123^^^CLINICVIEW^MR~9004120123081^^^ZAF^NI||Mokoena^Thandi||19900412|F|||||+27821234567\rOBR|1|2b4d6f8a-0c2e-4a6c-9e8b-7d9f1b3d5f99^CLINICVIEW|LAB778|4548-4^Hemoglobin A1c^LN|||20261122071000\rOBX|1|NM|4548-4^Hemoglobin A1c^LN||6.9|%|4.0-6.0|H|||F|||20261122114200\rNTE|1||Repeat in 3 months'MSH|^~\&|CLINICVIEW|CLINICVIEW|LABSYS|LANCET|20261122114203||ACK^R01^ACK|ACK1764063723000|P|2.5.1
MSA|AA|MSG00042|Accepted 1 new, 0 updated resultsRequest body
x-application/hl7-v2+er7 · An HL7 v2.x ORU^R01 message.
Responses
- 200Accepted: ACK with MSA-1
AA. - 400Unparseable message: ACK
AR. - 401Missing or invalid key: ACK
AR. - 422Not processed (unknown patient, no OBX…): ACK
AEwith an ERR segment explaining why. - 429Rate limit: ACK
AR; retry afterRetry-Afterseconds.