Eligibility Benefit Inquiry and Response (270/271)

Sep 18, 2014 at 5:56 PM
Edited Sep 18, 2014 at 5:56 PM
Hi All,
I want to develop below features :
  1. Create 270 Request which is byte encoded and a web service method is called to send the request.
  2. Parse 271 Response which the web service responds to the 270 request stating the error if there is in the request and the 271 response if the request is error free
  3. The 271 response is byte decoded and parsed to display the eligibility information on the web page
Can somebody help me on this? Mainly on decoding 271 response part....
Dec 3, 2014 at 4:59 PM
Edited Dec 3, 2014 at 5:00 PM
Were you able to use this X12 Parser for your needs?

I see Create270Test in C:\Projects\OopFactory\src\trunk\tests\OopFactory.X12.Tests.Unit\DocumentationCodeSamples\X12InterchangeModel\ReadingAnExistingX12File.cs

How did you create your 270 request?
Dec 4, 2014 at 11:52 AM
Hi GaltSalt,

public class Generate270
{
    const string _MsgVersion = "005010X279A1";

    //Parse the X12 string to XML for processing
    X12Parser parser = new X12Parser();
    Interchange ichg270Msg;
    FunctionGroup ichgFuncGrp;
    Transaction _270trans;

    public static string GenerateTestMsg(IList<string> lstInput)
    {
        string[] arrInputStr = lstInput.ToArray();
        DateTime curDateTime = DateTime.Now;           
        string _senderID = "V139534        ";
        string _receiverID = "89070";
        int controlNo = 789;

        //Parse the X12 string to XML for processing
        X12Parser parser = new X12Parser();
        Interchange ichg270Msg;
        FunctionGroup ichgFuncGrp;
        Transaction _270trans;


        //Set the ISA Segment
        ichg270Msg = new Interchange(curDateTime, controlNo, false);
        ichg270Msg.InterchangeSenderIdQualifier = "ZZ";
        ichg270Msg.InterchangeSenderId = _senderID;
        ichg270Msg.InterchangeReceiverIdQualifier = "ZZ";
        ichg270Msg.InterchangeReceiverId = _receiverID;
        ichg270Msg.SetElement(12, "00501");                         //EDI Version
        ichg270Msg.SetElement(15, "P");
        ichg270Msg.SetElement(16, ":");

        ichgFuncGrp = ichg270Msg.AddFunctionGroup("HS", curDateTime, 1, _MsgVersion);
        ichgFuncGrp.ApplicationSendersCode = _senderID;
        ichgFuncGrp.ApplicationReceiversCode = _receiverID;
        ichgFuncGrp.ControlNumber = controlNo;

        //Create new function group for this message
        _270trans = ichgFuncGrp.AddTransaction("270", controlNo.ToString().Length < 4 ? controlNo.ToString().PadLeft(4, '0') : controlNo.ToString());

        //Add BHT Segment
        Segment segBHT = _270trans.AddSegment("BHT");
        segBHT.SetElement(1, "0022");
        segBHT.SetElement(2, "13");                                     //13 = request identification
        segBHT.SetElement(3, controlNo.ToString());
        segBHT.SetElement(4, curDateTime.ToString("yyyyMMdd"));
        segBHT.SetElement(5, curDateTime.ToString("HHmm"));

        //Add Hierarchical Loop 2000A - payer source
        HierarchicalLoop hl2000A = _270trans.AddHLoop("1", "20", true);

        //Identifier eligibility or benefit information source 
        //Loop 2100A
        Loop payer2100A = hl2000A.AddLoop("NM1*PR*2");                  //PR = Payer, 2 = Non-Person
        payer2100A.SetElement(3, "UNITED CONCORDIA");
        payer2100A.SetElement(8, "PI"); //Federal Tax ID                                
        payer2100A.SetElement(9, _receiverID); //Indicates next field is payoer ID

        //Add Hierarchical Loop 2000B - Provider
        HierarchicalLoop hl2000B = hl2000A.AddHLoop("2", "21", true);
        //Loop 2100B*
        Loop receiverSource = hl2000B.AddLoop("NM1*1P*1");      //1P = Provider, 1 = Person
        receiverSource.SetElement(3, "Walnut Creek Dental Group and Orthodontics, LLP");
        receiverSource.SetElement(4, "Rodgers"); 
        receiverSource.SetElement(8, "XX"); //FNATIONAL PROVIDER ID  
        receiverSource.SetElement(9, "1487891305");// NPI Information Receiver Identification Number
        receiverSource.AddSegment("REF*" + "TJ*" + "262948041");// Provider's TIN
        //receiverSource.AddSegment("REF*" + "Q4*" + "BK9111840");           


        //Add Hierarchical Loop 2000C - subscriber information
        HierarchicalLoop hl2000C = hl2000B.AddHLoop("3", "22", true);
        //TRN*1*171107529*9CT EXAMPLE*TRADINGPARTNER
        Segment segTRN = hl2000C.AddSegment("TRN");
        segTRN.SetElement(1,"1");
        segTRN.SetElement(2, "171107529");
        segTRN.SetElement(3, "1234567890");

        //Add trace number?
        Loop subscriber = hl2000C.AddLoop("NM1*IL*1");          //1P = Provider, 1 = Person
        subscriber.SetElement(3, "STRITZEL"); //PatientLN arrInputStr[1]
        subscriber.SetElement(4, "CHELSEA"); //PatientFN
        subscriber.SetElement(8, "MI");
        subscriber.SetElement(9, "117702881001"); //SSN number or Subscriber id
        subscriber.AddSegment("N3*" + "9098 W 88TH CIR");        //could add line 2 here as well
        subscriber.AddSegment(string.Format("N4*{0}*{1}*{2}", "WESTMINSTER", "CO", "80021"));//Subscriber City Name/State Code/Postal Zone or ZIP Code
        subscriber.AddSegment("DMG*D8*" + "19900215"); //Date of Birth arrInputStr[2]
        subscriber.AddSegment("DTP*291*D8*" + "20141006"); //Date of Appointmante/Service //Might need to make sure this has value! arrInputStr[7]
        subscriber.AddLoop("EQ*" + "35");              //Information Request

        string results = ichg270Msg.SerializeToX12(true);
        return results;
        //System.Diagnostics.Debug.WriteLine(results);
    }
}
Dec 4, 2014 at 2:46 PM
Edited Dec 4, 2014 at 7:14 PM
Wow - I'll review this and see how it matches up. We just bought the 5010 schema, but I assume that you've already validated against that. I'll need to update areas for my trading partner details, and it should be ok... I'll let you know.



Thank you!