Message Version

Jul 17, 2011 at 6:10 PM

Hi,

I am trying to construct a message and am running into some difficulties.

 

The first relates to version. So, I'm doing the following

            ' This is the message object
            ' "ISA" - INTERCHANGE CONTROL HEADER
            Dim message As New Interchange(_Date, 1, True)
            message.InterchangeSenderIdQualifier = "ZZ"
            message.InterchangeSenderId = "9012345720000"
            message.InterchangeReceiverIdQualifier = "ZZ"
            message.InterchangeReceiverId = "9088877320000"
            '? "ISA12" Interchange Control Version Number - should be 005001 not 004001
            '? "ISA13" Interchange Control Number - how to set

But I'm getting version 4, not version 5. How can I specify that I want the message to be version 5?

 

Again, here, I'm getting the wrong version identifier code:

 

           ' "GS" - FUNCTIONAL GROUP HEADER
            Dim group = message.AddFunctionGroup("HC", _Date, 999999)
            group.ApplicationSendersCode = "901234572000"
            group.ApplicationReceiversCode = "908887732000"
            '? "GS08" Version Identifier Code - should be 005010X222 not 004010X098A1A

nd here too, it won't let me add an element that only exists in version 5

            ' "ST" TRANSACTION SET HEADER
            Dim transaction = group.AddTransaction("837", "0034")
            '? "ST03" - Implementation Convention Reference - missing new element


The second problem which may or may not be related is that I can't create any segment except a BHT segment... It doesn't error out, but it just doesn't end up in the output message string when I call serialize.

            ' "NM1" SUBMITTER NAME - loop 1000A  
            Dim NM1 = transaction.AddSegment("NM1")
            '? cannot create anything but "BHT"

Thanks for any help in advance!

Coordinator
Jul 18, 2011 at 1:17 AM

My apologies, this part of the application needs more documentation and examples.  I will look into updating the document page with more examples.  I will be working on the next release having more strongly typed segments and loops to make the coding more self describing without having to add comments.  Feel free to add that as a feature request if that would encourage you to adopt this as a tool.

Here is a code snippet to get you started:

        Dim message As New Interchange(DateTime.Now, 1, True)
        message.InterchangeSenderIdQualifier = "ZZ"
        message.InterchangeSenderId = "9012345720000"
        message.InterchangeReceiverIdQualifier = "ZZ"
        message.InterchangeReceiverId = "9088877320000"
        message.SetElement(12, "00501")

        Dim group = message.AddFunctionGroup("HC", DateTime.Now, 999999)
        group.ApplicationSendersCode = "901234572000"
        group.ApplicationReceiversCode = "908887732000"
        group.VersionIdentifierCode = "005010X222"

        Dim transaction = group.AddTransaction("837", "0034")
        Dim bhtSegment = transaction.AddSegment("BHT")

        Dim submitterLoop = transaction.AddLoop("NM1*41") 'Submitter Identifer Code
        submitterLoop.SetElement(2, "2") 'Non-Person Entity
        submitterLoop.SetElement(3, "My Submitter") 'Organization Name

        Dim perSegment = submitterLoop.AddSegment("PER")
        perSegment.SetElement(1, "IC") 'Information Contact Function Code
        perSegment.SetElement(2, "My Contact") 'Name
        perSegment.SetElement(3, "TE") 'Telephone Qualifier
        perSegment.SetElement(4, "18005555555") 'Communication Number

        Dim providerHLoop = transaction.AddHLoop(1, "20", True) 'Information Source
        providerHLoop.AddSegment("PRV") 'Speciality Segment
        Dim providerNameLoop = providerHLoop.AddLoop("NM1*85")
        providerNameLoop.SetElement(2, "1") 'Person Entity
        providerNameLoop.SetElement(3, "Doe") 'Last Name
        providerNameLoop.SetElement(4, "John") 'First Name


        Dim x12 = message.SerializeToX12(True)

        System.Diagnostics.Trace.Write(x12)

