POST /convert/v1/x12tofhir/:patientID
This operation converts an X12 document into a FHIR R4 bundle.
See the Programming Guide for general principles that apply to all Convert API operations.
The input is a standard X12 document. The Convert API supports version 5010 of the following message types:
The output is a FHIR R4 Bundle containing the data parsed out of the X12 document, along with an OperationOutcome resource detailing the results (including warnings or errors) of the conversion process.
The input for the X12 to FHIR conversion 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.
*
, :
, ~
, and ^
.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)
}
}
]
}