public static List <Intervention> Refresh(long patNum, InterventionCodeSet codeSet) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <List <Intervention> >(MethodBase.GetCurrentMethod(), patNum, codeSet)); } string command = "SELECT * FROM intervention WHERE PatNum = " + POut.Long(patNum) + " AND CodeSet = " + POut.Int((int)codeSet); return(Crud.InterventionCrud.SelectMany(command)); }
///<summary>Gets list of CodeValue strings from interventions with DateEntry in the last year and CodeSet equal to the supplied codeSet. ///Result list is grouped by CodeValue, CodeSystem even though we only return the list of CodeValues. However, there are no codes in the ///EHR intervention code list that conflict between code systems, so we should never have a duplicate code in the returned list.</summary> public static List <string> GetAllForCodeSet(InterventionCodeSet codeSet) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <List <string> >(MethodBase.GetCurrentMethod(), codeSet)); } string command = "SELECT CodeValue FROM intervention WHERE CodeSet=" + POut.Int((int)codeSet) + " " + "AND " + DbHelper.DtimeToDate("DateEntry") + ">=" + POut.Date(MiscData.GetNowDateTime().AddYears(-1)) + " " + "GROUP BY CodeValue,CodeSystem"; return(Db.GetListString(command)); }
///<summary>Returns a list of EhrCodes for the specified InterventionCodeSet and ValueSetOID for any medication interventions. Results will ///contain both intervention codes and medication codes that have been used in the last year.</summary> public static List <EhrCode> GetForIntervAndMedByUse(InterventionCodeSet codeSet, List <string> listMedValueSetOIDs) { //get all MedicationPats where the RxCui is one of the RxCui strings for list of ValueSetOIDs provided List <string> listMedPats = MedicationPats.GetAllForRxCuis(GetForValueSetOIDs(listMedValueSetOIDs, true).Select(x => x.CodeValue).ToList()); List <string> listInterventions = Interventions.GetAllForCodeSet(codeSet); List <EhrCode> retVal = new List <EhrCode>(); foreach (string codeStr in listMedPats.Union(listInterventions)) { EhrCode codeCur = Listt.FirstOrDefault(x => x.CodeValue == codeStr); if (codeCur == null) { continue; } retVal.Add(codeCur); } //we might find the "wrong" ehr code, because a single code may be in multiple code sets. This is still a valid code. return(retVal.OrderBy(x => x.Description).ToList()); }
private string CalcOverUnderBMIHelper(float bmi) { if(ageBeforeJanFirst<18) {//Do not clasify children as over/underweight intervCodeSet=InterventionCodeSet.Nutrition;//we will sent Nutrition to FormInterventionEdit, but this could also be a physical activity intervention return ""; } else if(ageBeforeJanFirst<65) { if(bmi<18.5) { intervCodeSet=InterventionCodeSet.BelowNormalWeight; return "Underweight"; } else if(bmi<25) { return ""; } else { intervCodeSet=InterventionCodeSet.AboveNormalWeight; return "Overweight"; } } else { if(bmi<23) { intervCodeSet=InterventionCodeSet.BelowNormalWeight; return "Underweight"; } else if(bmi<30) { return ""; } else { intervCodeSet=InterventionCodeSet.AboveNormalWeight; return "Overweight"; } } //do not save to DB until butOK_Click }
public static List<Intervention> Refresh(long patNum,InterventionCodeSet codeSet) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { return Meth.GetObject<List<Intervention>>(MethodBase.GetCurrentMethod(),codeSet); } string command="SELECT * FROM intervention WHERE PatNum = "+POut.Long(patNum)+" AND CodeSet = "+POut.Int((int)codeSet); return Crud.InterventionCrud.SelectMany(command); }