837 Claim Parser Usage

The console application OopFactory.X12.Hipaa.ClaimParser.exe was added to the 2.2.4 Release and supports parsing 837I and 837P into a more readable XML format and to also transform the file into the known mappings on a UB-04 Institutional and CMS-1500 Professional form as a pdf using the fo processor at FoNet.codeplex.com.

This can be used as a standalone console application to automate the transformations, or the dlls can be combined with other interface code to transformed each unbundled claim to it's representation onto recognized forms.

The application expects 3 arguments and 2 optional arguments:

Position Description Default
1st Input directory Current Directory (directory where the ClaimParser.exe resides)
2nd Search Pattern *.*
3rd Output directory Current Directory
4th NOXML or NOPDF Optional switch to suppress xml or pdf output.

Example command line:

OopFactory.X12.Hipaa.ClaimParser "c:\Temp\Input" "*.*" "c:\Temp\Output"

You can also use the dlls directly to load the claims into a claim object to manipulate directly (i.e. save to database) using an object model and skip writing out the files all together.

The following EDI is an example from the CMS site:

 

ISA*00*          *00*          *27*SSSSSS         *27*PPPPP          *101025*1248*^*00501*000000012*0*T*>~
GS*HC*AA*BB*20101025*2312*100000001*X*005010X222~
ST*837*AB10*005010X222~
BHT*0019*00*ABCDE12345*20101025*2312*CH~
NM1*41*2*5010 SUBMITTER*****46*SSSSSS~
PER*IC*TEST SUBMITTER*TE*4105551212~
NM1*40*2*TEST 5010 PART B*****46*PPPPP~
HL*1**20*1~
NM1*85*2*MASTERS CLINIC*****XX*NNNNNNNNNN~
N3*234 ANYSTREET LN.*SUITE 450~
N4*DALLAS*TX*781231212~
REF*EI*EEEEEEEEE~
PER*IC*MASTERS CLINIC CONTACT*TE*9725551212*FX*9725551213~
HL*2*1*22*0~
SBR*P*18*******MB~
NM1*IL*1*PUBLIC*JOHN*Q***MI*1111111111F~
N3*123 BEST STREET*APT 5432~
N4*DALLAS*TX*752401234~
DMG*D8*19580713*M~
NM1*PR*2*TEST 5010 PART B*****PI*PPPPP~
N4*BALTIMORE*MD*212121212~
CLM*PR9xxxxxx.BHT01.0001*950***22>B>1*Y*A*Y*Y~
HI*BK>5920~
NM1*82*1*DOE*JOHN****XX*NNNNNNNNNN~
NM1*77*2*ANYWHERE HOSPITAL~
N3*123 MAINSTREET~
N4*DALLAS*TX*725121212~
LX*1~
SV1*HC>00873>QK*950*MJ*50***1~
DTP*472*D8*20101025~
REF*6R*200910060000000008H0001~
SE*30*AB10~
GE*1*100000001~
IEA*1*000000012~

 

It will be transformed to the following XML:

 

