Module health.x12.v006020x316
wso2healthcare/health.x12.v006020x316
Package Overview
This package contains the Ballerina records generated from the X12 v006020X316 275 ("Additional Information to Support a Health Care Services Review") schema. These can be used to implement use cases that require processing data in this format, such as submitting supporting documentation for a prior authorization / health care services review.
How to read
X12 _ 006020 _ X316 _ 275 │ │ │ │ │ │ │ └── Transaction Set ID │ │ └──────── Implementation Guide Reference ID │ └───────────────── Version/Release └──────────────────────── Standards Body
Samples
An eligible X12 string can be used with the relevant X12 records library. Each library contains the following functions,
- fromEdiString - used to convert the EDI string of the relevant version to X12 ballerina records. The schema will be implicitly referred.
- fromEdiStringWithSchema - used to convert the EDI string of the relevant version to X12 ballerina records. The schema must be provided.
- toEdiString - used to convert the ballerina record of the relevant X12 version to EDI string. The schema will be implicitly referred.
- toEdiStringWithSchema - used to convert the ballerina record of the relevant X12 version to EDI string. The schema must be provided.
- getSchema() - retrieves the schema for the relevant version.
The following code snippet uses the wso2healthcare/health.x12.v006020x316.v275 library for this. The library defined in the v006020x316/modules directory is available to be used like this.
v275:X12_006020_275 'record = {}; // initializing the v275 record edi:EdiSchema|error schema = v275:getSchema(); // retrieving the schema for v275
The EDI string used in the examples below is the published sample from the CMS esMD X12N 275 Companion Guide (ASC X12N/006020X316): Additional Information to Support Health Care Services Review (Version 3.0 Final, Section 4, Figure 2). The same sample is available at samples/Example_275_006020X316.edi.
- Converting an EDI string to X12 ballerina record and fetch data from it.
Example:
import ballerina/io; import ballerina/edi; import wso2healthcare/health.x12.v006020x316.v275; public function main() { string x12String = string `ISA*00* *00* *ZZ*TESTHIH *ZZ*DBRRC *180418*1156*+*00602*000104142*0*P*:~ GS*PI*TESTHIH*DBRRC*20180418*115603*104142*X*006020X316~ ST*275*104142*006020X316~ BGN*02*1710101110473*20170320*111001~ NM1*ACV*1*HIHPROVIDER*****XX*1111111112*67*1P~ PER*IC*ESMD TESTING*FX*8034362416*TE*8034362416*EX*6788~ NM1*40*2*COBIUS*****PI*50505*67*X3~ NM1*IL*1*PARKER*CARROL*S***MI*215123556A~ REF*EJ*1234567~ REF*2I*RGK000000009500~ LX*1~ TRN*1*LANCEATYACHCTLNJSWL1ND0528~ HI*ABK:R0600*ABJ:S06337A*ABJ:S29019A*ABJ:S238XXA*ABJ:S96919A~ DTP*368*D8*20170320~ CAT*AE*MB~ OOI*1*47*ATTACHMENT~ BDS*B64*28*cmVhbF9wYXlsb2FkXzFtYi50eHQ=~ SE*16*104142~ GE*1*104142~ IEA*1*000104142~`; // Print the InformationSourceName from Loop_1000A edi:EdiSchema|error schema = v275:getSchema(); if schema is edi:EdiSchema { v275:X12_006020_275|error fromEdiString = v275:fromEdiStringWithSchema(x12String, schema); if fromEdiString is v275:X12_006020_275 { io:println(fromEdiString?.X12_FunctionalGroup?.X12_006020_275?.Loop_1000A?.InformationSourceName?.NM103__InformationSourceLastOrOrganizationName); } } }
- Converting an X12 Ballerina record to the relevant EDI string.
The following code snippet uses the wso2healthcare/health.x12.v006020x316.v275 library for this.
Example:
import ballerina/io; import wso2healthcare/health.x12.v006020x316.v275; public function main() { v275:X12_006020_275 'record = { "InterchangeControlHeader": { "code": "ISA", "ISA01__AuthorizationInformationQualifier": "00", "ISA02__AuthorizationInformation": " ", "ISA03__SecurityInformationQualifier": "00", "ISA04__SecurityInformation": " ", "ISA05__InterchangeIDQualifier": "ZZ", "ISA06__InterchangeSenderID": "TESTHIH", "ISA07__InterchangeIDQualifier": "ZZ", "ISA08__InterchangeReceiverID": "DBRRC", "ISA09__InterchangeDate": "180418", "ISA10__InterchangeTime": "1156", "ISA11__RepetitionSeparator": "+", "ISA12__InterchangeControlVersionNumber": "00602", "ISA13__InterchangeControlNumber": 104142, "ISA14__AcknowledgmentRequested": "0", "ISA15__InterchangeUsageIndicator": "P", "ISA16__ComponentElementSeparator": ":" }, "X12_FunctionalGroup": { "FunctionalGroupHeader": { "code": "GS", "GS01__FunctionalIdentifierCode": "PI", "GS02__ApplicationSendersCode": "TESTHIH", "GS03__ApplicationReceiversCode": "DBRRC", "GS04__Date": "20180418", "GS05__Time": "115603", "GS06__GroupControlNumber": 104142, "GS07__ResponsibleAgencyCode": "X", "GS08__VersionReleaseIndustryIdentifierCode": "006020X316" }, "X12_006020_275": { "A_275TransactionSetHeader": { "code": "ST", "ST01__TransactionSetIdentifierCode": "275", "ST02__TransactionSetControlNumber": "104142", "ST03__ImplementationConventionReferenceIdentifier": "006020X316" }, "BeginningSegment": { "code": "BGN", "BGN01__TransactionSetPurposeCode": "02", "BGN02__TransactionSetReferenceNumber": "1710101110473", "BGN03__TransactionSetCreationDate": "20170320", "BGN04__TransactionSetCreationTime": "111001" }, "Loop_1000A": { "InformationSourceName": { "code": "NM1", "NM101__EntityIdentifierCode": "ACV", "NM102__EntityTypeQualifier": "1", "NM103__InformationSourceLastOrOrganizationName": "HIHPROVIDER", "NM108__IdentificationCodeQualifier": "XX", "NM109__InformationSourceIdentifier": "1111111112", "NM110__EntityRelationshipCode": "67", "NM111__EntityIdentifierCode": "1P" } }, "A_275TransactionSetTrailer": { "code": "SE", "SE01__TransactionSegmentCount": "16", "SE02__TransactionSetControlNumber": "104142" } }, "FunctionalGroupTrailer": { "code": "GE", "GE01__NumberofTransactionSetsIncluded": 1, "GE02__GroupControlNumber": 104142 } }, "InterchangeControlTrailer": { "code": "IEA", "IEA01__NumberofIncludedFunctionalGroups": 1, "IEA02__InterchangeControlNumber": 104142 } }; string|error ediString = v275:toEdiString('record); if ediString is string { io:print("The EDI string is : " + ediString); } }
Import
import wso2healthcare/health.x12.v006020x316;Other versions
1.0.0