コード例 #1
0
        ///<summary></summary>
        public static Clearinghouse CreateClearinghouse(string description, long clinicNum = 0, EclaimsCommBridge commBridge = EclaimsCommBridge.None,
                                                        ElectronicClaimFormat eFormat      = ElectronicClaimFormat.None, long hqClearinghouseNum = 0, bool isAttachmentSendAllowed = false, string loginID = "", string password = "",
                                                        string isa05 = "", string isa07 = "", string isa08 = "", string isa15 = "")
        {
            Clearinghouse clearinghouse = new Clearinghouse()
            {
                Description             = description,
                ClinicNum               = clinicNum,
                CommBridge              = commBridge,
                Eformat                 = eFormat,
                HqClearinghouseNum      = hqClearinghouseNum,
                IsAttachmentSendAllowed = isAttachmentSendAllowed,
                LoginID                 = loginID,
                Password                = password,
                ISA05 = isa05,
                ISA07 = isa07,
                ISA08 = isa08,
                ISA15 = isa15
            };

            Clearinghouses.Insert(clearinghouse);            //Automatically sets HqClearinghouseNum.
            if (hqClearinghouseNum > 0)
            {
                clearinghouse.HqClearinghouseNum = hqClearinghouseNum;
                Clearinghouses.Update(clearinghouse);
            }
            Clearinghouses.RefreshCache();
            return(clearinghouse);
        }
コード例 #2
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;

            try{
                messageText = GenerateBatch(clearinghouseClin, queueItems, batchNum, medType);
            }
            catch (ODException odex) {
                MessageBox.Show(odex.Message, "x837");
                return("");
            }
            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", "");
                }
                if (ODBuild.IsWeb())
                {
                    try {
                        ODCloudClient.ExportClaim(saveFile, messageText, doOverwriteFile: clearinghouseClin.CommBridge != EclaimsCommBridge.RECS);
                    }
                    catch (ODException odEx) {
                        if (odEx.ErrorCodeAsEnum == ODException.ErrorCodes.FileExists && clearinghouseClin.CommBridge == EclaimsCommBridge.RECS)
                        {
                            MessageBox.Show(RECSFileExistsMsg, "x837");
                        }
                        else
                        {
                            MessageBox.Show(odEx.Message, "x837");
                        }
                        if (odEx.ErrorCodeAsEnum != ODException.ErrorCodes.ClaimArchiveFailed)                       //If archiving failed, we can continue with sending.
                        {
                            return("");
                        }
                    }
                    catch (Exception ex) {
                        MessageBox.Show(ex.Message, "x837");
                        return("");
                    }
                }
                else
                {
                    File.WriteAllText(saveFile, messageText, Encoding.ASCII);
                    CopyToArchive(saveFile);
                }
            }
            return(messageText);
        }
コード例 #3
0
ファイル: x837Controller.cs プロジェクト: royedwards/DRDNet
        ///<summary>Gets the filename for this batch. Used when saving or when rolling back.</summary>
        private static string GetFileName(Clearinghouse clearinghouseClin, int batchNum, bool isAutomatic)         //called from this.SendBatch. Clinic-level clearinghouse passed in.
        {
            string saveFolder = clearinghouseClin.ExportPath;

            if (!Directory.Exists(saveFolder))
            {
                if (!isAutomatic)
                {
                    MessageBox.Show(saveFolder + " not found.");
                }
                return("");
            }
            if (clearinghouseClin.CommBridge == EclaimsCommBridge.RECS)
            {
                if (File.Exists(ODFileUtils.CombinePaths(saveFolder, "ecs.txt")))
                {
                    if (!isAutomatic)
                    {
                        MessageBox.Show(Lans.g("FormClaimsSend", "You must send your existing claims from the RECS program before you can create another batch."));
                    }
                    return("");                   //prevents overwriting an existing ecs.txt.
                }
                return(ODFileUtils.CombinePaths(saveFolder, "ecs.txt"));
            }
            else
            {
                return(ODFileUtils.CombinePaths(saveFolder, "claims" + batchNum.ToString() + ".txt"));
            }
        }
コード例 #4
0
        ///<summary>Attempts to request benefits.  If successful the 270 request is returned.
        ///Otherwise null is returned and the out error string will contain more information.  Mimics FormInsPlan.butGetElectronic_Click().</summary>
        public static Etrans TryInsVerifyRequest(InsVerify insVerify, InsPlan insPlan, Carrier carrier, InsSub insSub, out string error)
        {
            error = "";
            Etrans        etrans270Request = null;
            Clearinghouse clearinghouseHq  = Clearinghouses.GetDefaultEligibility();

            if (clearinghouseHq == null)
            {
                error = "No clearinghouse is set as default.";
                return(null);
            }
            if (!clearinghouseHq.CommBridge.In(EclaimsCommBridge.ClaimConnect, EclaimsCommBridge.EDS, EclaimsCommBridge.WebMD))
            {
                error = "So far, eligibility checks only work with ClaimConnect, EDS, WebMD (Emdeon Dental), and CDAnet.";
                return(null);
            }
            error = X271.ValidateSettings();
            if (error.IsNullOrEmpty())
            {
                Clearinghouse clearinghouse = Clearinghouses.OverrideFields(clearinghouseHq, insVerify.ClinicNum);             //ClinicNum pulled from appointment.
                try {
                    //Can return null, can throw exceptions
                    etrans270Request = x270Controller.RequestBenefits(clearinghouse, insPlan, insVerify.PatNum, carrier, insSub, out error);
                }
                catch (Exception ex) {
                    error = ex.Message;
                }
            }
            return(etrans270Request);
        }
コード例 #5
0
        ///<summary>Gets the filename for this batch. Used when saving or when rolling back.</summary>
        private static string GetFileName(Clearinghouse clearinghouseClin, int batchNum, bool isAutomatic)         //called from this.SendBatch. Clinic-level clearinghouse passed in.
        {
            string saveFolder = clearinghouseClin.ExportPath;

            if (!ODBuild.IsWeb() && !Directory.Exists(saveFolder))
            {
                if (!isAutomatic)
                {
                    MessageBox.Show(saveFolder + " not found.");
                }
                return("");
            }
            if (clearinghouseClin.CommBridge == EclaimsCommBridge.RECS)
            {
                if (!ODBuild.IsWeb() && File.Exists(ODFileUtils.CombinePaths(saveFolder, "ecs.txt")))
                {
                    if (!isAutomatic)
                    {
                        MessageBox.Show(RECSFileExistsMsg);
                    }
                    return("");                   //prevents overwriting an existing ecs.txt.
                }
                return(ODFileUtils.CombinePaths(saveFolder, "ecs.txt"));
            }
            else
            {
                return(ODFileUtils.CombinePaths(saveFolder, "claims" + batchNum.ToString() + ".txt"));
            }
        }
