Documentation

HL7 Operations

Article author
Admin
  • Updated

With EDI API you can translate HL7 files to JSON (read HL7), translate JSON to HL7 file (write HL7), or validate an HL7 transaction (validate HL7).

 

Read HL7

Reads an HL7 file and returns its contents translated to JSON as an array of Hl7Interchange objects.

  • Path: /hl7/read
  • HTTP Verb: POST
  • Required API Key: Ocp-Apim-Subscription-Key
  • Request Content-Type: application/octet-stream or multipart/form-data
  • Request limit: 28.6 MB
  • Response Content-Type: application/json

 

Errors

  • 200: Success
  • 400: When the file stream is invalid or the form-data is not set properly.
  • 500: Something went wrong on our end. Please report at support@edination.com

The API will respond with HTTP 200 OK even if the contents of the file can't be translated. Error details will be included in the Result section of Hl7Interchange.

 

Parameters

  • ignoreNullValues boolean

    Whether to ignore all null values in the response. The default is false.

  • continueOnError boolean

    Whether to continue reading if a corrupt interchange is encountered. The default is false.

  • charSet enumeration

    The encoding of the file contents. The default is utf-8.

    The available values are:

    Value Description
    utf-16 Unicode
    unicodeFFFE Unicode (Big endian)
    utf-32 Unicode (UTF-32)
    utf-32BE Unicode (UTF-32 Big endian)
    us-ascii US-ASCII
    iso-8859-1 Western European (ISO)
    utf-7 Unicode (UTF-7)
    utf-8 Unicode (UTF-8)
  • model string

    The model to use. By default, the API will infer the model based on the transaction and version identifiers.

 

Write HL7

Translates an Hl7Interchange object to a raw HL7 interchange and returns it as a stream.

  • Path: /hl7/write
  • HTTP Verb: POST
  • Required API Key: Ocp-Apim-Subscription-Key
  • Request Content-Type: application/json
  • Request limit: 28.6 MB
  • Response Content-Type: application/octet-stream

 

Errors

  • 200: Success
  • 400: When the Hl7Interchange has an invalid JSON structure.
  • 500: Something went wrong on our end. Please report at support@edination.com

 

Parameters

  • preserveWhitespace boolean

    Whether to preserve blank data elements so the output contains multiple delimiters instead of omitting any excess delimiters. The default is false.

  • charSet string

    The encoding of the resulting stream. The default is utf-8.

    The available values are:

    Value Description
    utf-16 Unicode
    unicodeFFFE Unicode (Big endian)
    utf-32 Unicode (UTF-32)
    utf-32BE Unicode (UTF-32 Big endian)
    us-ascii US-ASCII
    iso-8859-1 Western European (ISO)
    utf-7 Unicode (UTF-7)
    utf-8 Unicode (UTF-8)
  • postfix string

    The postfix to be applied at the end of each segment, just after the segment separator. This is rarely required for HL7 because the standard segment separator is CR. By default, there is no postfix.

 

Custom Delimiters

If you need to generate an HL7 with non-default separators, set the following items as part of the Hl7Interchange payload:

  • Data element separator: Hl7Interchange.Groups.Transactions.MSH.FieldSeparator_01
  • All other separators: Hl7Interchange.Groups.Transactions.MSH.EncodingCharacters_02

Validate HL7

Validates an Hl7Interchange object according to the HL7 standard rules for each version and transaction. Returns an OperationResult object with a status field and an array of error details if any.

  • Path: /hl7/validate
  • HTTP Verb: POST
  • Required API Key: Ocp-Apim-Subscription-Key
  • Request Content-Type: application/json
  • Request limit: 28.6 MB
  • Response Content-Type: application/json

 

Errors

  • 200: Success
  • 400: When the Hl7Interchange has an invalid JSON structure.
  • 500: Something went wrong on our end. Please report at support@edination.com

 

Parameters

  • syntaxSet string

    In case you need to validate against a syntax set, different than the Default, populate this field with all of the allowed symbols, URL-escaped.

    The symbols added to this field will override the corresponding sets in the Default syntax set.

    • ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!&()*+,-./:;?= `^'""%@[]_{}\|<>~#$
  • skipTrailer boolean

    Not implemented.

  • structureOnly boolean

    This is equivalent to HIPAA Snip level 1, where only the structure and control segments are validated. By default, this is set to false, however, if you want to not validate things such as data types, a number of repetitions, or dates, set this to true.

 

API Tutorials

To learn more about how to translate and validate EDI files with EDI API try these tutorials:

Share this:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.