Convert - X12 to FHIR (R4)
POST /convert/v1/x12tofhirr4
This operation converts an X12 document into a FHIR R4 bundle.
Inputs and Outputs
The input is a standard X12 document for a single patient. The Convert API supports version 5010 of the following message types:
- 835 (Electronic Remittance Advice)
- 837P (Health Claims, Professional)
- 837I (Health Claims, Institutional)
The output is a FHIR R4 Bundle containing the data parsed from the input, along with an OperationOutcome resource detailing the results (including warnings or errors) of the conversion process. See Output FHIR R4 Bundles for details.
Query Parameters
Optional resource ID for the Patient. See programming guide for details.
Optional business identifier for the Patient resource. If specified, patientIdentifierSystem
must also be present. See programming guide for details.
System that provided the patientIdentifier
. If specified, patientIdentifier
must also be present. See programming guide for details.
Data Format
The input is plain text, so be sure to specify content-type: text/plain
in your request header.
You can specify either accept: application/json
or accept: application/xml
in your request header to get a response in either JSON or XML format.
Message Processing Notes
- Message delimiters are specified in the ISA segment. These delimiters can be any printable ASCII symbol (not letters, numbers, or spaces). Common delimiters include
*
,:
,~
, and^
. - If more than one claim is included in the input X12 document, they should represent data about the same individual.
- Unsupported document types will result in an operation outcome error.
Example
Try out the operations, with examples, in the Developer Portal Sandbox.
X12 documents and FHIR bundles are lengthy, so this just shows a small sample to illustrate how the data is structured. For a more complete example, try out the API in the Developer Portal Sandbox.
ISA*00* *00* *ZZ*SUBMITTERID *ZZ*RECEIVERID *230616*1145*^*00501*000000001*0*T*:~
GS*HC*SENDERCODE*RECEIVERCODE*20230627*11301505*123456789*X*005010X222A1~
ST*837*0001*005010X222A1~
NM1*85*2*SAMPLE BILLING PROVIDER*****XX*0123456789~
N3*123 BILLING PROVIDER STREET~
N4*BILLING PROVIDER CITY*MI*55555~
HL*2*1*22*0~
NM1*IL*1*PATIENT LAST NAME*PATIENT FIRST NAME****MI*ID54321~
...
{
"resourceType": "Bundle",
"type": "searchset",
"entry": [
{
"resource": {
"resourceType": "Patient",
... (patient fields)
}
},
{
"resource": {
"resourceType": "Claim",
... (claim fields)
}
},
...
{
"resource": {
"resourceType": "OperationOutcome",
"issue": [
... (any processing issues)
}
}
]
}