コード例 #6
0
        public void Clearinghouses_UpdateOverridesForClinic_UpdateAllDuplicateOverrideRows()
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            Clinic clinic     = ClinicT.CreateClinic(methodName);
            //Insert a default clearinghouse that is not associated to any clinics.  This will be used as the "HqClearinghouseNum" for creating duplicate overrides later.
            Clearinghouse clearinghouseHQ = ClearinghouseT.CreateClearinghouse(methodName);
            //Insert two blank Clearinghouse override rows associated to the same clinic into the DB to mimic the real life duplicate row issue.
            Clearinghouse clearinghouseOverride1 = ClearinghouseT.CreateClearinghouse(methodName, clinic.ClinicNum, EclaimsCommBridge.ClaimConnect,
                                                                                      ElectronicClaimFormat.x837D_5010_dental, clearinghouseHQ.HqClearinghouseNum, false, "test", "pass");
            Clearinghouse clearinghouseOverride2 = ClearinghouseT.CreateClearinghouse(methodName, clinic.ClinicNum, EclaimsCommBridge.ClaimConnect,
                                                                                      ElectronicClaimFormat.x837D_5010_dental, clearinghouseHQ.HqClearinghouseNum, false, "test", "pass");
            //Get all override rows from the DB
            List <Clearinghouse> listClearinghouseOverrides = Clearinghouses.GetAllNonHq();
            //Mimic the user making some changes to one of the overrides which was causing issues prior to the UpdateOverridesForClinic() paradigm.
            string passwordNew = "Password1!";

            clearinghouseOverride2.Password = passwordNew;
            //FormClearinghouseEdit manipulates the clearinghouses in memory first but then calls the following method to "sync" all overrides before calling the clearinghouse sync.
            Clearinghouses.SyncOverridesForClinic(ref listClearinghouseOverrides, clearinghouseOverride2);
            //Check that both rows had their values updated to the Clearinghouse override's values.
            Clearinghouse co1 = listClearinghouseOverrides.First(x => x.ClearinghouseNum == clearinghouseOverride1.ClearinghouseNum);
            Clearinghouse co2 = listClearinghouseOverrides.First(x => x.ClearinghouseNum == clearinghouseOverride2.ClearinghouseNum);

            Assert.AreEqual(passwordNew, co1.Password);
            Assert.AreEqual(passwordNew, co2.Password);
        }
コード例 #7
0
 ///<summary>Inserts one Clearinghouse into the database.  Returns the new priKey.</summary>
 internal static long Insert(Clearinghouse clearinghouse)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         clearinghouse.ClearinghouseNum = DbHelper.GetNextOracleKey("clearinghouse", "ClearinghouseNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(clearinghouse, true));
             }
             catch (Oracle.DataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     clearinghouse.ClearinghouseNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(clearinghouse, false));
     }
 }
コード例 #8
0
        ///<summary>Inserts this clearinghouse into database.</summary>
        public static void Insert(Clearinghouse clearhouse)
        {
            string command = "INSERT INTO clearinghouse (Description,ExportPath,IsDefault,Payors"
                             + ",Eformat,ISA05,SenderTIN,ISA07,ISA08,ISA15,Password,ResponsePath,CommBridge,ClientProgram,"
                             + "LastBatchNumber,ModemPort,LoginID,SenderName,SenderTelephone,GS03) VALUES("
                             + "'" + POut.PString(clearhouse.Description) + "', "
                             + "'" + POut.PString(clearhouse.ExportPath) + "', "
                             + "'" + POut.PBool(clearhouse.IsDefault) + "', "
                             + "'" + POut.PString(clearhouse.Payors) + "', "
                             + "'" + POut.PInt((int)clearhouse.Eformat) + "', "
                             + "'" + POut.PString(clearhouse.ISA05) + "', "
                             + "'" + POut.PString(clearhouse.SenderTIN) + "', "
                             + "'" + POut.PString(clearhouse.ISA07) + "', "
                             + "'" + POut.PString(clearhouse.ISA08) + "', "
                             + "'" + POut.PString(clearhouse.ISA15) + "', "
                             + "'" + POut.PString(clearhouse.Password) + "', "
                             + "'" + POut.PString(clearhouse.ResponsePath) + "', "
                             + "'" + POut.PInt((int)clearhouse.CommBridge) + "', "
                             + "'" + POut.PString(clearhouse.ClientProgram) + "', "
                             + "'0', "  //LastBatchNumber
                             + "'" + POut.PInt(clearhouse.ModemPort) + "', "
                             + "'" + POut.PString(clearhouse.LoginID) + "', "
                             + "'" + POut.PString(clearhouse.SenderName) + "', "
                             + "'" + POut.PString(clearhouse.SenderTelephone) + "', "
                             + "'" + POut.PString(clearhouse.GS03) + "')";

            General.NonQ(command);
        }
コード例 #9
0
ファイル: ClearinghouseCrud.cs プロジェクト: mnisl/OD
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<Clearinghouse> TableToList(DataTable table){
			List<Clearinghouse> retVal=new List<Clearinghouse>();
			Clearinghouse clearinghouse;
			for(int i=0;i<table.Rows.Count;i++) {
				clearinghouse=new Clearinghouse();
				clearinghouse.ClearinghouseNum= PIn.Long  (table.Rows[i]["ClearinghouseNum"].ToString());
				clearinghouse.Description     = PIn.String(table.Rows[i]["Description"].ToString());
				clearinghouse.ExportPath      = PIn.String(table.Rows[i]["ExportPath"].ToString());
				clearinghouse.Payors          = PIn.String(table.Rows[i]["Payors"].ToString());
				clearinghouse.Eformat         = (OpenDentBusiness.ElectronicClaimFormat)PIn.Int(table.Rows[i]["Eformat"].ToString());
				clearinghouse.ISA05           = PIn.String(table.Rows[i]["ISA05"].ToString());
				clearinghouse.SenderTIN       = PIn.String(table.Rows[i]["SenderTIN"].ToString());
				clearinghouse.ISA07           = PIn.String(table.Rows[i]["ISA07"].ToString());
				clearinghouse.ISA08           = PIn.String(table.Rows[i]["ISA08"].ToString());
				clearinghouse.ISA15           = PIn.String(table.Rows[i]["ISA15"].ToString());
				clearinghouse.Password        = PIn.String(table.Rows[i]["Password"].ToString());
				clearinghouse.ResponsePath    = PIn.String(table.Rows[i]["ResponsePath"].ToString());
				clearinghouse.CommBridge      = (OpenDentBusiness.EclaimsCommBridge)PIn.Int(table.Rows[i]["CommBridge"].ToString());
				clearinghouse.ClientProgram   = PIn.String(table.Rows[i]["ClientProgram"].ToString());
				clearinghouse.LastBatchNumber = PIn.Int   (table.Rows[i]["LastBatchNumber"].ToString());
				clearinghouse.ModemPort       = PIn.Byte  (table.Rows[i]["ModemPort"].ToString());
				clearinghouse.LoginID         = PIn.String(table.Rows[i]["LoginID"].ToString());
				clearinghouse.SenderName      = PIn.String(table.Rows[i]["SenderName"].ToString());
				clearinghouse.SenderTelephone = PIn.String(table.Rows[i]["SenderTelephone"].ToString());
				clearinghouse.GS03            = PIn.String(table.Rows[i]["GS03"].ToString());
				clearinghouse.ISA02           = PIn.String(table.Rows[i]["ISA02"].ToString());
				clearinghouse.ISA04           = PIn.String(table.Rows[i]["ISA04"].ToString());
				clearinghouse.ISA16           = PIn.String(table.Rows[i]["ISA16"].ToString());
				clearinghouse.SeparatorData   = PIn.String(table.Rows[i]["SeparatorData"].ToString());
				clearinghouse.SeparatorSegment= PIn.String(table.Rows[i]["SeparatorSegment"].ToString());
				retVal.Add(clearinghouse);
			}
			return retVal;
		}
