Exemple #1
0
        public static string RunOne(bool showForms)
        {
            string  retVal  = "";
            long    provNum = ProviderC.ListShort[0].ProvNum;       //dentist #1
            Patient pat     = Patients.GetPat(PatientTC.PatNum1);   //patient#1

            if (pat.PriProv != provNum)
            {
                Patient oldPat = pat.Copy();
                pat.PriProv = provNum;              //this script uses the primary provider for the patient
                Patients.Update(pat, oldPat);
            }
            PatPlan patplan = PatPlans.GetPatPlan(pat.PatNum, 1);
            InsSub  sub     = InsSubs.GetOne(patplan.InsSubNum);
            InsPlan plan    = InsPlans.GetPlan(sub.PlanNum, new List <InsPlan>());
            //the UI would block this due to carrier not supporting this transaction type.
            Clearinghouse    clearinghouseHq   = Clearinghouses.GetDefaultDental();
            Clearinghouse    clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
            long             etransNum         = CanadianOutput.SendElegibility(clearinghouseClin, pat.PatNum, plan, new DateTime(1999, 1, 1), patplan.Relationship, patplan.PatID, showForms, sub);
            Etrans           etrans            = Etranss.GetEtrans(etransNum);
            string           message           = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData          = new CCDFieldInputter(message);
            string           responseStatus    = formData.GetValue("G05");

            if (responseStatus != "R")
            {
                throw new Exception("Should be R");
            }
            retVal += "Eligibility #1 successful.\r\n";
            return(retVal);
        }
Exemple #2
0
        public static string RunFour(bool showForms)
        {
            string  retVal  = "";
            long    provNum = ProviderC.ListShort[1].ProvNum;       //dentist #2
            Patient pat     = Patients.GetPat(PatientTC.PatNum6);   //patient#6

            if (pat.PriProv != provNum)
            {
                Patient oldPat = pat.Copy();
                pat.PriProv = provNum;              //this script uses the primary provider for the patient
                Patients.Update(pat, oldPat);
            }
            PatPlan          patplan        = PatPlans.GetPatPlan(pat.PatNum, 1);
            InsSub           sub            = InsSubs.GetOne(patplan.InsSubNum);
            InsPlan          plan           = InsPlans.GetPlan(sub.PlanNum, new List <InsPlan>());
            long             etransNum      = CanadianOutput.SendElegibility(pat.PatNum, plan, new DateTime(1999, 1, 1), patplan.Relationship, patplan.PatID, showForms, sub);
            Etrans           etrans         = Etranss.GetEtrans(etransNum);
            string           message        = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData       = new CCDFieldInputter(message);
            string           responseStatus = formData.GetValue("G05");

            if (responseStatus != "M")
            {
                throw new Exception("Should be M");
            }
            retVal += "Eligibility #4 successful.\r\n";
            return(retVal);
        }
Exemple #3
0
        public static string Run(int scriptNum, string responseExpected, string responseTypeExpected, Claim claim, bool showForms, int pageNumber, int lastPageNumber, double firstExamFee, double diagnosticPhaseFee)
        {
            string             retVal            = "";
            ClaimSendQueueItem queueItem         = Claims.GetQueueList(claim.ClaimNum, claim.ClinicNum, 0)[0];
            Clearinghouse      clearinghouseHq   = ClearinghouseL.GetClearinghouseHq(queueItem.ClearinghouseNum);
            Clearinghouse      clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);

            Eclaims.GetMissingData(clearinghouseClin, queueItem);           //,out warnings);
            if (queueItem.MissingData != "")
            {
                return("Cannot send predetermination until missing data is fixed:\r\n" + queueItem.MissingData + "\r\n");
            }
#if DEBUG
            Canadian.testNumber = scriptNum;
            claim.PreAuthString = "" + pageNumber + "," + lastPageNumber + "," + firstExamFee + "," + diagnosticPhaseFee;
