示例#1
0
        public void Claims_ValidatePOBoxAddress()
        {
            List <string> listValidPOBox = new List <string> {
                "PO Box 12345",
                "P O box 12345",
                "P. O. Box 12345",
                "P.O.Box 12345",
                "post box 12345",
                "post office box 12345",
                "P.O.B 12345",
                "P.O.B. 12345",
                "Post Box #12345",
                "Postal Box 12345",
                "P.O. Box 12345",
                "PO. Box 12345",
                "P.o box 12345",
                "Pobox 12345",
                "p.o. Box12345",
                "po-box12345",
                "p.o.-box 12345",
                "PO-Box 12345",
                "p-o-box 12345",
                "p-o box 12345",
                "box 12345",
                "Box12345",
                "Box-12345"
            };
            List <string> listInValidPOBox = new List <string> {
                "12345 Tapo Cannon Rd.",
                "12345 Tapo 1st Ave",
                "12345 Box Turtle Circle",
                "12345 Boxing Pass",
                "12345 Poblano Lane",
                "12345 P O Davis Drive",
                "12345 P O Boxing Drive",
                "12345 PO Boxing Drive",
                "12345 Postal Circle"
            };

            foreach (string address in listValidPOBox)
            {
                if (!X837_5010.HasPOBox(address))
                {
                    Assert.Fail(address);
                }
            }
            foreach (string address in listInValidPOBox)
            {
                if (X837_5010.HasPOBox(address))
                {
                    Assert.Fail(address);
                }
            }
        }
示例#2
0
 private void FormEtransEdit_Load(object sender, EventArgs e)
 {
     MessageText            = EtransMessageTexts.GetMessageText(EtransCur.EtransMessageTextNum);
     textMessageText.Text   = MessageText;
     textDateTimeTrans.Text = EtransCur.DateTimeTrans.ToString();
     textClaimNum.Text      = EtransCur.ClaimNum.ToString();
     textBatchNumber.Text   = EtransCur.BatchNumber.ToString();
     textTransSetNum.Text   = EtransCur.TransSetNum.ToString();
     textAckCode.Text       = EtransCur.AckCode;
     textNote.Text          = EtransCur.Note;
     if (EtransCur.Etype == EtransType.ClaimSent)
     {
         if (X12object.IsX12(MessageText))
         {
             X12object x12obj = new X12object(MessageText);
             if (x12obj.IsFormat4010())
             {
                 X837_4010 x837 = new X837_4010(MessageText);
                 checkAttachments.Checked = x837.AttachmentsWereSent(EtransCur.ClaimNum);                      //This function does not currently work, so the corresponding checkbox is hidden on the form as well.
             }
             else if (x12obj.IsFormat5010())
             {
                 X837_5010 x837 = new X837_5010(MessageText);
                 checkAttachments.Checked = x837.AttachmentsWereSent(EtransCur.ClaimNum);                      //This function does not currently work, so the corresponding checkbox is hidden on the form as well.
             }
         }
     }
     if (EtransCur.AckEtransNum > 0)
     {
         AckCur = Etranss.GetEtrans(EtransCur.AckEtransNum);
         if (AckCur != null)
         {
             textAckMessage.Text  = EtransMessageTexts.GetMessageText(AckCur.EtransMessageTextNum);
             textAckDateTime.Text = AckCur.DateTimeTrans.ToString();
             textAckNote.Text     = AckCur.Note;
         }
     }
     else
     {
         AckCur           = null;
         groupAck.Visible = false;
     }
     if (!CultureInfo.CurrentCulture.Name.EndsWith("CA"))             //Not Canadian.
     {
         butPrintAck.Visible = false;
     }
 }
示例#3
0
        ///<summary>Fills the missing data field on the queueItem that was passed in.  This contains all missing data on this claim.  Claim will not be allowed to be sent electronically unless this string comes back empty.</summary>
        public static void GetMissingData(ClaimSendQueueItem queueItem)         //, out string warnings){
        {
            queueItem.Warnings    = "";
            queueItem.MissingData = "";
            Clearinghouse clearhouse = ClearinghouseL.GetClearinghouse(queueItem.ClearinghouseNum, true);         //Suppress error message in case no default medical clearinghouse set.

            //this is usually just the default clearinghouse or the clearinghouse for the PayorID.
            if (clearhouse == null)
            {
                if (queueItem.MedType == EnumClaimMedType.Dental)
                {
                    queueItem.MissingData += "No default dental clearinghouse set.";
                }
                else
                {
                    queueItem.MissingData += "No default medical/institutional clearinghouse set.";
                }
                return;
            }
            if (clearhouse.Eformat == ElectronicClaimFormat.x837D_4010)
            {
                X837_4010.Validate(queueItem);                //,out warnings);
                //return;
            }
            else if (clearhouse.Eformat == ElectronicClaimFormat.x837D_5010_dental ||
                     clearhouse.Eformat == ElectronicClaimFormat.x837_5010_med_inst)
            {
                X837_5010.Validate(queueItem);                //,out warnings);
                //return;
            }
            else if (clearhouse.Eformat == ElectronicClaimFormat.Renaissance)
            {
                queueItem.MissingData = Renaissance.GetMissingData(queueItem);
                //return;
            }
            else if (clearhouse.Eformat == ElectronicClaimFormat.Canadian)
            {
                queueItem.MissingData = Canadian.GetMissingData(queueItem);
                //return;
            }
            else if (clearhouse.Eformat == ElectronicClaimFormat.Dutch)
            {
                Dutch.GetMissingData(queueItem);                //,out warnings);
                //return;
            }
            //return "";
        }