コード例 #10
0
        ///<summary></summary>
        public static void Update(Clearinghouse clearhouse)
        {
            string command = "UPDATE clearinghouse SET "
                             + "Description = '" + POut.PString(clearhouse.Description) + "' "
                             + ",ExportPath = '" + POut.PString(clearhouse.ExportPath) + "' "
                             + ",IsDefault = '" + POut.PBool(clearhouse.IsDefault) + "' "
                             + ",Payors = '" + POut.PString(clearhouse.Payors) + "' "
                             + ",Eformat = '" + POut.PInt((int)clearhouse.Eformat) + "' "
                             + ",ISA05 = '" + POut.PString(clearhouse.ISA05) + "' "
                             + ",SenderTIN = '" + POut.PString(clearhouse.SenderTIN) + "' "
                             + ",ISA07 = '" + POut.PString(clearhouse.ISA07) + "' "
                             + ",ISA08 = '" + POut.PString(clearhouse.ISA08) + "' "
                             + ",ISA15 = '" + POut.PString(clearhouse.ISA15) + "' "
                             + ",Password = '******' "
                             + ",ResponsePath = '" + POut.PString(clearhouse.ResponsePath) + "' "
                             + ",CommBridge = '" + POut.PInt((int)clearhouse.CommBridge) + "' "
                             + ",ClientProgram ='" + POut.PString(clearhouse.ClientProgram) + "' "
                             //LastBatchNumber
                             + ",ModemPort ='" + POut.PInt(clearhouse.ModemPort) + "' "
                             + ",LoginID ='" + POut.PString(clearhouse.LoginID) + "' "
                             + ",SenderName = '" + POut.PString(clearhouse.SenderName) + "' "
                             + ",SenderTelephone='" + POut.PString(clearhouse.SenderTelephone) + "' "
                             + ",GS03 = '" + POut.PString(clearhouse.GS03) + "' "
                             + "WHERE ClearinghouseNum = '" + POut.PInt(clearhouse.ClearinghouseNum) + "'";

            General.NonQ(command);
        }
コード例 #11
0
        ///<summary></summary>
        public static void Delete(Clearinghouse clearhouse)
        {
            string command = "DELETE FROM clearinghouse "
                             + "WHERE ClearinghouseNum = '" + POut.PInt(clearhouse.ClearinghouseNum) + "'";

            General.NonQ(command);
        }
コード例 #12
0
ファイル: ClearinghouseCrud.cs プロジェクト: nampn/ODental
 ///<summary>Inserts one Clearinghouse into the database.  Returns the new priKey.</summary>
 internal static long Insert(Clearinghouse clearinghouse)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         clearinghouse.ClearinghouseNum=DbHelper.GetNextOracleKey("clearinghouse","ClearinghouseNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(clearinghouse,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     clearinghouse.ClearinghouseNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(clearinghouse,false);
     }
 }
コード例 #13
0
ファイル: NHS.cs プロジェクト: royedwards/DRDNet
        ///<summary>Returns true if the communications were successful, and false if they failed. If they failed, a rollback will happen automatically by deleting the previously created FP17 file. The batchnum is supplied for the possible rollback.</summary>
        public static bool Launch(Clearinghouse clearinghouseClin, int batchNum)         //called from Eclaims.cs. Clinic-level clearinghouse passed in.
        {
            bool retVal = true;


            return(retVal);
        }
コード例 #14
0
ファイル: EDS.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Attempts to retrieve an End of Day report from EDS.
        ///No need to pass in a date as this web call, when clearinghouseClin.IsEraDownloadAllowed is enabled,
        ///will retrieve an 835 containing all data since last called.</summary>
        public static bool Retrieve835s(Clearinghouse clearinghouseClin, IODProgressExtended progress)
        {
            if (clearinghouseClin.IsEraDownloadAllowed == EraBehaviors.None)
            {
                return(true);
            }
            progress = progress ?? new ODProgressExtendedNull();
            progress.UpdateProgress(Lans.g(progress.LanThis, "Contacting web server and downloading reports"), "reports", "40%", 40);
            if (progress.IsPauseOrCancel())
            {
                progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                return(false);
            }
            progress.UpdateProgress(Lans.g(progress.LanThis, "Downloading ERAs"), "reports", "50%", 50);
            if (progress.IsPauseOrCancel())
            {
                progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                return(false);
            }
            bool retVal = Retrieve835s(clearinghouseClin);

            if (retVal)
            {
                progress.UpdateProgress(Lans.g(progress.LanThis, "Retrieved 835s successfully."));
            }
            else
            {
                progress.UpdateProgress(Lans.g(progress.LanThis, "Retrieving 835s was unsuccessful."));
            }
            return(retVal);
        }
コード例 #15
0
ファイル: Eligibility.cs プロジェクト: royedwards/DRDNet
        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);
        }
コード例 #16
0
        ///<summary>Returns true if the communications were successful, and false if they failed. If they failed, a rollback will happen automatically by deleting the previously created FP17 file. The batchnum is supplied for the possible rollback.</summary>
        public static bool Launch(Clearinghouse clearhouse, int batchNum)
        {
            bool retVal = true;


            return(retVal);
        }
