Esempio n. 1
0
        private void ParseClaimAck_11(string message)
        {
            message = this.InputFields(message,
                                       "A01A02A03A04A05A07A11B01B02G01G05G06G07G04G27G31G39" +
                                       "###G31G32" +                                                                                                        //Read field G32 the number of times equal to the value in G31.
                                       "G42");
            if (message == null)
            {
                return;                //error, but print what we have.
            }
            CCDField fieldG06 = this.GetFieldById("G06");

            if (fieldG06 == null)
            {
                return;                //error
            }
            if (fieldG06.format != "N")
            {
                MessageBox.Show(this.ToString() + "PrintClaimAck_11: Internal error, field G06 is not an integer");
                return;                                                  //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG06.valuestr); i++) //Input a list of sub-records.
            {
                message = this.InputFields(message, "F07G08");
                if (message == null)
                {
                    return;                    //error
                }
            }
            message = this.InputField(message, "G40");
        }
Esempio n. 2
0
        private void ParseEOB_v2_21(string message)
        {
            message = this.InputFields(message, "A01A02A03A04A05A07B01B02G01G03G04G27G09F06G10G11G28G29G30");
            CCDField fieldF06 = this.GetFieldById("F06");

            if (fieldF06 == null)
            {
                return;                //error
            }
            if (fieldF06.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParseEOB_v2_21: Internal error, field F06 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldF06.valuestr); i++)
            {
                message = this.InputFields(message, "F07G12G13G14G15G16G17");
            }
            CCDField fieldG10 = this.GetFieldById("G10");

            if (fieldG10 == null)
            {
                return;                //error
            }
            if (fieldG10.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParseEOB_v2_21: Internal error, field G10 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG10.valuestr); i++)
            {
                message = this.InputFields(message, "G18G19G20G21G22G23G24G25");
            }
            message = this.InputFields(message, "###G11G26");
        }
Esempio n. 3
0
        ///<summary>Throws exceptions.  Returns null if there is no embedded transaction.</summary>
        public CCDFieldInputter GetEmbeddedTransaction()
        {
            CCDField fieldG40 = GetFieldById("G40");

            if (fieldG40 != null)           //An embedded transaction exists.
            {
                return(new CCDFieldInputter(fieldG40.valuestr));
            }
            return(null);
        }
Esempio n. 4
0
        ///<summary>Used to read secondary eclaim data which has already been sent out to CDAnet for processing.
        ///Also used in the internal project CanadaFakeClearinghouse for testing basic eclaim functionality.</summary>
        private void ParseCobRequest_07(string message)
        {
            message = InputFields(message, "A01A02A03A04A05A06A10A07A08A09B01B02B03B04B05B06C01C11C02C17C03C04" +
                                  "C05C06C07C08C09C10C12C18D01D02D03D04D05D06D07D08D09D10D11E18E20F06F22G39");
            if (message == null)
            {
                return;                //error, but print what we have.
            }
            CCDField fieldE20 = GetFieldById("E20");
            int      e20Val   = 0;

            if (fieldE20 != null)
            {
                e20Val = Convert.ToInt32(fieldE20.valuestr);
            }
            if (e20Val == 1)
            {
                message = InputFields(message, "E19E01E02E05E03E17E06E04E08E09E10E11E12E13E14E15E16E07");
            }
            message = InputFields(message, "F01F02F03F15F04F18F19F05F20F21");
            CCDField fieldF22 = GetFieldById("F22");
            int      f22Val   = 0;

            if (fieldF22 != null)
            {
                f22Val = Convert.ToInt32(fieldF22.valuestr);
            }
            for (int i = 0; i < f22Val; i++)
            {
                message = InputFields(message, "F23F24");
            }
            CCDField fieldF06 = GetFieldById("F06");
            int      f06Val   = 0;

            if (fieldF06 != null)
            {
                f06Val = Convert.ToInt32(fieldF06.valuestr);
            }
            for (int i = 0; i < f06Val; i++)
            {
                message = InputFields(message, "F07F08F09F10F11F12F34F13F35F36F16F17");
            }
            CCDField fieldC18 = GetFieldById("C18");
            int      c18Val   = 0;

            if (fieldC18 != null)
            {
                c18Val = Convert.ToInt32(fieldC18.valuestr);
            }
            if (c18Val == 1)
            {
                message = InputFields(message, "C19");
            }
            message = this.InputField(message, "G40");
        }