示例#4
0
        ///<summary>Called from Eclaims and includes multiple claims.  Returns the string that was sent.
        ///The string needs to be parsed to determine the transaction numbers used for each claim.</summary>
        public static string SendBatch(Clearinghouse clearinghouseClin, List <ClaimSendQueueItem> queueItems, int batchNum, EnumClaimMedType medType,
                                       bool isAutomatic)
        {
            //each batch is already guaranteed to be specific to one clearinghouse, one clinic, and one EnumClaimMedType
            //Clearinghouse clearhouse=ClearinghouseL.GetClearinghouse(queueItems[0].ClearinghouseNum);
            string saveFile = GetFileName(clearinghouseClin, batchNum, isAutomatic);

            if (saveFile == "")
            {
                return("");
            }
            string messageText = "";

            using (MemoryStream ms = new MemoryStream()) {
                using (StreamWriter sw = new StreamWriter(ms)) {
                    if (clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_4010)
                    {
                        X837_4010.GenerateMessageText(sw, clearinghouseClin, batchNum, queueItems);
                    }
                    else                      //Any of the 3 kinds of 5010
                    {
                        X837_5010.GenerateMessageText(sw, clearinghouseClin, batchNum, queueItems, medType);
                    }
                    sw.Flush();                    //Write contents of sw into ms.
                    ms.Position = 0;               //Reset position to 0, or else the StreamReader below will not read anything.
                    using (StreamReader sr = new StreamReader(ms, Encoding.ASCII)) {
                        messageText = sr.ReadToEnd();
                    }
                }
            }
            if (clearinghouseClin.IsClaimExportAllowed)
            {
                if (clearinghouseClin.CommBridge == EclaimsCommBridge.PostnTrack)
                {
                    //need to clear out all CRLF from entire file
                    messageText = messageText.Replace("\r", "");
                    messageText = messageText.Replace("\n", "");
                }
                File.WriteAllText(saveFile, messageText, Encoding.ASCII);
                CopyToArchive(saveFile);
            }
            return(messageText);
        }
示例#5
0
        ///<summary>Helper method for SendBatch that generates the X837 messagetext. This method is public as it is used in ClaimConnect.cs</summary>
        public static string GenerateBatch(Clearinghouse clearinghouseClin, List <ClaimSendQueueItem> queueItems, int batchNum, EnumClaimMedType medType)
        {
            string messageText = "";

            using (MemoryStream ms = new MemoryStream()) {
                using (StreamWriter sw = new StreamWriter(ms)) {
                    if (clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_4010)
                    {
                        X837_4010.GenerateMessageText(sw, clearinghouseClin, batchNum, queueItems);
                    }
                    else                      //Any of the 3 kinds of 5010
                    {
                        X837_5010.GenerateMessageText(sw, clearinghouseClin, batchNum, queueItems, medType);
                    }
                    sw.Flush();                    //Write contents of sw into ms.
                    ms.Position = 0;               //Reset position to 0, or else the StreamReader below will not read anything.
                    using (StreamReader sr = new StreamReader(ms, Encoding.ASCII)) {
                        messageText = sr.ReadToEnd();
                    }
                }
            }
            return(messageText);
        }