コード例 #17
0
        public void Clearinghouses_UpdateOverridesForClinic_UpdateOneOfMultiple()
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            Clinic clinic     = ClinicT.CreateClinic(methodName);
            //Insert a default clearinghouse that is not associated to any clinics.  This will be used as the "HqClearinghouseNum" for creating duplicate overrides later.
            Clearinghouse clearinghouseHQClaimConnect = ClearinghouseT.CreateClearinghouse(methodName, commBridge: EclaimsCommBridge.ClaimConnect);
            //Insert two blank Clearinghouse override rows associated to the same clinic into the DB to mimic the real life duplicate row issue.
            Clearinghouse clearinghouseOverrideClaimConnect1 = ClearinghouseT.CreateClearinghouse(methodName, clinic.ClinicNum, EclaimsCommBridge.ClaimConnect,
                                                                                                  ElectronicClaimFormat.x837D_5010_dental, clearinghouseHQClaimConnect.HqClearinghouseNum, false, "test", "pass");
            Clearinghouse clearinghouseOverrideClaimConnect2 = ClearinghouseT.CreateClearinghouse(methodName, clinic.ClinicNum, EclaimsCommBridge.ClaimConnect,
                                                                                                  ElectronicClaimFormat.x837D_5010_dental, clearinghouseHQClaimConnect.HqClearinghouseNum, false, "test", "pass");
            //Make another HQ clearinghouse that is meant for a different eClaims comm bridge to make sure that all overrides associated to this clearinghouse do not change.
            Clearinghouse clearinghouseHQAOS = ClearinghouseT.CreateClearinghouse(methodName, commBridge: EclaimsCommBridge.AOS);
            //Insert two blank Clearinghouse override rows associated to the same clinic into the DB to mimic the real life duplicate row issue.
            Clearinghouse clearinghouseOverrideAOS = ClearinghouseT.CreateClearinghouse(methodName, clinic.ClinicNum, EclaimsCommBridge.AOS,
                                                                                        ElectronicClaimFormat.x837D_5010_dental, clearinghouseHQAOS.HqClearinghouseNum, false, "test", "pass");
            //Get all override rows from the DB
            List <Clearinghouse> listClearinghouseOverrides = Clearinghouses.GetAllNonHq();
            //Mimic the user making some changes to one of the overrides which was causing issues prior to the UpdateOverridesForClinic() paradigm.
            string passwordNew = "Password1!";

            clearinghouseOverrideClaimConnect2.Password = passwordNew;
            //FormClearinghouseEdit manipulates the clearinghouses in memory first but then calls the following method to "sync" all overrides before calling the clearinghouse sync.
            Clearinghouses.SyncOverridesForClinic(ref listClearinghouseOverrides, clearinghouseOverrideClaimConnect2);
            //Check that both rows had their values updated to the Clearinghouse override's values.
            Assert.IsFalse(listClearinghouseOverrides.All(x => x.Password == passwordNew));
        }
コード例 #18
0
        ///<summary>Updates one Clearinghouse in the database.</summary>
        internal static void Update(Clearinghouse clearinghouse)
        {
            string command = "UPDATE clearinghouse SET "
                             + "Description     = '" + POut.String(clearinghouse.Description) + "', "
                             + "ExportPath      = '" + POut.String(clearinghouse.ExportPath) + "', "
                             + "Payors          = '" + POut.String(clearinghouse.Payors) + "', "
                             + "Eformat         =  " + POut.Int((int)clearinghouse.Eformat) + ", "
                             + "ISA05           = '" + POut.String(clearinghouse.ISA05) + "', "
                             + "SenderTIN       = '" + POut.String(clearinghouse.SenderTIN) + "', "
                             + "ISA07           = '" + POut.String(clearinghouse.ISA07) + "', "
                             + "ISA08           = '" + POut.String(clearinghouse.ISA08) + "', "
                             + "ISA15           = '" + POut.String(clearinghouse.ISA15) + "', "
                             + "Password        = '******', "
                             + "ResponsePath    = '" + POut.String(clearinghouse.ResponsePath) + "', "
                             + "CommBridge      =  " + POut.Int((int)clearinghouse.CommBridge) + ", "
                             + "ClientProgram   = '" + POut.String(clearinghouse.ClientProgram) + "', "
                             //LastBatchNumber excluded from update
                             + "ModemPort       =  " + POut.Byte(clearinghouse.ModemPort) + ", "
                             + "LoginID         = '" + POut.String(clearinghouse.LoginID) + "', "
                             + "SenderName      = '" + POut.String(clearinghouse.SenderName) + "', "
                             + "SenderTelephone = '" + POut.String(clearinghouse.SenderTelephone) + "', "
                             + "GS03            = '" + POut.String(clearinghouse.GS03) + "', "
                             + "ISA02           = '" + POut.String(clearinghouse.ISA02) + "', "
                             + "ISA04           = '" + POut.String(clearinghouse.ISA04) + "', "
                             + "ISA16           = '" + POut.String(clearinghouse.ISA16) + "', "
                             + "SeparatorData   = '" + POut.String(clearinghouse.SeparatorData) + "', "
                             + "SeparatorSegment= '" + POut.String(clearinghouse.SeparatorSegment) + "' "
                             + "WHERE ClearinghouseNum = " + POut.Long(clearinghouse.ClearinghouseNum);

            Db.NonQ(command);
        }
コード例 #19
0
        private void butDefaultMedical_Click(object sender, EventArgs e)
        {
            if (gridMain.GetSelectedIndex() == -1)
            {
                MsgBox.Show(this, "Please select a row first.");
                return;
            }
            Clearinghouse ch = _listClearinghousesHq[gridMain.GetSelectedIndex()];

            if (ch.Eformat != ElectronicClaimFormat.x837_5010_med_inst)          //anything except the med/inst format
            {
                MsgBox.Show(this, "The selected clearinghouse must first be set to the med/inst e-claim format.");
                return;
            }
            bool isInvalid = false;

            if (!CultureInfo.CurrentCulture.Name.EndsWith("CA") &&
                PrefC.GetLong(PrefName.ClearinghouseDefaultEligibility) == 0 &&
                Prefs.UpdateLong(PrefName.ClearinghouseDefaultEligibility, ch.ClearinghouseNum))
            {
                isInvalid = true;
            }
            if (Prefs.UpdateLong(PrefName.ClearinghouseDefaultMed, ch.ClearinghouseNum))
            {
                isInvalid = true;
            }
            if (isInvalid)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            FillGrid();
        }