Esempio n. 5
0
 ///<summary>Inputs fields based on a pseudo-script input string. This is possible, since each field id identifies a unique
 ///input pattern. If a field Id is seen, then that field is inputted, but if the ### sequence is encountered, then a field
 ///list is inputted based on the number in the next specified field, which has the format of the field after that. If the
 ///input string leads with a "#" followed by a 2 digit number, then the string is input that many times.</summary>
 public string InputFields(string message, string fieldOrderStr)
 {
     fieldOrderStr = fieldOrderStr.ToUpper();
     if (fieldOrderStr.Length % 3 != 0)
     {
         MessageBox.Show("Internal error, invalid field order string (not divisible by 3): " + fieldOrderStr);
         return(null);
     }
     if (fieldOrderStr.Length < 1)
     {
         return(message);
     }
     for (int i = 0; i < fieldOrderStr.Length; i += 3)
     {
         string token = fieldOrderStr.Substring(i, 3);
         if (token == "###")               //Input field value by field id, then input the value number of fields with the next template.
         {
             string valueFieldId = fieldOrderStr.Substring(i + 3, 3);
             if (valueFieldId == null || valueFieldId.Length != 3)
             {
                 MessageBox.Show("Internal error, invalid value field id in: " + fieldOrderStr);
                 return(null);
             }
             CCDField valueField = GetFieldById(valueFieldId);
             if (valueField == null)
             {
                 MessageBox.Show(this.ToString() + ".InputCCDFields: Internal error, could not locate value field '" + valueFieldId + "'");
                 return(null);
             }
             if (valueField.format != "N")
             {
                 MessageBox.Show(this.ToString() + ".InputCCDFields: Internal error, value field '" + valueFieldId + "' is not an integer");
                 return(null);
             }
             string listFieldId = fieldOrderStr.Substring(i + 6, 3);
             if (listFieldId == null || listFieldId.Length != 3)
             {
                 MessageBox.Show("Internal error, invalid field list id in: " + fieldOrderStr);
                 return(null);
             }
             i += 6;
             for (int p = 0; p < Convert.ToInt32(valueField.valuestr); p++)
             {
                 message = InputField(message, listFieldId);
             }
         }
         else                  //Input a single field.
         {
             message = InputField(message, token);
         }
     }
     return(message);
 }
Esempio n. 6
0
        private void ParsePredeterminationEOB_23(string message)
        {
            message = this.InputFields(message, "A01A02A03A04A05A07A11B01B02G01G04G27F06G10G11G28G29G30G39G42G46G47");
            CCDField fieldF06 = this.GetFieldById("F06");

            if (fieldF06 == null)
            {
                return;                //error, but return as much of the form as we were able to understand.
            }
            if (fieldF06.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParsePredeterminationEOB_23: Internal error, field F06 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldF06.valuestr); i++)
            {
                message = this.InputFields(message, "F07G12G13G14G15G43G56G57G58G02G59G60G61G16G17");
            }
            CCDField fieldG10 = this.GetFieldById("G10");

            if (fieldG10 == null)
            {
                return;                //error
            }
            if (fieldG10.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParsePredeterminationEOB_23: Internal error, field G10 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG10.valuestr); i++)
            {
                message = this.InputFields(message, "G18G19G20G44G21G22G23G24G25");
            }
            CCDField fieldG11 = this.GetFieldById("G11");

            if (fieldG11 == null)
            {
                return;                //error
            }
            if (fieldG11.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParsePredeterminationEOB_23: Internal error, field G11 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG11.valuestr); i++)
            {
                message = this.InputFields(message, "G41G45G26");
            }
            message = this.InputFields(message, "G40");
            return;
        }