示例#6
0
        ///<summary>Called from Eclaims and includes multiple claims.  Returns the string that was sent.  The string needs to be parsed to determine the transaction numbers used for each claim.</summary>
        public static string SendBatch(List <ClaimSendQueueItem> queueItems, int batchNum, Clearinghouse clearhouse, EnumClaimMedType medType)
        {
            //each batch is already guaranteed to be specific to one clearinghouse, one clinic, and one EnumClaimMedType
            //Clearinghouse clearhouse=ClearinghouseL.GetClearinghouse(queueItems[0].ClearinghouseNum);
            string saveFile = GetFileName(clearhouse, batchNum);

            if (saveFile == "")
            {
                return("");
            }
            using (StreamWriter sw = new StreamWriter(saveFile, false, Encoding.ASCII)){
                if (clearhouse.Eformat == ElectronicClaimFormat.x837D_4010)
                {
                    X837_4010.GenerateMessageText(sw, clearhouse, batchNum, queueItems);
                }
                else                  //Any of the 3 kinds of 5010
                {
                    X837_5010.GenerateMessageText(sw, clearhouse, batchNum, queueItems, medType);
                }
            }
            if (clearhouse.CommBridge == EclaimsCommBridge.PostnTrack)
            {
                //need to clear out all CRLF from entire file
                string strFile = "";
                using (StreamReader sr = new StreamReader(saveFile, Encoding.ASCII)){
                    strFile = sr.ReadToEnd();
                }
                strFile = strFile.Replace("\r", "");
                strFile = strFile.Replace("\n", "");
                using (StreamWriter sw = new StreamWriter(saveFile, false, Encoding.ASCII)){
                    sw.Write(strFile);
                }
            }
            CopyToArchive(saveFile);
            return(File.ReadAllText(saveFile));
        }
示例#7
0
 ///<summary>Fills the missing data field on the queueItem that was passed in.  This contains all missing data on this claim.  Claim will not be allowed to be sent electronically unless this string comes back empty.</summary>
 public static ClaimSendQueueItem GetMissingData(Clearinghouse clearinghouseClin, ClaimSendQueueItem queueItem)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetObject <ClaimSendQueueItem>(MethodBase.GetCurrentMethod(), clearinghouseClin, queueItem));
     }
     queueItem.Warnings    = "";
     queueItem.MissingData = "";
     //this is usually just the default clearinghouse or the clearinghouse for the PayorID.
     if (clearinghouseClin == null)
     {
         if (queueItem.MedType == EnumClaimMedType.Dental)
         {
             queueItem.MissingData += "No default dental clearinghouse set.";
         }
         else
         {
             queueItem.MissingData += "No default medical/institutional clearinghouse set.";
         }
         return(queueItem);
     }
     #region Data Sanity Checking (for Replication)
     //Example: We had one replication customer who was able to delete an insurance plan for which was attached to a claim.
     //Imagine two replication servers, server A and server B.  An insplan is created which is not associated to any claims.
     //Both databases have a copy of the insplan.  The internet connection is lost.  On server A, a user deletes the insurance
     //plan (which is allowed because no claims are attached).  On server B, a user creates a claim with the insurance plan.
     //When the internet connection returns, the delete insplan statement is run on server B, which then creates a claim with
     //an invalid InsPlanNum on server B.  Without the checking below, the send claims window would crash for this one scenario.
     Claim   claim   = Claims.GetClaim(queueItem.ClaimNum); //This should always exist, because we just did a select to get the queue item.
     InsPlan insPlan = InsPlans.RefreshOne(claim.PlanNum);
     if (insPlan == null)                                   //Check for missing PlanNums
     {
         queueItem.MissingData = Lans.g("Eclaims", "Claim insurance plan record missing.  Please recreate claim.");
         return(queueItem);
     }
     if (claim.InsSubNum2 != 0)
     {
         InsPlan insPlan2 = InsPlans.RefreshOne(claim.PlanNum2);
         if (insPlan2 == null)               //Check for missing PlanNums
         {
             queueItem.MissingData = Lans.g("Eclaims", "Claim other insurance plan record missing.  Please recreate claim.");
             return(queueItem);                   //This will let the office send other claims that passed validation without throwing an exception.
         }
     }
     #endregion Data Sanity Checking (for Replication)
     if (clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_4010)
     {
         X837_4010.Validate(clearinghouseClin, queueItem);               //,out warnings);
         //return;
     }
     else if (clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_5010_dental ||
              clearinghouseClin.Eformat == ElectronicClaimFormat.x837_5010_med_inst)
     {
         X837_5010.Validate(clearinghouseClin, queueItem);               //,out warnings);
         //return;
     }
     else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Renaissance)
     {
         queueItem.MissingData = Renaissance.GetMissingData(queueItem);
         //return;
     }
     else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Canadian)
     {
         queueItem.MissingData = Canadian.GetMissingData(queueItem);
         //return;
     }
     else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Dutch)
     {
         Dutch.GetMissingData(queueItem);                //,out warnings);
         //return;
     }
     else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Ramq)
     {
         Ramq.GetMissingData(queueItem);
     }
     return(queueItem);
 }