コード例 #20
0
ファイル: EmdeonMedical.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Returns true if the communications were successful, and false if they failed. If they failed, a rollback will happen automatically by deleting the previously created X12 file. The batchnum is supplied for the possible rollback.  Also used for mail retrieval.</summary>
        public static bool Launch(Clearinghouse clearinghouseClin, int batchNum, EnumClaimMedType medType)        //called from Eclaims.cs. Clinic-level clearinghouse passed in.
        {
            string batchFile = "";

            try {
                if (!Directory.Exists(clearinghouseClin.ExportPath))
                {
                    throw new ODException("Clearinghouse export path is invalid.");
                }
                //We make sure to only send the X12 batch file for the current batch, so that if there is a failure, then we know
                //for sure that we need to reverse the batch. This will also help us avoid any exterraneous/old batch files in the
                //same directory which might be left if there is a permission issue when trying to delete the batch files after processing.
                batchFile = Path.Combine(clearinghouseClin.ExportPath, "claims" + batchNum + ".txt");
                //byte[] fileBytes=File.ReadAllBytes(batchFile);//unused
                MemoryStream zipMemoryStream = new MemoryStream();
                ZipFile      tempZip         = new ZipFile();
                tempZip.AddFile(batchFile, "");
                tempZip.Save(zipMemoryStream);
                tempZip.Dispose();
                zipMemoryStream.Position = 0;
                byte[] zipFileBytes       = zipMemoryStream.GetBuffer();
                string zipFileBytesBase64 = Convert.ToBase64String(zipFileBytes);
                zipMemoryStream.Dispose();
                bool   isTest      = (clearinghouseClin.ISA15 == "T");
                string messageType = (isTest?"MCT":"MCD");              //medical
                if (medType == EnumClaimMedType.Institutional)
                {
                    messageType = (isTest?"HCT":"HCD");
                }
                else if (medType == EnumClaimMedType.Dental)
                {
                    //messageType=(isTest?"DCT":"DCD");//not used/tested yet, but planned for future.
                }
                EmdeonITS.ITSWS itsws = new EmdeonITS.ITSWS();
                itsws.Url = (isTest?emdeonITSUrlTest:emdeonITSUrl);
                EmdeonITS.ItsReturn response = itsws.PutFileExt(clearinghouseClin.LoginID, clearinghouseClin.Password, messageType, Path.GetFileName(batchFile), zipFileBytesBase64);
                if (response.ErrorCode != 0)                //Batch submission successful.
                {
                    throw new ODException("Emdeon rejected all claims in the current batch file " + batchFile + ". Error number from Emdeon: " + response.ErrorCode + ". Error message from Emdeon: " + response.Response);
                }
            }
            catch (Exception e) {
                ErrorMessage = e.Message;
                x837Controller.Rollback(clearinghouseClin, batchNum);
                return(false);
            }
            finally {
                try {
                    if (batchFile != "")
                    {
                        File.Delete(batchFile);
                    }
                }
                catch {
                    ErrorMessage = "Failed to remove batch file" + batchFile + ". Probably due to a permission issue.  Check folder permissions and manually delete.";
                }
            }
            return(true);
        }
コード例 #21
0
 ///<summary>Returns true if the communications were successful, and false if they failed.</summary>
 public static bool Launch(Clearinghouse clearinghouseClin, int batchNum)
 {
     ErrorMessage = "Not implemented.";
     //TODO: Part 2 - Send ZIP file to RAMQ web service.  Upload the ZIP file to
     //https://www4.prod.ramq.gouv.qc.ca/RFP/RFP_ServSysRemuAct/NM/NMA_RecvrDem/NMA5_GereEchgElctrB2B_svc/ServGereEchgElctrB2B.svc
     //using HTTPS.  See ClaimConnect.cs for an example.
     return(true);
 }
コード例 #22
0
        ///<summary>Sends an X12 270 request and returns X12 271 response or an error message.</summary>
        public static string Benefits270(Clearinghouse clearinghouseClin, string x12message)         //called from x270Controller. Clinic-level clearinghouse passed in.
        {
            string retVal = "";

            try {
                HttpWebRequest webReq;
                WebResponse    webResponseXml;
                //Production URL.  For testing, set username to 'test' and password to 'test'.
                //When the username and password are both set to 'test', the X12 270 request will be ignored and just the transmission will be verified.
                webReq             = (HttpWebRequest)WebRequest.Create("https://web2.edsedi.com/eds/Transmit_Request");
                webReq.KeepAlive   = false;
                webReq.Method      = "POST";
                webReq.ContentType = "text/xml";
                string postDataXml = "<?xml version=\"1.0\" encoding=\"us-ascii\"?>"
                                     + "<content>"
                                     + "<header>"
                                     + "<userId>" + clearinghouseClin.LoginID + "</userId>"
                                     + "<pass>" + clearinghouseClin.Password + "</pass>"
                                     + "<process>transmitEligibility</process>"
                                     + "<version>1</version>"
                                     + "</header>"
                                     + "<body>"
                                     + "<type>EDI</type>"                  //Can only be EDI
                                     + "<data><![CDATA[" + x12message.Replace("\r\n", "").Replace("\n", "") + "]]></data>"
                                     + "<returnType>EDI</returnType>"      //Can be EDI, HTML, or EDI.HTML, but should mimic the above type
                                     + "</body>"
                                     + "</content>";
                ASCIIEncoding encoding      = new ASCIIEncoding();
                byte[]        arrayXmlBytes = encoding.GetBytes(postDataXml);
                Stream        streamOut     = webReq.GetRequestStream();
                streamOut.Write(arrayXmlBytes, 0, arrayXmlBytes.Length);
                streamOut.Close();
                webResponseXml = webReq.GetResponse();
                //Process the response
                StreamReader readStream  = new StreamReader(webResponseXml.GetResponseStream(), Encoding.ASCII);
                string       responseXml = readStream.ReadToEnd();
                readStream.Close();
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(responseXml);
                XmlNode nodeErrorCode = xmlDoc.SelectSingleNode(@"content/body/ERROR_CODE");
                if (nodeErrorCode != null && nodeErrorCode.InnerText.ToString() != "0")
                {
                    throw new Exception("Error Code: " + nodeErrorCode.InnerText + " - " + xmlDoc.SelectSingleNode(@"content/body/ERROR_MSG").InnerText.ToString());
                }
                nodeErrorCode = xmlDoc.SelectSingleNode(@"content/error/code");
                if (nodeErrorCode != null && nodeErrorCode.InnerText != "0")
                {
                    throw new Exception("Error Code: " + nodeErrorCode.InnerText + " - " + xmlDoc.SelectSingleNode(@"content/error/description").InnerText);
                }
                retVal = xmlDoc.SelectSingleNode(@"content/body/ediData").InnerText.ToString();
            }
            catch (Exception e) {
                retVal = e.Message;
            }
            return(retVal);
        }
コード例 #23
0
ファイル: ClearinghouseL.cs プロジェクト: kjb7749/testImport
        ///<summary>Returns the clearinghouse specified by the given num.  Will only return an HQ-level clearinghouse.
        ///Do not attempt to pass in a clinic-level clearinghouseNum.  Can return null if no match found.</summary>
        public static Clearinghouse GetClearinghouseHq(long hqClearinghouseNum, bool suppressError)
        {
            Clearinghouse clearinghouse = Clearinghouses.GetClearinghouse(hqClearinghouseNum);

            if (clearinghouse == null && !suppressError)
            {
                MsgBox.Show("Clearinghouses", "Error. Could not locate Clearinghouse.");
            }
            return(clearinghouse);
        }