Esempio n. 7
0
        private void ParseEOB_21(string message)
        {
            message = this.InputFields(message, "A01A02A03A04A05A07A11B01B02G01G03G04G27F06G10G11G28G29G30F01G33G55G39G42");
            CCDField fieldF06 = this.GetFieldById("F06");

            if (fieldF06 == null)
            {
                return;                //error
            }
            if (fieldF06.format != "N")
            {
                MessageBox.Show(this.ToString() + ".PrintEOB_21: Internal error, field F06 is not of integer type!");
                return;
            }
            for (int i = 0; i < Convert.ToInt32(fieldF06.valuestr); i++)
            {
                message = this.InputFields(message, "F07G12G13G14G15G43G56G57G58G02G59G60G61G16G17");
            }
            CCDField fieldG10 = this.GetFieldById("G10");

            if (fieldG10 == null)
            {
                return;                //error
            }
            if (fieldG10.format != "N")
            {
                MessageBox.Show(this.ToString() + ".PrintEOB_21: Internal error, field G10 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG10.valuestr); i++)
            {
                message = this.InputFields(message, "G18G19G20G44G21G22G23G24G25");
            }
            CCDField fieldG11 = this.GetFieldById("G11");

            if (fieldG11 == null)
            {
                return;                //error
            }
            if (fieldG11.format != "N")
            {
                MessageBox.Show(this.ToString() + ".PrintEOB_21: Internal error, field G11 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG11.valuestr); i++)
            {
                message = this.InputFields(message, "G41G45G26");
            }
            message = this.InputFields(message, "G40");
        }
Esempio n. 8
0
        private void ParsePredeterminationAck_v2_13(string message)
        {
            message = this.InputFields(message, "A01A02A03A04A05A07B01B02G01G05G06G07G02G04");
            CCDField fieldG06 = this.GetFieldById("G06");

            if (fieldG06 == null)
            {
                return;                //error
            }
            if (fieldG06.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParsePredeterminationAck_v2_13: Internal error, field G06 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG06.valuestr); i++)
            {
                message = this.InputFields(message, "F07G08");
            }
        }
Esempio n. 9
0
        private void ParseClaimRequest_v2_01(string message)
        {
            message = InputFields(message, "A01A02A03A04A05A06A07A08B01B02C01C11C02C03C04C05C06C07C08C09C10D01D02D03D04D05D06D07D08D09D10E01E02E05E03E04" +
                                  "F01F02F03F15F04F05F06");
            if (message == null)
            {
                return;                //error, but print what we have.
            }
            CCDField fieldF06 = GetFieldById("F06");
            int      f06Val   = 0;

            if (fieldF06 != null)
            {
                f06Val = Convert.ToInt32(fieldF06.valuestr);
            }
            for (int i = 0; i < f06Val; i++)
            {
                message = InputFields(message, "F07F08F09F10F11F12F13F14");
            }
        }
Esempio n. 10
0
        /// <summary>Input a single field.<summary>
        public string InputField(string message, string fieldId)
        {
            CCDField field = new CCDField(fieldId, isVersion2);
            int      len   = field.GetRequiredLength(this);

            if (len < 0 || message == null || message.Length < len)
            {
                return(null);
            }
            if (len == 0)
            {
                return(message);
            }
            string substr = message.Substring(0, len);

            //if(!field.CheckValue(this,substr)){
            //  throw new ApplicationException("Invalid value for CCD message field '"+field.fieldName+"'"+((substr==null)?"":(": "+substr)));
            //}
            field.valuestr = substr;
            fieldList.Add(field);
            return(message.Substring(substr.Length, message.Length - substr.Length));        //Skip text that has already been read in.
        }
Esempio n. 11
0
        /// <summary>Input a single field.<summary>
        public string InputField(string message, string fieldId)
        {
            CCDField field = new CCDField(fieldId, isVersion2);
            int      len   = field.GetRequiredLength(this);

            if (len >= 0 && message != null && message.Length < len) //The remainder of the message (the very last line) is shorter than the field.
            {
                if (fieldId == "G26")                                //Note Text
                //We have seen G26 coming back without trailing spaces and instead containing a newline.  G26 is supposed to be 75 chars padded right.
                //We have only seen this issue coming from the ITRANS clearinghouse with regards to the Accerta carrier 311140.
                {
                    len = message.Length;                  //Read the remainder of the message as the G26.
                    if (message.EndsWith("\n"))
                    {
                        len--;                        //Exclude the newline character, since we might not handle newlines properly elsewhere.
                    }
                }
                else                  //Not G26
                {
                    return(null);     //If another field, then we need to investigate before making a decision.  For now, the field is invalid.
                }
            }
            if (len < 0 || message == null || message.Length < len)
            {
                return(null);
            }
            if (len == 0)
            {
                return(message);
            }
            string substr = message.Substring(0, len);

            //if(!field.CheckValue(this,substr)){
            //  throw new ApplicationException("Invalid value for CCD message field '"+field.fieldName+"'"+((substr==null)?"":(": "+substr)));
            //}
            field.valuestr = substr;
            fieldList.Add(field);
            return(message.Substring(substr.Length, message.Length - substr.Length));        //Skip text that has already been read in.
        }
Esempio n. 12
0
        private void ParseReconciliaiton_15(string message)
        {
            message = this.InputFields(message, "A01A02A03A04A07A11B02G01G05G06G11G34G35G36G37G33");
            CCDField fieldG37 = this.GetFieldById("G37");

            if (fieldG37 == null)
            {
                return;                //error
            }
            if (fieldG37.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParseReconciliaiton_15: Internal error, field G37 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG37.valuestr); i++)
            {
                message = this.InputFields(message, "B01A05A02G01G38");
            }
            CCDField fieldG11 = this.GetFieldById("G11");

            if (fieldG11 == null)
            {
                return;                //error
            }
            if (fieldG11.format != "N")
            {
                MessageBox.Show(this.ToString() + ".ParseReconciliaiton_15: Internal error, field G11 is not of integer type!");
                return;                //error
            }
            for (int i = 0; i < Convert.ToInt32(fieldG11.valuestr); i++)
            {
                message = this.InputFields(message, "G41G26");
            }
            message = this.InputFields(message, "###G06G08");
            return;
        }
Esempio n. 13
0
 public CCDField[] GetLoadedFields()
 {
     CCDField[] loadedFields = new CCDField[fieldList.Count];
     fieldList.CopyTo(loadedFields);
     return(loadedFields);
 }
Esempio n. 14
0
        ///<summary>The result is a string which can be dropped into the insplan.BenefitNotes.  Or it might throw an exception if invalid data.  This class is also responsible for saving the returned message to the etrans table and printing out the required form.</summary>
        public static string SendElegibility(string electID, int patNum, string groupNumber, string divisionNo,
                                             string subscriberID, string patID, Relat patRelat, int subscNum, string dentaideCardSequence)
        {
            //Note: This might be the only class of this kind that returns a string.  It's a special situation.
            //We are simply not going to bother with language translation here.
            //determine carrier.
            Carrier carrier = Carriers.GetCanadian(electID);          //this also happens to validate missing or short value

            if (carrier == null)
            {
                throw new ApplicationException("Invalid carrier EDI code.");
            }
            Clearinghouse clearhouse = Canadian.GetClearinghouse();

            if (clearhouse == null)
            {
                throw new ApplicationException("Canadian clearinghouse not found.");
            }
            string saveFolder = clearhouse.ExportPath;

            if (!Directory.Exists(saveFolder))
            {
                throw new ApplicationException(saveFolder + " not found.");
            }
            //Initialize objects-----------------------------------------------------------------------------------------------
            Patient  patient    = Patients.GetPat(patNum);
            Patient  subscriber = Patients.GetPat(subscNum);
            Provider treatProv  = Providers.GetProv(Patients.GetProvNum(patient));
            Provider billProv   = Providers.GetProv(Providers.GetBillingProvNum(treatProv.ProvNum));
            //I had to use a dialog box to get the eligibility code.

            //validate any missing info----------------------------------------------------------------------------------
            string error = "";

            if (carrier.CanadianNetworkNum == 0)
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Carrier does not have network specified";
            }
            if (!Regex.IsMatch(carrier.ElectID, @"^[0-9]{6}$"))           //not necessary, but nice
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "CarrierId 6 digits";
            }
            if (treatProv.NationalProvID.Length != 9)
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "TreatingProv CDA num 9 digits";
            }
            if (treatProv.CanadianOfficeNum.Length != 4)
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "TreatingProv office num 4 char";
            }
            if (billProv.NationalProvID.Length != 9)
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "BillingProv CDA num 9 digits";
            }
            if (groupNumber.Length == 0 || groupNumber.Length > 12 || groupNumber.Contains(" "))
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Plan Number";
            }
            if (subscriberID == "")
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "SubscriberID";
            }
            if (patNum != subscNum && patRelat == Relat.Self)           //if patient is not subscriber, and relat is self
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Relationship cannot be self";
            }
            if (patient.Gender == PatientGender.Unknown)
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Patient gender";
            }
            if (patient.Birthdate.Year < 1880 || patient.Birthdate > DateTime.Today)
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Patient birthdate";
            }
            if (patient.LName == "")
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Patient lastname";
            }
            if (patient.FName == "")
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Patient firstname";
            }
            if (subscriber.Birthdate.Year < 1880 || subscriber.Birthdate > DateTime.Today)
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Subscriber birthdate";
            }
            if (subscriber.LName == "")
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Subscriber lastname";
            }
            if (subscriber.FName == "")
            {
                if (error != "")
                {
                    error += ", ";
                }
                error += "Subscriber firstname";
            }
            if (error != "")
            {
                throw new ApplicationException(error);
            }
            FormCanadianEligibility FormElig = new FormCanadianEligibility();

            FormElig.ShowDialog();
            if (FormElig.DialogResult != DialogResult.OK)
            {
                throw new ApplicationException("Eligibility Code or Date missing.");
            }
            //eligiblity code guaranteed to not be 0 at this point.  Also date will be between 1980 and 10 years from now.
            Etrans etrans = Etranss.CreateCanadianOutput(patNum, carrier.CarrierNum, carrier.CanadianNetworkNum,
                                                         clearhouse.ClearinghouseNum, EtransType.Eligibility_CA);
            string txt = "";

            //create message----------------------------------------------------------------------------------------------
            //A01 transaction prefix 12 AN
