///<summary></summary> public static void Update(AutomationCondition automationCondition) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),automationCondition); return; } Crud.AutomationConditionCrud.Update(automationCondition); }
///<summary></summary> public static long Insert(AutomationCondition automationCondition) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { automationCondition.AutomationConditionNum=Meth.GetLong(MethodBase.GetCurrentMethod(),automationCondition); return automationCondition.AutomationConditionNum; } return Crud.AutomationConditionCrud.Insert(automationCondition); }
///<summary></summary> public static void Update(AutomationCondition automationCondition) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), automationCondition); return; } Crud.AutomationConditionCrud.Update(automationCondition); }
///<summary></summary> public static long Insert(AutomationCondition automationCondition) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { automationCondition.AutomationConditionNum = Meth.GetLong(MethodBase.GetCurrentMethod(), automationCondition); return(automationCondition.AutomationConditionNum); } return(Crud.AutomationConditionCrud.Insert(automationCondition)); }
private static bool LabresultComparison(AutomationCondition autoCond,long patNum) { List<LabResult> listResults=LabResults.GetAllForPatient(patNum); switch(autoCond.Comparison) { case AutoCondComparison.Equals: for(int i=0;i<listResults.Count;i++) { if(listResults[i].TestName==autoCond.CompareString) { return true; } } break; case AutoCondComparison.Contains: for(int i=0;i<listResults.Count;i++) { if(listResults[i].TestName.ToLower().Contains(autoCond.CompareString.ToLower())) { return true; } } break; } return false; }
private static bool GenderComparison(AutomationCondition autoCond,long patNum) { Patient pat=Patients.GetPat(patNum); switch(autoCond.Comparison) { case AutoCondComparison.Equals: return (pat.Gender.ToString().Substring(0,1).ToLower()==autoCond.CompareString.ToLower()); case AutoCondComparison.Contains: return (pat.Gender.ToString().Substring(0,1).ToLower().Contains(autoCond.CompareString.ToLower())); default: return false; } }
private static bool AgeComparison(AutomationCondition autoCond,long patNum) { Patient pat=Patients.GetPat(patNum); int age=pat.Age; switch(autoCond.Comparison) { case AutoCondComparison.Equals: return (age==PIn.Int(autoCond.CompareString)); case AutoCondComparison.Contains: return (age.ToString().Contains(autoCond.CompareString)); case AutoCondComparison.GreaterThan: return (age>PIn.Int(autoCond.CompareString)); case AutoCondComparison.LessThan: return (age<PIn.Int(autoCond.CompareString)); default: return false; } }
private static bool AllergyComparison(AutomationCondition autoCond,long patNum) { List<Allergy> allergyList=Allergies.GetAll(patNum,false); switch(autoCond.Comparison) { case AutoCondComparison.Equals: for(int i=0;i<allergyList.Count;i++) { if(AllergyDefs.GetOne(allergyList[i].AllergyDefNum).Description==autoCond.CompareString) { return true; } } break; case AutoCondComparison.Contains: for(int i=0;i<allergyList.Count;i++) { if(AllergyDefs.GetOne(allergyList[i].AllergyDefNum).Description.ToLower().Contains(autoCond.CompareString.ToLower())) { return true; } } break; } return false; }
private static bool MedicationComparison(AutomationCondition autoCond,long patNum) { List<Medication> medList=Medications.GetMedicationsByPat(patNum); switch(autoCond.Comparison) { case AutoCondComparison.Equals: for(int i=0;i<medList.Count;i++) { if(medList[i].MedName==autoCond.CompareString) { return true; } } break; case AutoCondComparison.Contains: for(int i=0;i<medList.Count;i++) { if(medList[i].MedName.ToLower().Contains(autoCond.CompareString.ToLower())) { return true; } } break; } return false; }
private static bool ProblemComparison(AutomationCondition autoCond,long patNum) { List<Disease> problemList=Diseases.Refresh(patNum); switch(autoCond.Comparison) {//Find out what operand to use. case AutoCondComparison.Equals: for(int i=0;i<problemList.Count;i++) {//Includes hidden if(DiseaseDefs.GetName(problemList[i].DiseaseDefNum)==autoCond.CompareString) { return true; } } break; case AutoCondComparison.Contains: for(int i=0;i<problemList.Count;i++) { if(DiseaseDefs.GetName(problemList[i].DiseaseDefNum).ToLower().Contains(autoCond.CompareString.ToLower())) { return true; } } break; } return false; }
private static bool SheetNotCompletedTodayWithName(AutomationCondition autoCond, long patNum) { List<Sheet> sheetList=Sheets.GetForPatientForToday(patNum); switch(autoCond.Comparison) {//Find out what operand to use. case AutoCondComparison.Equals: //Loop through every sheet to find one that matches the condition. for(int i=0;i<sheetList.Count;i++) { if(sheetList[i].Description==autoCond.CompareString) {//Operand based on AutoCondComparison. return true; } } break; case AutoCondComparison.Contains: for(int i=0;i<sheetList.Count;i++) { if(sheetList[i].Description.ToLower().Contains(autoCond.CompareString.ToLower())) { return true; } } break; } return false; }
private static bool AgeComparison(AutomationCondition autoCond,long patNum) { Patient pat=Patients.GetPat(patNum); int age=pat.Age; int ageTrigger=0; if(!int.TryParse(autoCond.CompareString,out ageTrigger)){ return false;//This is only possible due to an old bug that was fixed. } switch(autoCond.Comparison) { case AutoCondComparison.Equals: return (age==ageTrigger); case AutoCondComparison.Contains: return (age.ToString().Contains(autoCond.CompareString)); case AutoCondComparison.GreaterThan: return (age>ageTrigger); case AutoCondComparison.LessThan: return (age<ageTrigger); default: return false; } }