///<summary>Inserts one OrthoProcLink into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(OrthoProcLink orthoProcLink, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO orthoproclink ("; if (!useExistingPK && isRandomKeys) { orthoProcLink.OrthoProcLinkNum = ReplicationServers.GetKeyNoCache("orthoproclink", "OrthoProcLinkNum"); } if (isRandomKeys || useExistingPK) { command += "OrthoProcLinkNum,"; } command += "OrthoCaseNum,ProcNum,SecDateTEntry,SecUserNumEntry,ProcLinkType) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(orthoProcLink.OrthoProcLinkNum) + ","; } command += POut.Long(orthoProcLink.OrthoCaseNum) + "," + POut.Long(orthoProcLink.ProcNum) + "," + DbHelper.Now() + "," + POut.Long(orthoProcLink.SecUserNumEntry) + "," + POut.Int((int)orthoProcLink.ProcLinkType) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { orthoProcLink.OrthoProcLinkNum = Db.NonQ(command, true, "OrthoProcLinkNum", "orthoProcLink"); } return(orthoProcLink.OrthoProcLinkNum); }
///<summary>Inserts one TriageMetric into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(TriageMetric triageMetric, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO triagemetric ("; if (!useExistingPK && isRandomKeys) { triageMetric.TriageMetricNum = ReplicationServers.GetKeyNoCache("triagemetric", "TriageMetricNum"); } if (isRandomKeys || useExistingPK) { command += "TriageMetricNum,"; } command += "CountBlueTasks,CountWhiteTasks,CountRedTasks,DateTimeOldestTriageTaskOrTaskNote,DateTimeOldestUrgentTaskOrTaskNote) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(triageMetric.TriageMetricNum) + ","; } command += POut.Int(triageMetric.CountBlueTasks) + "," + POut.Int(triageMetric.CountWhiteTasks) + "," + POut.Int(triageMetric.CountRedTasks) + "," + POut.DateT(triageMetric.DateTimeOldestTriageTaskOrTaskNote) + "," + POut.DateT(triageMetric.DateTimeOldestUrgentTaskOrTaskNote) + ")"; //DateTStamp can only be set by MySQL if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { triageMetric.TriageMetricNum = Db.NonQ(command, true, "TriageMetricNum", "triageMetric"); } return(triageMetric.TriageMetricNum); }
///<summary>Inserts one DatabaseMaintenance into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(DatabaseMaintenance databaseMaintenance, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO databasemaintenance ("; if (!useExistingPK && isRandomKeys) { databaseMaintenance.DatabaseMaintenanceNum = ReplicationServers.GetKeyNoCache("databasemaintenance", "DatabaseMaintenanceNum"); } if (isRandomKeys || useExistingPK) { command += "DatabaseMaintenanceNum,"; } command += "MethodName,IsHidden,IsOld,DateLastRun) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(databaseMaintenance.DatabaseMaintenanceNum) + ","; } command += "'" + POut.String(databaseMaintenance.MethodName) + "'," + POut.Bool(databaseMaintenance.IsHidden) + "," + POut.Bool(databaseMaintenance.IsOld) + "," + POut.DateT(databaseMaintenance.DateLastRun) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { databaseMaintenance.DatabaseMaintenanceNum = Db.NonQ(command, true, "DatabaseMaintenanceNum", "databaseMaintenance"); } return(databaseMaintenance.DatabaseMaintenanceNum); }
///<summary>Inserts one EServiceCodeLink into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(EServiceCodeLink eServiceCodeLink, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO eservicecodelink ("; if (!useExistingPK && isRandomKeys) { eServiceCodeLink.EServiceCodeLinkNum = ReplicationServers.GetKeyNoCache("eservicecodelink", "EServiceCodeLinkNum"); } if (isRandomKeys || useExistingPK) { command += "EServiceCodeLinkNum,"; } command += "CodeNum,EService) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(eServiceCodeLink.EServiceCodeLinkNum) + ","; } command += POut.Long(eServiceCodeLink.CodeNum) + "," + POut.Int((int)eServiceCodeLink.EService) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { eServiceCodeLink.EServiceCodeLinkNum = Db.NonQ(command, true, "EServiceCodeLinkNum", "eServiceCodeLink"); } return(eServiceCodeLink.EServiceCodeLinkNum); }
///<summary>Inserts one InsFilingCode into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(InsFilingCode insFilingCode, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO insfilingcode ("; if (!useExistingPK && isRandomKeys) { insFilingCode.InsFilingCodeNum = ReplicationServers.GetKeyNoCache("insfilingcode", "InsFilingCodeNum"); } if (isRandomKeys || useExistingPK) { command += "InsFilingCodeNum,"; } command += "Descript,EclaimCode,ItemOrder,GroupType) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(insFilingCode.InsFilingCodeNum) + ","; } command += "'" + POut.String(insFilingCode.Descript) + "'," + "'" + POut.String(insFilingCode.EclaimCode) + "'," + POut.Int(insFilingCode.ItemOrder) + "," + POut.Long(insFilingCode.GroupType) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { insFilingCode.InsFilingCodeNum = Db.NonQ(command, true, "InsFilingCodeNum", "insFilingCode"); } return(insFilingCode.InsFilingCodeNum); }
///<summary>Inserts one JobLink into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(JobLink jobLink, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO joblink ("; if (!useExistingPK && isRandomKeys) { jobLink.JobLinkNum = ReplicationServers.GetKeyNoCache("joblink", "JobLinkNum"); } if (isRandomKeys || useExistingPK) { command += "JobLinkNum,"; } command += "JobNum,FKey,LinkType,Tag,DisplayOverride) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(jobLink.JobLinkNum) + ","; } command += POut.Long(jobLink.JobNum) + "," + POut.Long(jobLink.FKey) + "," + POut.Int((int)jobLink.LinkType) + "," + "'" + POut.String(jobLink.Tag) + "'," + "'" + POut.String(jobLink.DisplayOverride) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { jobLink.JobLinkNum = Db.NonQ(command, true, "JobLinkNum", "jobLink"); } return(jobLink.JobLinkNum); }
///<summary>Inserts one Ebill into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Ebill ebill, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO ebill ("; if (!useExistingPK && isRandomKeys) { ebill.EbillNum = ReplicationServers.GetKeyNoCache("ebill", "EbillNum"); } if (isRandomKeys || useExistingPK) { command += "EbillNum,"; } command += "ClinicNum,ClientAcctNumber,ElectUserName,ElectPassword,PracticeAddress,RemitAddress) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(ebill.EbillNum) + ","; } command += POut.Long(ebill.ClinicNum) + "," + "'" + POut.String(ebill.ClientAcctNumber) + "'," + "'" + POut.String(ebill.ElectUserName) + "'," + "'" + POut.String(ebill.ElectPassword) + "'," + POut.Int((int)ebill.PracticeAddress) + "," + POut.Int((int)ebill.RemitAddress) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { ebill.EbillNum = Db.NonQ(command, true, "EbillNum", "ebill"); } return(ebill.EbillNum); }
///<summary>Inserts one ProgramProperty into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ProgramProperty programProperty, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO programproperty ("; if (!useExistingPK && isRandomKeys) { programProperty.ProgramPropertyNum = ReplicationServers.GetKeyNoCache("programproperty", "ProgramPropertyNum"); } if (isRandomKeys || useExistingPK) { command += "ProgramPropertyNum,"; } command += "ProgramNum,PropertyDesc,PropertyValue,ComputerName,ClinicNum) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(programProperty.ProgramPropertyNum) + ","; } command += POut.Long(programProperty.ProgramNum) + "," + "'" + POut.String(programProperty.PropertyDesc) + "'," + "'" + POut.String(programProperty.PropertyValue) + "'," + "'" + POut.String(programProperty.ComputerName) + "'," + POut.Long(programProperty.ClinicNum) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { programProperty.ProgramPropertyNum = Db.NonQ(command, true, "ProgramPropertyNum", "programProperty"); } return(programProperty.ProgramPropertyNum); }
///<summary>Inserts one SubstitutionLink into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(SubstitutionLink substitutionLink, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO substitutionlink ("; if (!useExistingPK && isRandomKeys) { substitutionLink.SubstitutionLinkNum = ReplicationServers.GetKeyNoCache("substitutionlink", "SubstitutionLinkNum"); } if (isRandomKeys || useExistingPK) { command += "SubstitutionLinkNum,"; } command += "PlanNum,CodeNum,SubstitutionCode,SubstOnlyIf) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(substitutionLink.SubstitutionLinkNum) + ","; } command += POut.Long(substitutionLink.PlanNum) + "," + POut.Long(substitutionLink.CodeNum) + "," + "'" + POut.String(substitutionLink.SubstitutionCode) + "'," + POut.Int((int)substitutionLink.SubstOnlyIf) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { substitutionLink.SubstitutionLinkNum = Db.NonQ(command, true, "SubstitutionLinkNum", "substitutionLink"); } return(substitutionLink.SubstitutionLinkNum); }
///<summary>Inserts one AlertCategory into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(AlertCategory alertCategory, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO alertcategory ("; if (!useExistingPK && isRandomKeys) { alertCategory.AlertCategoryNum = ReplicationServers.GetKeyNoCache("alertcategory", "AlertCategoryNum"); } if (isRandomKeys || useExistingPK) { command += "AlertCategoryNum,"; } command += "IsHQCategory,InternalName,Description) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(alertCategory.AlertCategoryNum) + ","; } command += POut.Bool(alertCategory.IsHQCategory) + "," + "'" + POut.String(alertCategory.InternalName) + "'," + "'" + POut.String(alertCategory.Description) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { alertCategory.AlertCategoryNum = Db.NonQ(command, true, "AlertCategoryNum", "alertCategory"); } return(alertCategory.AlertCategoryNum); }
///<summary>Inserts one TreatPlanAttach into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(TreatPlanAttach treatPlanAttach, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO treatplanattach ("; if (!useExistingPK && isRandomKeys) { treatPlanAttach.TreatPlanAttachNum = ReplicationServers.GetKeyNoCache("treatplanattach", "TreatPlanAttachNum"); } if (isRandomKeys || useExistingPK) { command += "TreatPlanAttachNum,"; } command += "TreatPlanNum,ProcNum,Priority) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(treatPlanAttach.TreatPlanAttachNum) + ","; } command += POut.Long(treatPlanAttach.TreatPlanNum) + "," + POut.Long(treatPlanAttach.ProcNum) + "," + POut.Long(treatPlanAttach.Priority) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { treatPlanAttach.TreatPlanAttachNum = Db.NonQ(command, true, "TreatPlanAttachNum", "treatPlanAttach"); } return(treatPlanAttach.TreatPlanAttachNum); }
///<summary>Inserts one InstallmentPlan into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(InstallmentPlan installmentPlan, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO installmentplan ("; if (!useExistingPK && isRandomKeys) { installmentPlan.InstallmentPlanNum = ReplicationServers.GetKeyNoCache("installmentplan", "InstallmentPlanNum"); } if (isRandomKeys || useExistingPK) { command += "InstallmentPlanNum,"; } command += "PatNum,DateAgreement,DateFirstPayment,MonthlyPayment,APR,Note) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(installmentPlan.InstallmentPlanNum) + ","; } command += POut.Long(installmentPlan.PatNum) + "," + POut.Date(installmentPlan.DateAgreement) + "," + POut.Date(installmentPlan.DateFirstPayment) + "," + "'" + POut.Double(installmentPlan.MonthlyPayment) + "'," + POut.Float(installmentPlan.APR) + "," + "'" + POut.String(installmentPlan.Note) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { installmentPlan.InstallmentPlanNum = Db.NonQ(command, true, "InstallmentPlanNum", "installmentPlan"); } return(installmentPlan.InstallmentPlanNum); }
///<summary>Inserts one AutomationCondition into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(AutomationCondition automationCondition,bool useExistingPK){ bool isRandomKeys=Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command="INSERT INTO automationcondition ("; if(!useExistingPK && isRandomKeys) { automationCondition.AutomationConditionNum=ReplicationServers.GetKeyNoCache("automationcondition","AutomationConditionNum"); } if(isRandomKeys || useExistingPK) { command+="AutomationConditionNum,"; } command+="AutomationNum,CompareField,Comparison,CompareString) VALUES("; if(isRandomKeys || useExistingPK) { command+=POut.Long(automationCondition.AutomationConditionNum)+","; } command+= POut.Long (automationCondition.AutomationNum)+"," + POut.Int ((int)automationCondition.CompareField)+"," + POut.Int ((int)automationCondition.Comparison)+"," +"'"+POut.String(automationCondition.CompareString)+"')"; if(useExistingPK || isRandomKeys) { Db.NonQ(command); } else { automationCondition.AutomationConditionNum=Db.NonQ(command,true,"AutomationConditionNum","automationCondition"); } return automationCondition.AutomationConditionNum; }
///<summary>Inserts one ClaimValCodeLog into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ClaimValCodeLog claimValCodeLog, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO claimvalcodelog ("; if (!useExistingPK && isRandomKeys) { claimValCodeLog.ClaimValCodeLogNum = ReplicationServers.GetKeyNoCache("claimvalcodelog", "ClaimValCodeLogNum"); } if (isRandomKeys || useExistingPK) { command += "ClaimValCodeLogNum,"; } command += "ClaimNum,ClaimField,ValCode,ValAmount,Ordinal) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(claimValCodeLog.ClaimValCodeLogNum) + ","; } command += POut.Long(claimValCodeLog.ClaimNum) + "," + "'" + POut.String(claimValCodeLog.ClaimField) + "'," + "'" + POut.String(claimValCodeLog.ValCode) + "'," + "'" + POut.Double(claimValCodeLog.ValAmount) + "'," + POut.Int(claimValCodeLog.Ordinal) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { claimValCodeLog.ClaimValCodeLogNum = Db.NonQ(command, true, "ClaimValCodeLogNum", "claimValCodeLog"); } return(claimValCodeLog.ClaimValCodeLogNum); }
///<summary>Inserts one Etrans835Attach into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Etrans835Attach etrans835Attach, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO etrans835attach ("; if (!useExistingPK && isRandomKeys) { etrans835Attach.Etrans835AttachNum = ReplicationServers.GetKeyNoCache("etrans835attach", "Etrans835AttachNum"); } if (isRandomKeys || useExistingPK) { command += "Etrans835AttachNum,"; } command += "EtransNum,ClaimNum,ClpSegmentIndex) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(etrans835Attach.Etrans835AttachNum) + ","; } command += POut.Long(etrans835Attach.EtransNum) + "," + POut.Long(etrans835Attach.ClaimNum) + "," + POut.Int(etrans835Attach.ClpSegmentIndex) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { etrans835Attach.Etrans835AttachNum = Db.NonQ(command, true, "Etrans835AttachNum", "etrans835Attach"); } return(etrans835Attach.Etrans835AttachNum); }
///<summary>Inserts one EmailAttach into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(EmailAttach emailAttach, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO emailattach ("; if (!useExistingPK && isRandomKeys) { emailAttach.EmailAttachNum = ReplicationServers.GetKeyNoCache("emailattach", "EmailAttachNum"); } if (isRandomKeys || useExistingPK) { command += "EmailAttachNum,"; } command += "EmailMessageNum,DisplayedFileName,ActualFileName,EmailTemplateNum) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(emailAttach.EmailAttachNum) + ","; } command += POut.Long(emailAttach.EmailMessageNum) + "," + "'" + POut.String(emailAttach.DisplayedFileName) + "'," + "'" + POut.String(emailAttach.ActualFileName) + "'," + POut.Long(emailAttach.EmailTemplateNum) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { emailAttach.EmailAttachNum = Db.NonQ(command, true, "EmailAttachNum", "emailAttach"); } return(emailAttach.EmailAttachNum); }
///<summary>Inserts one HL7DefSegment into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(HL7DefSegment hL7DefSegment,bool useExistingPK){ bool isRandomKeys=Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command="INSERT INTO hl7defsegment ("; if(!useExistingPK && isRandomKeys) { hL7DefSegment.HL7DefSegmentNum=ReplicationServers.GetKeyNoCache("hl7defsegment","HL7DefSegmentNum"); } if(isRandomKeys || useExistingPK) { command+="HL7DefSegmentNum,"; } command+="HL7DefMessageNum,ItemOrder,CanRepeat,IsOptional,SegmentName,Note) VALUES("; if(isRandomKeys || useExistingPK) { command+=POut.Long(hL7DefSegment.HL7DefSegmentNum)+","; } command+= POut.Long (hL7DefSegment.HL7DefMessageNum)+"," + POut.Int (hL7DefSegment.ItemOrder)+"," + POut.Bool (hL7DefSegment.CanRepeat)+"," + POut.Bool (hL7DefSegment.IsOptional)+"," +"'"+POut.String(hL7DefSegment.SegmentName.ToString())+"'," + DbHelper.ParamChar+"paramNote)"; if(hL7DefSegment.Note==null) { hL7DefSegment.Note=""; } OdSqlParameter paramNote=new OdSqlParameter("paramNote",OdDbType.Text,POut.StringParam(hL7DefSegment.Note)); if(useExistingPK || isRandomKeys) { Db.NonQ(command,paramNote); } else { hL7DefSegment.HL7DefSegmentNum=Db.NonQ(command,true,"HL7DefSegmentNum","hL7DefSegment",paramNote); } return hL7DefSegment.HL7DefSegmentNum; }
///<summary>Inserts one FormPat into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(FormPat formPat, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO formpat ("; if (!useExistingPK && isRandomKeys) { formPat.FormPatNum = ReplicationServers.GetKeyNoCache("formpat", "FormPatNum"); } if (isRandomKeys || useExistingPK) { command += "FormPatNum,"; } command += "PatNum,FormDateTime) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(formPat.FormPatNum) + ","; } command += POut.Long(formPat.PatNum) + "," + POut.DateT(formPat.FormDateTime) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { formPat.FormPatNum = Db.NonQ(command, true, "FormPatNum", "formPat"); } return(formPat.FormPatNum); }
///<summary>Inserts one RxAlert into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(RxAlert rxAlert, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO rxalert ("; if (!useExistingPK && isRandomKeys) { rxAlert.RxAlertNum = ReplicationServers.GetKeyNoCache("rxalert", "RxAlertNum"); } if (isRandomKeys || useExistingPK) { command += "RxAlertNum,"; } command += "RxDefNum,DiseaseDefNum,AllergyDefNum,MedicationNum,NotificationMsg,IsHighSignificance) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(rxAlert.RxAlertNum) + ","; } command += POut.Long(rxAlert.RxDefNum) + "," + POut.Long(rxAlert.DiseaseDefNum) + "," + POut.Long(rxAlert.AllergyDefNum) + "," + POut.Long(rxAlert.MedicationNum) + "," + "'" + POut.String(rxAlert.NotificationMsg) + "'," + POut.Bool(rxAlert.IsHighSignificance) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { rxAlert.RxAlertNum = Db.NonQ(command, true, "RxAlertNum", "rxAlert"); } return(rxAlert.RxAlertNum); }
///<summary>Inserts one PhoneGraph into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(PhoneGraph phoneGraph, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO phonegraph ("; if (!useExistingPK && isRandomKeys) { phoneGraph.PhoneGraphNum = ReplicationServers.GetKeyNoCache("phonegraph", "PhoneGraphNum"); } if (isRandomKeys || useExistingPK) { command += "PhoneGraphNum,"; } command += "EmployeeNum,IsGraphed,DateEntry) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(phoneGraph.PhoneGraphNum) + ","; } command += POut.Long(phoneGraph.EmployeeNum) + "," + POut.Bool(phoneGraph.IsGraphed) + "," + POut.Date(phoneGraph.DateEntry) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { phoneGraph.PhoneGraphNum = Db.NonQ(command, true, "PhoneGraphNum", "phoneGraph"); } return(phoneGraph.PhoneGraphNum); }
///<summary>Inserts one EhrAptObs into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(EhrAptObs ehrAptObs, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO ehraptobs ("; if (!useExistingPK && isRandomKeys) { ehrAptObs.EhrAptObsNum = ReplicationServers.GetKeyNoCache("ehraptobs", "EhrAptObsNum"); } if (isRandomKeys || useExistingPK) { command += "EhrAptObsNum,"; } command += "AptNum,IdentifyingCode,ValType,ValReported,UcumCode,ValCodeSystem) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(ehrAptObs.EhrAptObsNum) + ","; } command += POut.Long(ehrAptObs.AptNum) + "," + POut.Int((int)ehrAptObs.IdentifyingCode) + "," + POut.Int((int)ehrAptObs.ValType) + "," + "'" + POut.String(ehrAptObs.ValReported) + "'," + "'" + POut.String(ehrAptObs.UcumCode) + "'," + "'" + POut.String(ehrAptObs.ValCodeSystem) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { ehrAptObs.EhrAptObsNum = Db.NonQ(command, true, "EhrAptObsNum", "ehrAptObs"); } return(ehrAptObs.EhrAptObsNum); }
///<summary>Inserts one StmtLink into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(StmtLink stmtLink, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO stmtlink ("; if (!useExistingPK && isRandomKeys) { stmtLink.StmtLinkNum = ReplicationServers.GetKeyNoCache("stmtlink", "StmtLinkNum"); } if (isRandomKeys || useExistingPK) { command += "StmtLinkNum,"; } command += "StatementNum,StmtLinkType,FKey) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(stmtLink.StmtLinkNum) + ","; } command += POut.Long(stmtLink.StatementNum) + "," + POut.Int((int)stmtLink.StmtLinkType) + "," + POut.Long(stmtLink.FKey) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { stmtLink.StmtLinkNum = Db.NonQ(command, true, "StmtLinkNum", "stmtLink"); } return(stmtLink.StmtLinkNum); }
///<summary>Inserts one FieldDefLink into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(FieldDefLink fieldDefLink, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO fielddeflink ("; if (!useExistingPK && isRandomKeys) { fieldDefLink.FieldDefLinkNum = ReplicationServers.GetKeyNoCache("fielddeflink", "FieldDefLinkNum"); } if (isRandomKeys || useExistingPK) { command += "FieldDefLinkNum,"; } command += "FieldDefNum,FieldDefType,FieldLocation) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(fieldDefLink.FieldDefLinkNum) + ","; } command += POut.Long(fieldDefLink.FieldDefNum) + "," + POut.Int((int)fieldDefLink.FieldDefType) + "," + POut.Int((int)fieldDefLink.FieldLocation) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { fieldDefLink.FieldDefLinkNum = Db.NonQ(command, true, "FieldDefLinkNum", "fieldDefLink"); } return(fieldDefLink.FieldDefLinkNum); }
///<summary>Inserts one JobNotification into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(JobNotification jobNotification, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO jobnotification ("; if (!useExistingPK && isRandomKeys) { jobNotification.JobNotificationNum = ReplicationServers.GetKeyNoCache("jobnotification", "JobNotificationNum"); } if (isRandomKeys || useExistingPK) { command += "JobNotificationNum,"; } command += "JobNum,UserNum,Changes) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(jobNotification.JobNotificationNum) + ","; } command += POut.Long(jobNotification.JobNum) + "," + POut.Long(jobNotification.UserNum) + "," + POut.Int((int)jobNotification.Changes) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { jobNotification.JobNotificationNum = Db.NonQ(command, true, "JobNotificationNum", "jobNotification"); } return(jobNotification.JobNotificationNum); }
///<summary>Inserts one Ucum into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Ucum ucum, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO ucum ("; if (!useExistingPK && isRandomKeys) { ucum.UcumNum = ReplicationServers.GetKeyNoCache("ucum", "UcumNum"); } if (isRandomKeys || useExistingPK) { command += "UcumNum,"; } command += "UcumCode,Description,IsInUse) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(ucum.UcumNum) + ","; } command += "'" + POut.String(ucum.UcumCode) + "'," + "'" + POut.String(ucum.Description) + "'," + POut.Bool(ucum.IsInUse) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { ucum.UcumNum = Db.NonQ(command, true, "UcumNum", "ucum"); } return(ucum.UcumNum); }
///<summary>Inserts one Sop into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Sop sop, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO sop ("; if (!useExistingPK && isRandomKeys) { sop.SopNum = ReplicationServers.GetKeyNoCache("sop", "SopNum"); } if (isRandomKeys || useExistingPK) { command += "SopNum,"; } command += "SopCode,Description) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(sop.SopNum) + ","; } command += "'" + POut.String(sop.SopCode) + "'," + "'" + POut.String(sop.Description) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { sop.SopNum = Db.NonQ(command, true, "SopNum", "sop"); } return(sop.SopNum); }
///<summary>Inserts one CommOptOut into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(CommOptOut commOptOut, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO commoptout ("; if (!useExistingPK && isRandomKeys) { commOptOut.CommOptOutNum = ReplicationServers.GetKeyNoCache("commoptout", "CommOptOutNum"); } if (isRandomKeys || useExistingPK) { command += "CommOptOutNum,"; } command += "PatNum,CommType,CommMode) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(commOptOut.CommOptOutNum) + ","; } command += POut.Long(commOptOut.PatNum) + "," + POut.Int((int)commOptOut.CommType) + "," + POut.Int((int)commOptOut.CommMode) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { commOptOut.CommOptOutNum = Db.NonQ(command, true, "CommOptOutNum", "commOptOut"); } return(commOptOut.CommOptOutNum); }
///<summary>Inserts one PhoneMetric into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(PhoneMetric phoneMetric, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO phonemetric ("; if (!useExistingPK && isRandomKeys) { phoneMetric.PhoneMetricNum = ReplicationServers.GetKeyNoCache("phonemetric", "PhoneMetricNum"); } if (isRandomKeys || useExistingPK) { command += "PhoneMetricNum,"; } command += "DateTimeEntry,VoiceMails,Triages,MinutesBehind) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(phoneMetric.PhoneMetricNum) + ","; } command += POut.DateT(phoneMetric.DateTimeEntry) + "," + POut.Int(phoneMetric.VoiceMails) + "," + POut.Int(phoneMetric.Triages) + "," + POut.Int(phoneMetric.MinutesBehind) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { phoneMetric.PhoneMetricNum = Db.NonQ(command, true, "PhoneMetricNum", "phoneMetric"); } return(phoneMetric.PhoneMetricNum); }
///<summary>Inserts one SecurityLogHash into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(SecurityLogHash securityLogHash, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO securityloghash ("; if (!useExistingPK && isRandomKeys) { securityLogHash.SecurityLogHashNum = ReplicationServers.GetKeyNoCache("securityloghash", "SecurityLogHashNum"); } if (isRandomKeys || useExistingPK) { command += "SecurityLogHashNum,"; } command += "SecurityLogNum,LogHash) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(securityLogHash.SecurityLogHashNum) + ","; } command += POut.Long(securityLogHash.SecurityLogNum) + "," + "'" + POut.String(securityLogHash.LogHash) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { securityLogHash.SecurityLogHashNum = Db.NonQ(command, true, "SecurityLogHashNum", "securityLogHash"); } return(securityLogHash.SecurityLogHashNum); }
///<summary>Inserts one ProviderIdent into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ProviderIdent providerIdent, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO providerident ("; if (!useExistingPK && isRandomKeys) { providerIdent.ProviderIdentNum = ReplicationServers.GetKeyNoCache("providerident", "ProviderIdentNum"); } if (isRandomKeys || useExistingPK) { command += "ProviderIdentNum,"; } command += "ProvNum,PayorID,SuppIDType,IDNumber) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(providerIdent.ProviderIdentNum) + ","; } command += POut.Long(providerIdent.ProvNum) + "," + "'" + POut.String(providerIdent.PayorID) + "'," + POut.Int((int)providerIdent.SuppIDType) + "," + "'" + POut.String(providerIdent.IDNumber) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { providerIdent.ProviderIdentNum = Db.NonQ(command, true, "ProviderIdentNum", "providerIdent"); } return(providerIdent.ProviderIdentNum); }