//todo
            txt += "123456789012";          //To be later provided by the individual network.
            //A02 office sequence number 6 N
            txt += Canadian.TidyN(etrans.OfficeSequenceNumber, 6);
            //A03 format version number 2 N
            txt += "04";
            //A04 transaction code 2 N
            txt += "08";            //eligibility
            //A05 carrier id number 6 N
            txt += carrier.ElectID; //already validated as 6 digit number.
            //A06 software system id 3 AN  The third character is for version of OD.
//todo
            txt += "OD1";          //To be later supplied by CDAnet staff to uniquely identify OD.
            //A10 encryption method 1 N
//todo
            txt += "1";
            //A07 message length 5 N
            int len = 214;

//todo does not account for C19. Possibly 30 more.
            //if(C19 is used, Plan Record){
            //len+=30;
            //}
            txt += Canadian.TidyN(len, 5);
            //A09 carrier transaction counter 5 N
            txt += Canadian.TidyN(etrans.CarrierTransCounter, 5);
            //B01 CDA provider number 9 AN
            txt += Canadian.TidyAN(treatProv.NationalProvID, 9);         //already validated
            //B02 (treating) provider office number 4 AN
            txt += Canadian.TidyAN(treatProv.CanadianOfficeNum, 4);      //already validated
            //B03 billing provider number 9 AN
