Convert - X12 to FHIR (R4)

POST /convert/v1/x12tofhirr4/: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.

Inputs and Outputs

The input is a standard X12 document. 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 out of the X12 document, along with an OperationOutcome resource detailing the results (including warnings or errors) of the conversion process.

Data Format

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.

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 It
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.

Sample Input
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~
...
Sample Output
{
  "resourceType": "Bundle",
  "type": "searchset",
  "entry": [
    {
      "resource": {
        "resourceType": "Patient",
        ... (patient fields)
      }
    },
    {
      "resource": {
        "resourceType": "Claim",
        ... (claim fields)
      }
    },
    ...
    {
      "resource": {
        "resourceType": "OperationOutcome",
        "issue": [
          ... (any processing issues)
      }
    }
  ]
}