コード例 #24
0
        private static string Run(int scriptNum, Carrier carrier, CanadianNetwork network, Provider prov, out Etrans etrans, DateTime reconciliationDate)
        {
            string        retVal            = "";
            Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(carrier);
            Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);

            etrans  = CanadianOutput.GetSummaryReconciliation(clearinghouseClin, carrier, network, prov, reconciliationDate);
            retVal += "Summary Reconciliation#" + scriptNum.ToString() + " successful.\r\n";
            return(retVal);
        }
コード例 #25
0
        private static string Run(int scriptNum, Carrier carrier, Provider treatProv, Provider billingProv, DateTime reconciliationDate, out List <Etrans> etransAcks)
        {
            string        retVal            = "";
            Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(carrier);
            Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);

            etransAcks = CanadianOutput.GetPaymentReconciliations(clearinghouseClin, carrier, treatProv, billingProv, reconciliationDate, 0);
            retVal    += "Payment Reconciliation#" + scriptNum.ToString() + " successful.\r\n";
            return(retVal);
        }
コード例 #26
0
        private static string Run(int scriptNum, bool version2, bool sendToItrans, Carrier carrier, out List <Etrans> etransRequests)
        {
            string        retVal            = "";
            Provider      prov              = Providers.GetProv(PrefC.GetLong(PrefName.PracticeDefaultProv));
            Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(carrier);
            Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);

            etransRequests = CanadianOutput.GetOutstandingTransactions(clearinghouseClin, version2, sendToItrans, carrier, prov, false);
            retVal        += "Outstanding Transactions#" + scriptNum.ToString() + " successful.\r\n";
            return(retVal);
        }
コード例 #27
0
ファイル: WebMD.cs プロジェクト: nampn/ODental
        ///<summary>Returns true if the communications were successful, and false if they failed. If they failed, a rollback will happen automatically by deleting the previously created X12 file. The batchnum is supplied for the possible rollback.  Also used for mail retrieval.</summary>
        public static bool Launch(Clearinghouse clearhouse, int batchNum)
        {
            string arguments = "";

            try{
                if (!Directory.Exists(clearhouse.ExportPath))
                {
                    throw new Exception("Clearinghouse export path is invalid.");
                }
                if (!Directory.Exists(clearhouse.ResponsePath))
                {
                    throw new Exception("Clearinghouse response path is invalid.");
                }
                if (!File.Exists(clearhouse.ClientProgram))
                {
                    throw new Exception("Client program not installed properly.");
                }
                arguments = ODFileUtils.RemoveTrailingSeparators(clearhouse.ExportPath) + "\\" + "*.* " //upload claims path
                            + ODFileUtils.RemoveTrailingSeparators(clearhouse.ResponsePath) + " "       //Mail path
                            + "316 "                                                                    //vendor number.
                            + clearhouse.LoginID + " "                                                  //Client number. Assigned by us, and we have to coordinate for all other 'vendors' of Open Dental, because there is only one vendor number for OD for now.
                            + clearhouse.Password;
                //call the WebMD client program
                Process process = Process.Start(clearhouse.ClientProgram, arguments);
                process.EnableRaisingEvents = true;
                process.WaitForExit();
                //delete the uploaded claims
                string[] files = Directory.GetFiles(clearhouse.ExportPath);
                for (int i = 0; i < files.Length; i++)
                {
                    //string t=files[i];
                    File.Delete(files[i]);
                }
                //rename the downloaded mail files to end with txt
                files = Directory.GetFiles(clearhouse.ResponsePath);
                for (int i = 0; i < files.Length; i++)
                {
                    //string t=files[i];
                    if (Path.GetExtension(files[i]) != ".txt")
                    {
                        File.Move(files[i], files[i] + ".txt");
                    }
                }
            }
            catch (Exception e) {
                MessageBox.Show(e.Message);                //+"\r\n"+clearhouse.ClientProgram+" "+arguments);
                if (batchNum != 0)
                {
                    x837Controller.Rollback(clearhouse, batchNum);
                }
                return(false);
            }
            return(true);
        }
コード例 #28
0
 ///<summary>Returns true if the communications were successful, and false if they failed.</summary>
 public static bool Launch(Clearinghouse clearinghouseClin, int batchNum)         //called from Eclaims.cs. Clinic-level clearinghouse passed in.
 {
     try {
         ODFileUtils.ProcessStart(clearinghouseClin.ClientProgram, doWaitForODCloudClientResponse: true);
     }
     catch (Exception ex) {
         //X12.Rollback(clearhouse,batchNum);//doesn't actually do anything
         ErrorMessage = ex.Message;
         return(false);
     }
     return(true);
 }
コード例 #29
0
ファイル: x837Controller.cs プロジェクト: royedwards/DRDNet
 ///<summary>If file creation was successful but communications failed, then this deletes the X12 file.  This is not used in the Tesia bridge because of the unique filenaming.</summary>
 public static void Rollback(Clearinghouse clearinghouseClin, int batchNum)         //called from various eclaims classes. Clinic-level clearinghouse passed in.
 {
     if (clearinghouseClin.CommBridge == EclaimsCommBridge.RECS)
     {
         //A RECS rollback never deletes the file, because there is only one
     }
     else
     {
         //This is a Windows extension, so we do not need to worry about Unix path separator characters.
         File.Delete(ODFileUtils.CombinePaths(clearinghouseClin.ExportPath, "claims" + batchNum.ToString() + ".txt"));
     }
 }
コード例 #30
0
ファイル: Dutch.cs プロジェクト: royedwards/DRDNet
 ///<summary>Called from Eclaims and includes multiple claims.  This should return the text of the file that was sent so that it can be saved in
 ///the db.  If this returns an empty result, then claims won't be marked as sent.  The problem is that we create multiple files here.</summary>
 public static string SendBatch(Clearinghouse clearinghouseClin, List <ClaimSendQueueItem> queueItems, int batchNum)
 {
     //We assume for now one file per claim.
     for (int i = 0; i < queueItems.Count; i++)
     {
         if (!CreateClaim(clearinghouseClin, queueItems[i], batchNum))
         {
             return("");
         }
     }
     return("Sent");           //no need to translate.  User will not see.
 }