//todo, need to account for possible 5 digit prov id assigned by carrier
            txt += Canadian.TidyAN(billProv.NationalProvID, 9);         //already validated
            //C01 primary policy/plan number 12 AN (group number)
            //only validated to ensure that it's not blank and is less than 12. Also that no spaces.
            txt += Canadian.TidyAN(groupNumber, 12);
            //C11 primary division/section number 10 AN
            txt += Canadian.TidyAN(divisionNo, 10);
            //C02 subscriber id number 12 AN
            txt += Canadian.TidyAN(subscriberID.Replace("-", ""), 12);        //validated
            //C17 primary dependant code 2 N. Optional
            txt += Canadian.TidyN(patID, 2);
            //C03 relationship code 1 N
            //User interface does not only show Canadian options, but all options are handled.
            txt += Canadian.GetRelationshipCode(patRelat);
            //C04 patient's sex 1 A
            //validated to not include "unknown"
            if (patient.Gender == PatientGender.Male)
            {
                txt += "M";
            }
            else
            {
                txt += "F";
            }
            //C05 patient birthday 8 N
            txt += patient.Birthdate.ToString("yyyyMMdd");          //validated
            //C06 patient last name 25 AE
            txt += Canadian.TidyAE(patient.LName, 25, true);        //validated
            //C07 patient first name 15 AE
            txt += Canadian.TidyAE(patient.FName, 15, true);        //validated
            //C08 patient middle initial 1 AE
            txt += Canadian.TidyAE(patient.MiddleI, 1);
            //C09 eligibility exception code 1 N
            txt += Canadian.TidyN(FormElig.EligibilityCode, 1);         //validated
            //C12 plan flag 1 A