#endif
            long             etransNum    = Canadian.SendClaim(clearinghouseClin, queueItem, showForms);
            Etrans           etrans       = Etranss.GetEtrans(etransNum);
            string           message      = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData     = new CCDFieldInputter(message);
            string           responseType = formData.GetValue("A04");
            if (responseType != responseTypeExpected)
            {
                return("Form type is '" + responseType + "' but should be '" + responseTypeExpected + "'\r\n");
            }
            string responseStatus = formData.GetValue("G05");
            if (responseStatus != responseExpected)
            {
                return("G05 is '" + responseStatus + "' but should be '" + responseExpected + "'\r\n");
            }
            if (responseExpected == "R" && responseTypeExpected == "11")
            {
                //so far, only for #6.  We need some other way to test if successful transaction
                string errorMsgCount = formData.GetValue("G06");
                if (errorMsgCount == "00")
                {
                    return("Wrong message count.\r\n");
                }
            }
            retVal += "Predetermination #" + scriptNum + " page " + pageNumber + " of " + lastPageNumber + " successful.\r\n";
            return(retVal);
        }
Exemple #4
0
        public static string Run(int scriptNum, string responseExpected, string responseTypeExpected, Claim claim, bool showForms)
        {
            string             retVal            = "";
            ClaimSendQueueItem queueItem         = Claims.GetQueueList(claim.ClaimNum, claim.ClinicNum, 0)[0];
            Clearinghouse      clearinghouseHq   = ClearinghouseL.GetClearinghouseHq(queueItem.ClearinghouseNum);
            Clearinghouse      clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);

            Eclaims.GetMissingData(clearinghouseClin, queueItem);           //,out warnings);
            if (queueItem.MissingData != "")
            {
                return("Cannot send claim until missing data is fixed:\r\n" + queueItem.MissingData + "\r\n");
            }
#if DEBUG
            Canadian.testNumber = scriptNum;
#endif
            long             etransNum    = Canadian.SendClaim(clearinghouseClin, queueItem, showForms);
            Etrans           etrans       = Etranss.GetEtrans(etransNum);
            string           message      = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData     = new CCDFieldInputter(message);
            string           responseType = formData.GetValue("A04");
            if (responseType != responseTypeExpected)
            {
                return("Form type should be " + responseTypeExpected + "\r\n");
            }
            string responseStatus = formData.GetValue("G05");
            if (responseStatus != responseExpected)
            {
                return("G05 should be " + responseExpected + "\r\n");
            }
            if (responseExpected == "R" && responseTypeExpected == "11")
            {
                //so far, only for #6.  We need some other way to test if successful transaction
                string errorMsgCount = formData.GetValue("G06");
                if (errorMsgCount == "00")
                {
                    return("Wrong message count.\r\n");
                }
            }
            retVal += "Claim #" + scriptNum.ToString() + " successful.\r\n";
            return(retVal);
        }
Exemple #5
0
        public static string Run(int scriptNum, string responseExpected, Claim claim)
        {
            string           retVal         = "";
            InsPlan          insPlan        = InsPlans.GetPlan(claim.PlanNum, null);
            InsSub           insSub         = InsSubs.GetOne(claim.InsSubNum);
            long             etransNum      = CanadianOutput.SendClaimReversal(claim, insPlan, insSub);
            Etrans           etrans         = Etranss.GetEtrans(etransNum);
            string           message        = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData       = new CCDFieldInputter(message);
            string           responseStatus = formData.GetValue("G05");

            if (responseStatus != responseExpected)
            {
                return("G05 should be " + responseExpected + "\r\n");
            }
            retVal += "Reversal #" + scriptNum.ToString() + " successful.\r\n";
            return(retVal);
        }
Exemple #6
0
        public static string Run(int scriptNum, string responseExpected, Claim claim)
        {
            string        retVal          = "";
            InsPlan       insPlan         = InsPlans.GetPlan(claim.PlanNum, null);
            InsSub        insSub          = InsSubs.GetOne(claim.InsSubNum);
            Carrier       carrier         = Carriers.GetCarrier(insPlan.CarrierNum);
            Clearinghouse clearinghouseHq =
                Clearinghouses.GetClearinghouse(Clearinghouses.AutomateClearinghouseHqSelection(carrier.ElectID, claim.MedType));
            Clearinghouse    clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
            long             etransNum         = CanadianOutput.SendClaimReversal(clearinghouseClin, claim, insPlan, insSub);
            Etrans           etrans            = Etranss.GetEtrans(etransNum);
            string           message           = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData          = new CCDFieldInputter(message);
            string           responseStatus    = formData.GetValue("G05");

            if (responseStatus != responseExpected)
            {
                return("G05 should be " + responseExpected + "\r\n");
            }
            retVal += "Reversal #" + scriptNum.ToString() + " successful.\r\n";
            return(retVal);
        }