コード例 #31
0
        ///<summary>Inserts one Clearinghouse into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(Clearinghouse clearinghouse, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                clearinghouse.ClearinghouseNum = ReplicationServers.GetKey("clearinghouse", "ClearinghouseNum");
            }
            string command = "INSERT INTO clearinghouse (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ClearinghouseNum,";
            }
            command += "Description,ExportPath,Payors,Eformat,ISA05,SenderTIN,ISA07,ISA08,ISA15,Password,ResponsePath,CommBridge,ClientProgram,LastBatchNumber,ModemPort,LoginID,SenderName,SenderTelephone,GS03,ISA02,ISA04,ISA16,SeparatorData,SeparatorSegment) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(clearinghouse.ClearinghouseNum) + ",";
            }
            command +=
                "'" + POut.String(clearinghouse.Description) + "',"
                + "'" + POut.String(clearinghouse.ExportPath) + "',"
                + "'" + POut.String(clearinghouse.Payors) + "',"
                + POut.Int((int)clearinghouse.Eformat) + ","
                + "'" + POut.String(clearinghouse.ISA05) + "',"
                + "'" + POut.String(clearinghouse.SenderTIN) + "',"
                + "'" + POut.String(clearinghouse.ISA07) + "',"
                + "'" + POut.String(clearinghouse.ISA08) + "',"
                + "'" + POut.String(clearinghouse.ISA15) + "',"
                + "'" + POut.String(clearinghouse.Password) + "',"
                + "'" + POut.String(clearinghouse.ResponsePath) + "',"
                + POut.Int((int)clearinghouse.CommBridge) + ","
                + "'" + POut.String(clearinghouse.ClientProgram) + "',"
                + POut.Int(clearinghouse.LastBatchNumber) + ","
                + POut.Byte(clearinghouse.ModemPort) + ","
                + "'" + POut.String(clearinghouse.LoginID) + "',"
                + "'" + POut.String(clearinghouse.SenderName) + "',"
                + "'" + POut.String(clearinghouse.SenderTelephone) + "',"
                + "'" + POut.String(clearinghouse.GS03) + "',"
                + "'" + POut.String(clearinghouse.ISA02) + "',"
                + "'" + POut.String(clearinghouse.ISA04) + "',"
                + "'" + POut.String(clearinghouse.ISA16) + "',"
                + "'" + POut.String(clearinghouse.SeparatorData) + "',"
                + "'" + POut.String(clearinghouse.SeparatorSegment) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                clearinghouse.ClearinghouseNum = Db.NonQ(command, true);
            }
            return(clearinghouse.ClearinghouseNum);
        }
コード例 #32
0
ファイル: Renaissance.cs プロジェクト: royedwards/DRDNet
 ///<summary>Called from Eclaims and includes multiple claims.</summary>
 public static string SendBatch(Clearinghouse clearinghouseClin, List <ClaimSendQueueItem> queueItems, int batchNum, IFormClaimFormItemEdit formCFI,
                                FillRenaissanceDelegate fillRenaissance)
 {
     for (int i = 0; i < queueItems.Count; i++)
     {
         _clearinghouseClin = clearinghouseClin;
         if (!CreateClaim(queueItems[i].PatNum, queueItems[i].ClaimNum, batchNum, formCFI, fillRenaissance))
         {
             return("");
         }
     }
     return("Sent");
 }
コード例 #33
0
ファイル: ClearinghouseCrud.cs プロジェクト: nampn/ODental
 ///<summary>Inserts one Clearinghouse into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Clearinghouse clearinghouse,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         clearinghouse.ClearinghouseNum=ReplicationServers.GetKey("clearinghouse","ClearinghouseNum");
     }
     string command="INSERT INTO clearinghouse (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="ClearinghouseNum,";
     }
     command+="Description,ExportPath,Payors,Eformat,ISA05,SenderTIN,ISA07,ISA08,ISA15,Password,ResponsePath,CommBridge,ClientProgram,LastBatchNumber,ModemPort,LoginID,SenderName,SenderTelephone,GS03,ISA02,ISA04,ISA16,SeparatorData,SeparatorSegment) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(clearinghouse.ClearinghouseNum)+",";
     }
     command+=
          "'"+POut.String(clearinghouse.Description)+"',"
         +"'"+POut.String(clearinghouse.ExportPath)+"',"
         +"'"+POut.String(clearinghouse.Payors)+"',"
         +    POut.Int   ((int)clearinghouse.Eformat)+","
         +"'"+POut.String(clearinghouse.ISA05)+"',"
         +"'"+POut.String(clearinghouse.SenderTIN)+"',"
         +"'"+POut.String(clearinghouse.ISA07)+"',"
         +"'"+POut.String(clearinghouse.ISA08)+"',"
         +"'"+POut.String(clearinghouse.ISA15)+"',"
         +"'"+POut.String(clearinghouse.Password)+"',"
         +"'"+POut.String(clearinghouse.ResponsePath)+"',"
         +    POut.Int   ((int)clearinghouse.CommBridge)+","
         +"'"+POut.String(clearinghouse.ClientProgram)+"',"
         +    POut.Int   (clearinghouse.LastBatchNumber)+","
         +    POut.Byte  (clearinghouse.ModemPort)+","
         +"'"+POut.String(clearinghouse.LoginID)+"',"
         +"'"+POut.String(clearinghouse.SenderName)+"',"
         +"'"+POut.String(clearinghouse.SenderTelephone)+"',"
         +"'"+POut.String(clearinghouse.GS03)+"',"
         +"'"+POut.String(clearinghouse.ISA02)+"',"
         +"'"+POut.String(clearinghouse.ISA04)+"',"
         +"'"+POut.String(clearinghouse.ISA16)+"',"
         +"'"+POut.String(clearinghouse.SeparatorData)+"',"
         +"'"+POut.String(clearinghouse.SeparatorSegment)+"')";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         clearinghouse.ClearinghouseNum=Db.NonQ(command,true);
     }
     return clearinghouse.ClearinghouseNum;
 }