//todo
            //might not be carrier.IsPMP.  Might have to do with plan, not carrier. See F17.
            txt += " ";
            //C18 plan record count 1 N
//todo
            txt += "0";
            //C16 Eligibility date. 8 N.
            txt += FormElig.AsOfDate.ToString("yyyyMMdd");          //validated
            //D01 subscriber birthday 8 N
            txt += subscriber.Birthdate.ToString("yyyyMMdd");       //validated
            //D02 subscriber last name 25 AE
            txt += Canadian.TidyAE(subscriber.LName, 25, true);     //validated
            //D03 subscriber first name 15 AE
            txt += Canadian.TidyAE(subscriber.FName, 15, true);     //validated
            //D04 subscriber middle initial 1 AE
            txt += Canadian.TidyAE(subscriber.MiddleI, 1);
            //D10 language of insured 1 A
            if (subscriber.Language == "fr")
            {
                txt += "F";
            }
            else
            {
                txt += "E";
            }
            //D11 card sequence/version number 2 N
//todo: Not validated against type of carrier yet.  Need to check if Dentaide.
            txt += Canadian.TidyN(dentaideCardSequence, 2);
//todo If C18=1, then the following field would appear
            //C19 plan record 30 AN
            string result = "";

            try {
                result = Canadian.PassToCCD(txt, carrier.CanadianNetworkNum, clearhouse);
            }
            catch (ApplicationException ex) {
                Etranss.Delete(etrans.EtransNum);
                throw new ApplicationException(ex.Message);
            }
            Etranss.SetMessage(etrans.EtransNum, txt);
            etrans.MessageText = txt;
            FormCCDPrint FormP = new FormCCDPrint(etrans);          //Print the form.

            FormP.ShowDialog();
            //Now we will process the 'result' here to extract the important data.  Basically Yes or No on the eligibility.
            //We might not do this for any other trans type besides eligibility.
            string           retVal        = "Eligibility check on " + DateTime.Today.ToShortDateString() + "\r\n";
            CCDFieldInputter fieldInputter = new CCDFieldInputter(result);
            CCDField         field         = fieldInputter.GetFieldById("G05");//response status

            //CCDFieldInputter could really use a GetValue(string fieldId) method so I don't have to use a field object.
            switch (field.valuestr)
            {
            case "E":
                retVal += "Patient is eligible.";
                break;

            case "R":
                retVal += "Patient not eligible, or error in data.";
                break;

            case "M":
                retVal += "Manual claimform should be submitted for employer certified plan.";
                break;
            }
            CCDField[] fields = fieldInputter.GetFieldsById("G08");          //Error Codes
            for (int i = 0; i < fields.Length; i++)
            {
                retVal += "\r\n";
                retVal += fields[i].valuestr;              //todo: need to turn this into a readable string.
            }
            fields = fieldInputter.GetFieldsById("G32");   //Display messages
            for (int i = 0; i < fields.Length; i++)
            {
                retVal += "\r\n";
                retVal += fields[i].valuestr;
            }
            return(retVal);
        }