The code above will produce the following output:

ISA*00*          *00*          *ZZ*9012345720000  *ZZ*9088877320000  *110717*0709*U*00501*000000001*1*P*:~
  GS*HC*901234572000*908887732000*20110717*1909*999999*X*005010X222~
    ST*837*0034~
      BHT~
      NM1*41*2*My Submitter~
        PER*IC*My Contact*TE*18005555555~
      HL*1**20*1~
        PRV~
        NM1*85*1*Doe*John~
    SE*8*0034~
  GE*1*999999~
IEA*1*000000001~

You were getting nulls back from the attempt to add NM1 to the transaction because the specification doesn't expect it as a raw segment, it expects it as a loop.  I haven't done a whole lot of testing on the 5010 specifications, so if you find it throwing exceptions that you aren't expecting, please report and I will get it fixed by the next release.

Coordinator
Jul 18, 2011 at 1:27 AM
Edited Jul 18, 2011 at 1:29 AM

I just realized this code will not allow you to override the version setting when you AddFunctionGroup so it will attempt to use the 4010 specification instead of the 5010.  I will need to create a new release to fix this.  The needed changes are in Changeset 9257.

 

Dim group = message.AddFunctionGroup("HC", DateTime.Now, 999999, "005010X222")

 

Let me know if you have any suggestions on how you think this module should mature.

Jul 19, 2011 at 3:59 PM

Thank you, I'll give it a try.

Jul 19, 2011 at 6:35 PM

Thanks! The version override works. However, I'm having two problems now:

 

1. I cannot set new elements that exist in v5, but not v4. For example, I cannot set the value for ST03.

2. The length limit is not increased according to the v5 spec. For example, NM104 has a length limit of 25 in V4, but 35 in V5.

 

Thanks for the assistance.

Coordinator
Jul 20, 2011 at 3:45 AM

I admire your deligence in working through these errors.  I have fixed the specification in Changeset 9298.

I will work on getting some more unit tests in place that can create an entire sample 837 file.  Let me know if you come across any more exceptions.  If you want to post some sample de-identified 837 examples, I can create a documentation page that shows the syntax needed to create it (as well us uncover any other problems with the specification).

This is a lightly used area of this tool, so any feedback you can give me to make it better is greatly appreciated.

Jul 20, 2011 at 4:03 AM

Thanks for the continued assistance.

I like the way the tool is structured and the straightforward API. I realize this area is lightly used, but would you advise against using it for programmatic message creation/construction?

Will post a sample tomorrow.

 

Thanks again.

Coordinator
Jul 20, 2011 at 4:35 AM

I am really just apologizing that I haven't gotten to do much work on it.

I would like you to use it for message creation, it will help me to understand how it can be improved.  I know the API is very rudimentary right now.  

I like to create elegant syntax that is pleasing to look at, thus easy to maintain.  So if you had any suggestions, I would gladly incorporate them.  Some of it may be just adding more documentation; I intend to do that tool

Jul 21, 2011 at 1:55 AM

Thanks. We're analyzing what additions and changes are in the 5010 spec that need to be incorporated.

In the meantime, can you tell me what the difference between a hierarchical loop and a regular loop is (AddHLoop vs AddLoop)?

Coordinator
Jul 21, 2011 at 2:56 AM

A hierarchical loop has IDs and pointers to it's parent ID.  It is a very specific structural mechanism that always starts with an HL segment.  This segment is implied by the HierarchicalLoop class that inherits from the Segment class.

You can identify the structure of hierarchical loops by their very nature without knowing what the Specification looks like.

A regular loop is very implementation specific and you wouldn't know that it was a loop without the specification identifying what segment starts the loop and which segments are allowed children of the loop.

For an 837, the most common starting segments of loops are NM1, CLM, and LX.

 