<?xml version="1.0" encoding="utf-8"?>
<ClaimDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.oopfactory.com/2011/XSL/Hipaa">
  <Claim Version="005010X222" Type="Professional" TransactionCode="AB10" ClaimNumber="" BillTypeCode="221" PatientControlNumber="PR9xxxxxx.BHT01.0001" TotalClaimChargeAmount="950" ProviderSignatureOnFile="Y" ProviderAcceptAssignmentCode="A" BenefitsAssignmentCertificationIndicator="Y" ReleaseOfInformationCode="Y" MedicalRecordNumber="" StatementFromDate="2010-10-25" StatementToDate="2010-10-25">
    <ServiceLocationInfo Qualifier="B" FacilityCode="22" FrequencyTypeCode="1" />
    <BillingInfo>
      <Provider Npi="NNNNNNNNNN" TaxId="EEEEEEEEE">
        <Name LastName="MASTERS CLINIC">
          <Type Identifier="85" Qualifier="NonPerson">Billing Provider</Type>
          <Identification Qualifier="XX" Id="NNNNNNNNNN">Centers for Medicare and Medicaid Services National Provider Identifier</Identification>
        </Name>
        <Address City="DALLAS" StateCode="TX" PostalCode="781231212">
          <Line1>234 ANYSTREET LN.</Line1>
          <Line2>SUITE 450</Line2>
        </Address>
        <Identification Qualifier="EI" Id="EEEEEEEEE" />
        <Contact FunctionCode="IC">
          <Name>MASTERS CLINIC CONTACT</Name>
          <Number Qualifier="TE">9725551212</Number>
          <Number Qualifier="FX">9725551213</Number>
        </Contact>
      </Provider>
    </BillingInfo>
    <Subscriber Gender="Male" DateOfBirth="1958-07-13" MemberId="1111111111F">
      <Name LastName="PUBLIC" FirstName="JOHN" MiddleName="Q">
        <Type Identifier="IL" Qualifier="Person">Insured or Subscriber</Type>
        <Identification Qualifier="MI" Id="1111111111F">Member Identification Number</Identification>
      </Name>
      <Address City="DALLAS" StateCode="TX" PostalCode="752401234">
        <Line1>123 BEST STREET</Line1>
        <Line2>APT 5432</Line2>
      </Address>
    </Subscriber>
    <Payer>
      <Name LastName="TEST 5010 PART B">
        <Type Identifier="PR" Qualifier="NonPerson">Payer</Type>
        <Identification Qualifier="PI" Id="PPPPP">Payor Identification</Identification>
      </Name>
    </Payer>
    <SubscriberInformation PayerResponsibilitySequenceNumberCode="P" IndividualRelationshipCode="18" ReferenceIdentification="" Name="" InsuranceTypeCode="" CoordinationOfBenefitsCode="" YesNoConditionResponseCode="" EmploymentStatusCode="" ClaimFilingIndicatorCode="MB" />
    <Diagnosis DiagnosisType="Principal" Version="ICD9" Qualifier="BK" Code="5920" Poi="Unknown" />
    <Provider Npi="NNNNNNNNNN">
      <Name LastName="DOE" FirstName="JOHN">
        <Type Identifier="82" Qualifier="Person">Rendering Provider</Type>
        <Identification Qualifier="XX" Id="NNNNNNNNNN">Centers for Medicare and Medicaid Services National Provider Identifier</Identification>
      </Name>
    </Provider>
    <Provider>
      <Name LastName="ANYWHERE HOSPITAL">
        <Type Identifier="77" Qualifier="NonPerson">Service Location</Type>
        <Identification Qualifier="" Id="" />
      </Name>
      <Address City="DALLAS" StateCode="TX" PostalCode="725121212">
        <Line1>123 MAINSTREET</Line1>
      </Address>
    </Provider>
    <ServiceLine LineNumber="1" Quantity="50" Unit="MJ" DiagnosisCodePointer1="1" ChargeAmount="950" ServiceDateFrom="2010-10-25" ServiceDateTo="2010-10-25">
      <PlaceOfService Code="" />
      <Procedure Qualifier="HC" ProcedureCode="00873" Modifier1="QK" />
      <Identification Qualifier="6R" Id="200910060000000008H0001" />
      <Date Qualifier="472" Date="2010-10-25T00:00:00">Service</Date>
    </ServiceLine>
  </Claim>
</ClaimDocument>

 

Which will look like the following CMS-1500 form in PDF:

If you would like to customize the mappings onto the forms (i.e. add footer information about your organization), you can extend the ProfessionalClaimToHcfa1500FormTransformation or InstitutionalClaimToUB04ClaimFormTransformation classes and override the TransformClaimToHcfa1500 or TransformClaimToUB04 methods that define which claim elements will be rendered in which form location.

Last edited Apr 29, 2012 at 2:05 PM by dstrubhar, version 6

Comments

tomcorty Apr 25, 2013 at 3:17 PM 
try
{

FileStream my837File = new FileStream(@"c:\temp\837\837 demo.txt", FileMode.Open, FileAccess.Read);

OopFactory.X12.Parsing.X12Parser parser = new OopFactory.X12.Parsing.X12Parser();

OopFactory.X12.Hipaa.Claims.Services.ClaimTransformationService claimTransformationService =
new OopFactory.X12.Hipaa.Claims.Services.ClaimTransformationService();


OopFactory.X12.Hipaa.Claims.ClaimDocument claimDocument = claimTransformationService.Transform837ToClaimDocument(my837File);



OopFactory.X12.Hipaa.Claims.Services.ClaimFormTransformationService claimFormTransformationService =
new OopFactory.X12.Hipaa.Claims.Services.ClaimFormTransformationService(
new ProfessionalClaimToHcfa1500FormTransformation(@"C:\Downloads\837\CodePlex\Release 2.3.4 binaries\Release\HCFA1500_Red.gif"),
new InstitutionalClaimToUB04ClaimFormTransformation(@"C:\Downloads\837\CodePlex\Release 2.3.4 binaries\Release\UB04_Red.gif"),
new ProfessionalClaimToHcfa1500FormTransformation(@"C:\Downloads\837\CodePlex\Release 2.3.4 binaries\Release\HCFA1500_Red.gif"));

XmlDocument foDocument = new XmlDocument();
string foXml = claimFormTransformationService.TransformClaimDocumentToFoXml(claimDocument);
foDocument.LoadXml(foXml);

var driver = Fonet.FonetDriver.Make();

FileStream outputFile = new FileStream(@"c:\Temp\837\837 demo.pdf", FileMode.Create, FileAccess.Write);
driver.Render(foDocument, outputFile);

}
catch (Exception ex)
{
}

jinpin May 3, 2012 at 4:24 PM 
can someone write a few lines in C or VB.net about this pdf generation? how to use fo.net from claimdocument to pdf?