コード例 #34
0
ファイル: ClearinghouseCrud.cs プロジェクト: nampn/ODental
 ///<summary>Updates one Clearinghouse in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.</summary>
 internal static void Update(Clearinghouse clearinghouse,Clearinghouse oldClearinghouse)
 {
     string command="";
     if(clearinghouse.Description != oldClearinghouse.Description) {
         if(command!=""){ command+=",";}
         command+="Description = '"+POut.String(clearinghouse.Description)+"'";
     }
     if(clearinghouse.ExportPath != oldClearinghouse.ExportPath) {
         if(command!=""){ command+=",";}
         command+="ExportPath = '"+POut.String(clearinghouse.ExportPath)+"'";
     }
     if(clearinghouse.Payors != oldClearinghouse.Payors) {
         if(command!=""){ command+=",";}
         command+="Payors = '"+POut.String(clearinghouse.Payors)+"'";
     }
     if(clearinghouse.Eformat != oldClearinghouse.Eformat) {
         if(command!=""){ command+=",";}
         command+="Eformat = "+POut.Int   ((int)clearinghouse.Eformat)+"";
     }
     if(clearinghouse.ISA05 != oldClearinghouse.ISA05) {
         if(command!=""){ command+=",";}
         command+="ISA05 = '"+POut.String(clearinghouse.ISA05)+"'";
     }
     if(clearinghouse.SenderTIN != oldClearinghouse.SenderTIN) {
         if(command!=""){ command+=",";}
         command+="SenderTIN = '"+POut.String(clearinghouse.SenderTIN)+"'";
     }
     if(clearinghouse.ISA07 != oldClearinghouse.ISA07) {
         if(command!=""){ command+=",";}
         command+="ISA07 = '"+POut.String(clearinghouse.ISA07)+"'";
     }
     if(clearinghouse.ISA08 != oldClearinghouse.ISA08) {
         if(command!=""){ command+=",";}
         command+="ISA08 = '"+POut.String(clearinghouse.ISA08)+"'";
     }
     if(clearinghouse.ISA15 != oldClearinghouse.ISA15) {
         if(command!=""){ command+=",";}
         command+="ISA15 = '"+POut.String(clearinghouse.ISA15)+"'";
     }
     if(clearinghouse.Password != oldClearinghouse.Password) {
         if(command!=""){ command+=",";}
         command+="Password = '******'";
     }
     if(clearinghouse.ResponsePath != oldClearinghouse.ResponsePath) {
         if(command!=""){ command+=",";}
         command+="ResponsePath = '"+POut.String(clearinghouse.ResponsePath)+"'";
     }
     if(clearinghouse.CommBridge != oldClearinghouse.CommBridge) {
         if(command!=""){ command+=",";}
         command+="CommBridge = "+POut.Int   ((int)clearinghouse.CommBridge)+"";
     }
     if(clearinghouse.ClientProgram != oldClearinghouse.ClientProgram) {
         if(command!=""){ command+=",";}
         command+="ClientProgram = '"+POut.String(clearinghouse.ClientProgram)+"'";
     }
     //LastBatchNumber excluded from update
     if(clearinghouse.ModemPort != oldClearinghouse.ModemPort) {
         if(command!=""){ command+=",";}
         command+="ModemPort = "+POut.Byte(clearinghouse.ModemPort)+"";
     }
     if(clearinghouse.LoginID != oldClearinghouse.LoginID) {
         if(command!=""){ command+=",";}
         command+="LoginID = '"+POut.String(clearinghouse.LoginID)+"'";
     }
     if(clearinghouse.SenderName != oldClearinghouse.SenderName) {
         if(command!=""){ command+=",";}
         command+="SenderName = '"+POut.String(clearinghouse.SenderName)+"'";
     }
     if(clearinghouse.SenderTelephone != oldClearinghouse.SenderTelephone) {
         if(command!=""){ command+=",";}
         command+="SenderTelephone = '"+POut.String(clearinghouse.SenderTelephone)+"'";
     }
     if(clearinghouse.GS03 != oldClearinghouse.GS03) {
         if(command!=""){ command+=",";}
         command+="GS03 = '"+POut.String(clearinghouse.GS03)+"'";
     }
     if(clearinghouse.ISA02 != oldClearinghouse.ISA02) {
         if(command!=""){ command+=",";}
         command+="ISA02 = '"+POut.String(clearinghouse.ISA02)+"'";
     }
     if(clearinghouse.ISA04 != oldClearinghouse.ISA04) {
         if(command!=""){ command+=",";}
         command+="ISA04 = '"+POut.String(clearinghouse.ISA04)+"'";
     }
     if(clearinghouse.ISA16 != oldClearinghouse.ISA16) {
         if(command!=""){ command+=",";}
         command+="ISA16 = '"+POut.String(clearinghouse.ISA16)+"'";
     }
     if(clearinghouse.SeparatorData != oldClearinghouse.SeparatorData) {
         if(command!=""){ command+=",";}
         command+="SeparatorData = '"+POut.String(clearinghouse.SeparatorData)+"'";
     }
     if(clearinghouse.SeparatorSegment != oldClearinghouse.SeparatorSegment) {
         if(command!=""){ command+=",";}
         command+="SeparatorSegment = '"+POut.String(clearinghouse.SeparatorSegment)+"'";
     }
     if(command==""){
         return;
     }
     command="UPDATE clearinghouse SET "+command
         +" WHERE ClearinghouseNum = "+POut.Long(clearinghouse.ClearinghouseNum);
     Db.NonQ(command);
 }
コード例 #35
0
ファイル: ClearinghouseCrud.cs プロジェクト: nampn/ODental
 ///<summary>Updates one Clearinghouse in the database.</summary>
 internal static void Update(Clearinghouse clearinghouse)
 {
     string command="UPDATE clearinghouse SET "
         +"Description     = '"+POut.String(clearinghouse.Description)+"', "
         +"ExportPath      = '"+POut.String(clearinghouse.ExportPath)+"', "
         +"Payors          = '"+POut.String(clearinghouse.Payors)+"', "
         +"Eformat         =  "+POut.Int   ((int)clearinghouse.Eformat)+", "
         +"ISA05           = '"+POut.String(clearinghouse.ISA05)+"', "
         +"SenderTIN       = '"+POut.String(clearinghouse.SenderTIN)+"', "
         +"ISA07           = '"+POut.String(clearinghouse.ISA07)+"', "
         +"ISA08           = '"+POut.String(clearinghouse.ISA08)+"', "
         +"ISA15           = '"+POut.String(clearinghouse.ISA15)+"', "
         +"Password        = '******', "
         +"ResponsePath    = '"+POut.String(clearinghouse.ResponsePath)+"', "
         +"CommBridge      =  "+POut.Int   ((int)clearinghouse.CommBridge)+", "
         +"ClientProgram   = '"+POut.String(clearinghouse.ClientProgram)+"', "
         //LastBatchNumber excluded from update
         +"ModemPort       =  "+POut.Byte  (clearinghouse.ModemPort)+", "
         +"LoginID         = '"+POut.String(clearinghouse.LoginID)+"', "
         +"SenderName      = '"+POut.String(clearinghouse.SenderName)+"', "
         +"SenderTelephone = '"+POut.String(clearinghouse.SenderTelephone)+"', "
         +"GS03            = '"+POut.String(clearinghouse.GS03)+"', "
         +"ISA02           = '"+POut.String(clearinghouse.ISA02)+"', "
         +"ISA04           = '"+POut.String(clearinghouse.ISA04)+"', "
         +"ISA16           = '"+POut.String(clearinghouse.ISA16)+"', "
         +"SeparatorData   = '"+POut.String(clearinghouse.SeparatorData)+"', "
         +"SeparatorSegment= '"+POut.String(clearinghouse.SeparatorSegment)+"' "
         +"WHERE ClearinghouseNum = "+POut.Long(clearinghouse.ClearinghouseNum);
     Db.NonQ(command);
 }