I think it has bigger implications when you get to clearinghouses that have to break up a message and distribute it to all the intended recipients.  It gives a very clear way to break up the file without having to know the nuances of the detailed loops.

They are both similar in that it's just a way to describe an aggregation of segments representing some entity of data.

The 837 HLs are particularly interesting because you can have claims in the Subscriber HL or the Patient HL and the HL03 element actually tells you which to expect the CLM loops to fall under.

Jul 25, 2011 at 5:09 AM
Edited Jul 25, 2011 at 5:23 AM

HI,

We've come a bit further and have identified the following points of the spec that seem incorrect:

 

- NM1.5: length

-PER.4, PER.6, PER.8: length should be 256

-N4.7: new element

-REF.2: length 50

-REF.4-10: new elements

-NM1*PE: loop could not be added because it couldn't be found in the specification for HL

-NM1*IL: loop could not be added because it couldn't be found in the specification for HL

Regarding the last two, should we be using HLoop? Or regular Loop? We're trying to add them to an HLoop by calling myHLoop.AddLoop.

 

Thanks!

Coordinator
Jul 27, 2011 at 1:32 PM

I have check-in the segment changes with changeset 9339.

You method call is correct.  YOu should be able to Add the NM1*PE loop (2010AC) to the Billing Provider Hierarchical Loop.

You should be able to add the NM1*IL loop (2010BA) to the Subscriber Hiearchical loop.

If you have some code segments of what you are doing and the error message you are getting, than I can help troubleshoot it for you.

Jul 28, 2011 at 5:24 AM
Edited Jul 28, 2011 at 5:25 AM

Hi,

Thanks, we're making more progress. Full code sample to come, but here is the initial result with the latest code:

 

Dim NM1_2010AC = HL_2000A.AddLoop("NM1*PE")

gives error

Loop NM1*PE could be added because it could not be found in the specification for HL



New elements

DMG10

DMG11

HI12

 

Incorrect length

element

spec

current

NM105

1 - 25

25 - 25

CLM13

1 - 1

2 - 3

CLM20

1 - 2


2 - 2
Jul 29, 2011 at 10:45 PM

Hi,

I am working with Jeff

i am still having aproblem with 'NM1*PE' allocation


Dim NM1_2010AC = HL_2000A.AddLoop("NM1*PE")
 - returns error
 Loop NM1*PE could be added because it could not be found in the specification for HL

please advise

Thank you

 

Coordinator
Jul 30, 2011 at 5:31 PM

I have updated the specification in changeset 9358 to address this issue.  The quickest way for me identify problems with the 5010 specification is if I can add more sample 5010 messages to the Unit Tests.  I have 3 837P samples now, but if you have any that you would like me to add, this will be the quickest way to resolve them all.  You can use a tool if you need to remove a lot PII or PHI (http://etasoft.com/ot.htm).

The Unit Test has been updated as follows:

        Dim message As New Interchange(DateTime.Now, 1, True)
        message.InterchangeSenderIdQualifier = "ZZ"
        message.InterchangeSenderId = "9012345720000"
        message.InterchangeReceiverIdQualifier = "ZZ"
        message.InterchangeReceiverId = "9088877320000"
        message.SetElement(12, "00501")

        Dim group = message.AddFunctionGroup("HC", DateTime.Now, 999999, "005010X222")
        group.ApplicationSendersCode = "901234572000"
        group.ApplicationReceiversCode = "908887732000"

        Dim transaction = group.AddTransaction("837", "0034")
        transaction.SetElement(3, "005010X222")
        Dim bhtSegment = transaction.AddSegment("BHT")

        Dim submitterLoop = transaction.AddLoop("NM1*41") 'Submitter Identifer Code
        submitterLoop.SetElement(2, "2") 'Non-Person Entity
        submitterLoop.SetElement(3, "My Submitter") 'Organization Name
        submitterLoop.SetElement(4, "First Name That Is > 25 Chars") 'First Name

        Dim perSegment = submitterLoop.AddSegment("PER")
        perSegment.SetElement(1, "IC") 'Information Contact Function Code
        perSegment.SetElement(2, "My Contact") 'Name
        perSegment.SetElement(3, "TE") 'Telephone Qualifier
        perSegment.SetElement(4, "18005555555") 'Communication Number

        Dim provider2000AHLoop = transaction.AddHLoop(1, "20", True) 'Information Source
        provider2000AHLoop.AddSegment("PRV") 'Speciality Segment
        Dim provider2010AALoop = provider2000AHLoop.AddLoop("NM1*85")
        provider2010AALoop.SetElement(2, "1") 'Person Entity
        provider2010AALoop.SetElement(3, "Doe") 'Last Name
        provider2010AALoop.SetElement(4, "John") 'First Name

        Dim provider2010ACLoop = provider2000AHLoop.AddLoop("NM1*PE")
        provider2010ACLoop.SetElement(2, "2") 'Person Entity
        provider2010ACLoop.SetElement(3, "Pay-To Plan Name")

        Dim provider2010AC_N3Segment = provider2010ACLoop.AddSegment("N3")
        provider2010AC_N3Segment.SetElement(1, "1234 Main St")

        Dim provider2010AC_N4Segment = provider2010ACLoop.AddSegment("N4")
        provider2010AC_N4Segment.SetElement(1, "Beverley Hills")
        provider2010AC_N4Segment.SetElement(2, "CA")
        provider2010AC_N4Segment.SetElement(3, "90210")


        Dim x12 = message.SerializeToX12(True)

        System.Diagnostics.Trace.Write(x12)

to produce the following message:

ISA*00*          *00*          *ZZ*9012345720000  *ZZ*9088877320000  *110730*1130*U*00501*000000001*1*P*:~
  GS*HC*901234572000*908887732000*20110730*1130*999999*X*005010X222~
    ST*837*0034*005010X222~
      BHT~
      NM1*41*2*My Submitter*First Name That Is > 25 Chars~
        PER*IC*My Contact*TE*18005555555~
      HL*1**20*1~
        PRV~
        NM1*85*1*Doe*John~
        NM1*PE*2*Pay-To Plan Name~
          N3*1234 Main St~
          N4*Beverley Hills*CA*90210~
    SE*11*0034~
  GE*1*999999~
IEA*1*000000001~

Coordinator
Jul 30, 2011 at 10:50 PM
Edited Jul 30, 2011 at 10:51 PM

I've made some syntax changes to make the code more readable by adding some strongly typed loops and segments:

        Dim message As New Interchange(DateTime.Now, 1, True)
        message.InterchangeSenderIdQualifier = "ZZ"
        message.InterchangeSenderId = "9012345720000"
        message.InterchangeReceiverIdQualifier = "ZZ"
        message.InterchangeReceiverId = "9088877320000"
        message.SetElement(12, "00501")

        Dim group = message.AddFunctionGroup("HC", DateTime.Now, 999999, "005010X222")
        group.ApplicationSendersCode = "901234572000"
        group.ApplicationReceiversCode = "908887732000"

        Dim transaction = group.AddTransaction("837", "0034")
        transaction.SetElement(3, "005010X222")
        Dim bhtSegment = transaction.AddSegment("BHT")

        Dim submitterLoop = transaction.AddLoop(New TypedLoopNM1("41")) 'Submitter Identifer Code
        submitterLoop.NM102_EntityTypeQualifier = EntityTypeQualifier.NonPersonEntity
        submitterLoop.NM103_NameLastOrOrganizationName = "My Submitter"
        submitterLoop.NM104_NameFirst = "First Name That Is > 25 Chars"

        Dim perSegment = submitterLoop.AddSegment(New TypedSegmentPER())
        perSegment.PER01_ContactFunctionCode = "IC" 'Information Contact Function Code
        perSegment.PER02_Name = "My Contact"
        perSegment.PER03_CommunicationNumberQualifier = CommunicationNumberQualifer.Telephone
        perSegment.PER04_CommunicationNumber = "18005555555" '

        Dim provider2000AHLoop = transaction.AddHLoop(1, "20", True) 'Information Source
        provider2000AHLoop.AddSegment("PRV") 'Speciality Segment
        Dim provider2010AALoop = provider2000AHLoop.AddLoop(New TypedLoopNM1("85"))
        provider2010AALoop.NM102_EntityTypeQualifier = EntityTypeQualifier.Person
        provider2010AALoop.NM103_NameLastOrOrganizationName = "Doe"
        provider2010AALoop.NM104_NameFirst = "John"

        Dim provider2010ACLoop = provider2000AHLoop.AddLoop(New TypedLoopNM1("PE"))
        provider2010ACLoop.NM102_EntityTypeQualifier = EntityTypeQualifier.NonPersonEntity
        provider2010ACLoop.NM103_NameLastOrOrganizationName = "Pay-To Plan Name"

        Dim provider2010AC_N3Segment = provider2010ACLoop.AddSegment(New TypedSegmentN3())
        provider2010AC_N3Segment.N301_AddressInformation = "1234 Main St"

        Dim provider2010AC_N4Segment = provider2010ACLoop.AddSegment(New TypedSegmentN4())
        provider2010AC_N4Segment.N401_CityName = "Beverley Hills"
        provider2010AC_N4Segment.N402_StateOrProvinceCode = "CA"
        provider2010AC_N4Segment.N403_PostalCode = "90210"


        Dim x12 = message.SerializeToX12(True)

        System.Diagnostics.Trace.Write(x12)

Let me know what you think.  The changes are in changeset "9359".  I am going to focus on the 5010 837 to clean up the specification and add more of these strongly typed classes.

Aug 1, 2011 at 10:46 PM

Thank you for corrections.

Moving ahead a found more problems

 

allocation error  
Dim NM1_2010BA = HL_2000B.AddLoop("NM1*IL")  
Dim PER_2010BA = NM1_2010BA.AddSegment("PER") PER_2010BA = Nothing
   
Dim NM1_2010CA = HL_2000C.AddLoop("NM1*QC")  
Dim PER_2010CA = NM1_2010CA.AddSegment("PER") PER_2010CA = Nothing
   
Dim NM1_2310C = CLM_2300.AddLoop("NM1*77")  
Dim PER_2310C = NM1_2310C.AddSegment("PER") PER_2310C = Nothing
   
Dim CLM_2300 = HL.AddLoop("CLM")  
Dim NM1_2310E = CLM_2300.AddLoop("NM1*PW") Loop NM1*PW could be added because it could not be found in the specification for CLM
Dim NM1_2310E = CLM_2300.AddLoop("NM1*45") Loop NM1*45 could be added because it could not be found in the specification for CLM
Dim SBR_2320 = CLM_2300.AddSegment("SBR") SBR_2320 = Nothing
Dim CAS_2320 = CLM_2300.AddSegment("CAS") CAS_2320 = Nothing
Dim OI_2320 = CLM_2300.AddSegment("OI") OI_2320 = Nothing
Dim MOA_2320 = CLM_2300.AddSegment("MOA") MOA_2320 = Nothing
Dim NM1_2330A = CLM_2300.AddLoop("NM1*IL") Loop NM1*IL could be added because it could not be found in the specification for CLM
Dim NM1_2330B = CLM_2300.AddLoop("NM1*PR") Loop NM1*PR could be added because it could not be found in the specification for CLM
Dim NM1_2330G = CLM_2300.AddLoop("NM1*85") Loop NM1*85 could be added because it could not be found in the specification for CLM

 

Please let me know if you need more details

thank you

Alex

Aug 2, 2011 at 10:40 PM

Hi,

I was able to correct some errors.

However I still need your help.

 

Code below gives me an errors

 

Dim NM1_2310C = CLM_2300.AddLoop("NM1*77")

Dim PER_2310C = NM1_2310C.AddSegment("PER")            PER_2310C = Nothing

           

Dim NM1_2330B = SBR_2320.AddLoop("NM1*PR")

Dim N3_2330B = NM1_2330B.AddSegment("N3")    N3_2330B = Nothing

Dim N4_2330B = NM1_2330B.AddSegment("N4")    N4_2330B = Nothing

 

Dim HI_1_2300 = CLM_2300.AddSegment("HI")

HI_1_2300.SetElement(11, “”))      

HI_1_2300.SetElement(12, “”)       index is out of range

 

Please advice

Thank you

 

Alex

 

Coordinator
Aug 4, 2011 at 2:46 PM

I am having traxine go through the 837P specification and make the necessary changes.  I will be adding unit tests this week to cover these scenarios.  We will probably have something ready by COB Monday.

We will we doing all three D, P and I in the next release mid August.  Which one's are you attempting to create?  I will also give you syntax so that you target one of these three.  The default specification for 837 is built to be able to parse any one of those three, but that means it doesn't necessary validate correctly if you want to make sure it meets one of those specifically.  Please let me know what your validation needs are.

Coordinator
Aug 7, 2011 at 3:23 PM

The issues have been resolved in changeset 9414.  The unit test that verifies it is here.

I will being creating release 2.2.0 next weekend which will carry these changes.  Let me know if you discover anything else that needs to make into the 2.2.0 release.

Aug 7, 2011 at 8:00 PM

Thanks so much for all your help. We will try this out on Monday.

Aug 7, 2011 at 8:00 PM


On Sun, Aug 7, 2011 at 10:23 AM, dstrubhar <notifications@codeplex.com> wrote:

From: dstrubhar

The issues have been resolved in changeset 9414. The unit test that verifies it is here.

I will being creating release 2.2.0 next weekend which will carry these changes. Let me know if you discover anything else that needs to make into the 2.2.0 release.

Read the full discussion online.

To add a post to this discussion, reply to this email (x12parser@discussions.codeplex.com)

To start a new discussion for this project, email x12parser@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Aug 10, 2011 at 9:37 PM

Thank you for your help.

I am still geting some errors

            Dim message As New Interchange(Today, 1, True)
            Dim group = message.AddFunctionGroup("HC", Today, 999999, "005010X222")
            Dim transaction = group.AddTransaction("837", "0034")
            Dim HL_2000C = transaction.AddHLoop(CStr(HLNum), "23", True)
            Dim CLM_2300 = HL_2000C.AddLoop(New TypedLoopCLM)
            Dim NM1_2310C = CLM_2300.AddLoop(New TypedLoopNM1("77"))

            Dim PER_2310C = NM1_2310C.AddSegment(New TypedSegmentPER)       '<<< error: PER_2310C = Nothing

            '-----------------------------------------------------------------------------------------------
            Dim SBR_2320 = CLM_2300.AddLoop(New TypedLoopSBR)
            Dim NM1_2330B = SBR_2320.AddLoop(New TypedLoopNM1("PR"))

            Dim N3_2330B = NM1_2330B.AddSegment(New TypedSegmentN3)         '<<< error: N3_2330B = Nothing
            Dim N4_2330B = NM1_2330B.AddSegment(New TypedSegmentN4)         '<<< error: N4_2330B = Nothing

please help

A.Brodsky

Coordinator
Aug 14, 2011 at 5:10 PM

Fixed in changeset 9477.

It appears that we didn't copy the latest changes to the claim specification into the patient hieararchical loop.  This should be fixed now.

Thank for your thorough testing of this specification.  I am very interested in getting this tool prepared for the 5010 switch in January, so anything else that you might be trying to implement, I will try and be very responsive in fixing any issues you find.