private void AddProblem(SheetFieldDef SheetFieldDefCur)
        {
            if (!Security.IsAuthorized(Permissions.ProblemEdit))
            {
                return;
            }
            DiseaseDef def = new DiseaseDef()
            {
                ICD9Code    = "",
                Icd10Code   = "",
                SnomedCode  = "",
                ItemOrder   = DiseaseDefs.GetCount(),
                DiseaseName = SheetFieldDefCur?.FieldName.Replace("problem:", "") ?? ""
            };
            FormDiseaseDefEdit formDDE = new FormDiseaseDefEdit(def, false);

            formDDE.IsNew = true;
            formDDE.ShowDialog();
            if (formDDE.DialogResult != DialogResult.OK)
            {
                return;
            }
            DiseaseDefs.Insert(formDDE.DiseaseDefCur);
            DataValid.SetInvalid(InvalidType.Diseases);
            _listDiseaseDefs = DiseaseDefs.GetDeepCopy(true);
            SecurityLogs.MakeLogEntry(Permissions.ProblemEdit, 0, formDDE.SecurityLogMsgText);
            FillListMedical(MedicalListType.problem);
        }
Exemplo n.º 2
0
 private void FillAlerts()
 {
     RxAlertList = RxAlerts.Refresh(RxDefCur.RxDefNum);
     listAlerts.Items.Clear();
     for (int i = 0; i < RxAlertList.Count; i++)
     {
         if (RxAlertList[i].DiseaseDefNum > 0)
         {
             listAlerts.Items.Add(DiseaseDefs.GetName(RxAlertList[i].DiseaseDefNum));
         }
         if (RxAlertList[i].AllergyDefNum > 0)
         {
             AllergyDef allergyDef = AllergyDefs.GetOne(RxAlertList[i].AllergyDefNum);
             if (allergyDef != null)
             {
                 listAlerts.Items.Add(allergyDef.Description);
             }
         }
         if (RxAlertList[i].MedicationNum > 0)
         {
             Medications.RefreshCache();
             Medication med = Medications.GetMedication(RxAlertList[i].MedicationNum);
             if (med != null)
             {
                 listAlerts.Items.Add(med.MedName);
             }
         }
     }
 }
Exemplo n.º 3
0
        ///<summary>Adds a new disease. New diseases get blank (not null) fields for ICD9, ICD10, and SnoMedCodes
        ///if they are not specified from FormDiseaseDefEdit so that we can do string searches on them.</summary>
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.ProblemEdit))
            {
                return;
            }
            //initialise the new DiseaseDef with blank fields instead of null so we can filter on them.
            DiseaseDef def = new DiseaseDef()
            {
                ICD9Code   = "",
                Icd10Code  = "",
                SnomedCode = "",
                ItemOrder  = DiseaseDefs.GetCount()
            };
            FormDiseaseDefEdit FormD = new FormDiseaseDefEdit(def, true);         //also sets ItemOrder correctly if using alphabetical during the insert diseaseDef call.

            FormD.IsNew = true;
            FormD.ShowDialog();
            if (FormD.DialogResult != DialogResult.OK)
            {
                return;
            }
            _listSecurityLogMsgs.Add(FormD.SecurityLogMsgText);
            //Need to invalidate cache for selection mode so that the new problem shows up.
            if (IsSelectionMode)
            {
                DataValid.SetInvalid(InvalidType.Diseases);
            }
            //Items are already in the right order in the DB, re-order in memory list to match
            _listDiseaseDefs.FindAll(x => x.ItemOrder >= def.ItemOrder).ForEach(x => x.ItemOrder++);
            _listDiseaseDefs.Add(def);
            _listDiseaseDefs.Sort(DiseaseDefs.SortItemOrder);
            IsChanged = true;
            FillGrid();
        }
Exemplo n.º 4
0
 private void FormDiseaseEdit_Load(object sender, EventArgs e)
 {
     // Fill problem/icd9 - only one will exist (with a value not zero).
     if (DiseaseCur.DiseaseDefNum != 0)
     {
         textProblem.Text = DiseaseDefs.GetItem(DiseaseCur.DiseaseDefNum).DiseaseName;
     }
     else
     {
         textIcd9.Text = ICD9s.GetOne(DiseaseCur.ICD9Num).Description;
     }
     comboStatus.Items.Clear();
     for (int i = 0; i < Enum.GetNames(typeof(ProblemStatus)).Length; i++)
     {
         comboStatus.Items.Add(Enum.GetNames(typeof(ProblemStatus))[i]);
     }
     comboStatus.SelectedIndex = (int)DiseaseCur.ProbStatus;
     textNote.Text             = DiseaseCur.PatNote;
     if (DiseaseCur.DateStart.Year > 1880)
     {
         textDateStart.Text = DiseaseCur.DateStart.ToShortDateString();
     }
     if (DiseaseCur.DateStop.Year > 1880)
     {
         textDateStop.Text = DiseaseCur.DateStop.ToShortDateString();
     }
 }
Exemplo n.º 5
0
        ///<summary>Used by MoveUp and MoveDown.</summary>
        private static void SetOrder(int mySelNum, int myItemOrder)
        {
            DiseaseDef temp = ListLong[mySelNum];

            temp.ItemOrder = myItemOrder;
            DiseaseDefs.Update(temp);
        }
Exemplo n.º 6
0
        private void FillGridEdu()
        {
            gridEdu.BeginUpdate();
            gridEdu.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Criteria", 300);

            gridEdu.Columns.Add(col);
            col = new ODGridColumn("Link", 100);
            gridEdu.Columns.Add(col);
            eduResourceList = EduResources.GenerateForPatient(patCur.PatNum);
            gridEdu.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < eduResourceList.Count; i++)
            {
                row = new ODGridRow();
                if (eduResourceList[i].DiseaseDefNum != 0)
                {
                    row.Cells.Add("Problem: " + DiseaseDefs.GetItem(eduResourceList[i].DiseaseDefNum).DiseaseName);
                    //row.Cells.Add("ICD9: "+DiseaseDefs.GetItem(eduResourceList[i].DiseaseDefNum).ICD9Code);
                }
                else if (eduResourceList[i].MedicationNum != 0)
                {
                    row.Cells.Add("Medication: " + Medications.GetDescription(eduResourceList[i].MedicationNum));
                }
                else
                {
                    row.Cells.Add("Lab Results: " + eduResourceList[i].LabResultName);
                }
                row.Cells.Add(eduResourceList[i].ResourceUrl);
                gridEdu.Rows.Add(row);
            }
            gridEdu.EndUpdate();
        }
Exemplo n.º 7
0
        private void butAddProblem_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormDD = new FormDiseaseDefs();

            FormDD.IsSelectionMode = true;
            FormDD.ShowDialog();
            if (FormDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            DiseaseDef diseaseDef = DiseaseDefs.GetItem(FormDD.SelectedDiseaseDefNum);

            //DiseaseDefNum
            if (!EhrTriggerCur.ProblemDefNumList.Contains(" " + diseaseDef.DiseaseDefNum + " "))
            {
                EhrTriggerCur.ProblemDefNumList += " " + diseaseDef.DiseaseDefNum + " ";
            }
            //Icd9Num
            if (diseaseDef.ICD9Code != "" && !EhrTriggerCur.ProblemIcd9List.Contains(" " + diseaseDef.ICD9Code + " "))
            {
                EhrTriggerCur.ProblemIcd9List += " " + diseaseDef.ICD9Code + " ";
            }
            //Icd10Num
            if (diseaseDef.Icd10Code != "" && !EhrTriggerCur.ProblemIcd9List.Contains(" " + diseaseDef.Icd10Code + " "))
            {
                EhrTriggerCur.ProblemIcd10List += " " + diseaseDef.Icd10Code + " ";
            }
            //Snomed
            if (diseaseDef.SnomedCode != "" && !EhrTriggerCur.ProblemIcd9List.Contains(" " + diseaseDef.SnomedCode + " "))
            {
                EhrTriggerCur.ProblemSnomedList += " " + diseaseDef.SnomedCode + " ";
            }
            FillGrid();
        }
Exemplo n.º 8
0
        private static bool ProblemComparison(AutomationCondition autoCond, long patNum)
        {
            List <Disease> problemList = Diseases.Refresh(patNum, true);

            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);
        }
Exemplo n.º 9
0
        private void butProblemSelect_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormDD = new FormDiseaseDefs();

            FormDD.IsSelectionMode = true;
            FormDD.ShowDialog();
            if (FormDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            DiseaseDef disCur = DiseaseDefs.GetItem(FormDD.SelectedDiseaseDefNum);

            if (disCur == null)
            {
                return;
            }
            EduResourceCur.DiseaseDefNum = FormDD.SelectedDiseaseDefNum;
            textProblem.Text             = disCur.DiseaseName;
            textICD9.Text   = ICD9s.GetCodeAndDescription(disCur.ICD9Code);
            textSnomed.Text = Snomeds.GetCodeAndDescription(disCur.SnomedCode);
            EduResourceCur.MedicationNum = 0;
            textLabResultsID.Text        = "";
            textLabTestName.Text         = "";
            textCompareValue.Text        = "";
        }
Exemplo n.º 10
0
        private void butMapToSnomed_Click(object sender, EventArgs e)
        {
            if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Will add SNOMED CT code to existing problems list only if the ICD9 code correlates to exactly one SNOMED CT code. If there is any ambiguity at all the code will not be added."))
            {
                return;
            }
            int changeCount = 0;
            Dictionary <string, string> dictionaryIcd9ToSnomed = Snomeds.GetICD9toSNOMEDDictionary();

            DiseaseDefs.RefreshCache();
            for (int i = 0; i < DiseaseDefs.ListLong.Length; i++)
            {
                if (!dictionaryIcd9ToSnomed.ContainsKey(DiseaseDefs.ListLong[i].ICD9Code))
                {
                    continue;
                }
                DiseaseDef def = DiseaseDefs.ListLong[i];
                if (def.SnomedCode != "")
                {
                    continue;
                }
                def.SnomedCode = dictionaryIcd9ToSnomed[def.ICD9Code];
                DiseaseDefs.Update(def);
                changeCount++;
            }
            MessageBox.Show(Lan.g(this, "SNOMED CT codes added: ") + changeCount);
        }
Exemplo n.º 11
0
        private void butIcd9_Click(object sender, EventArgs e)
        {
            FormIcd9s FormI = new FormIcd9s();

            FormI.IsSelectionMode = true;
            FormI.ShowDialog();
            if (FormI.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (DiseaseDefs.ContainsICD9(FormI.SelectedIcd9.ICD9Code, DiseaseDefCur.DiseaseDefNum))
            {
                MsgBox.Show(this, "ICD-9 code already exists in the problems list.");
                return;
            }
            DiseaseDefCur.ICD9Code = FormI.SelectedIcd9.ICD9Code;
            string i9descript = ICD9s.GetCodeAndDescription(FormI.SelectedIcd9.ICD9Code);

            if (i9descript == "")
            {
                textICD9.Text = FormI.SelectedIcd9.ICD9Code;
            }
            else
            {
                textICD9.Text = i9descript;
            }
        }
Exemplo n.º 12
0
        private void butSnomed_Click(object sender, EventArgs e)
        {
            FormSnomeds FormS = new FormSnomeds();

            FormS.IsSelectionMode = true;
            FormS.ShowDialog();
            if (FormS.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (DiseaseDefs.ContainsSnomed(FormS.SelectedSnomed.SnomedCode, DiseaseDefCur.DiseaseDefNum))            //DiseaseDefNum could be zero
            {
                MsgBox.Show(this, "Snomed code already exists in the problems list.");
                return;
            }
            DiseaseDefCur.SnomedCode = FormS.SelectedSnomed.SnomedCode;
            string sdescript = Snomeds.GetCodeAndDescription(FormS.SelectedSnomed.SnomedCode);

            if (sdescript == "")
            {
                textSnomed.Text = FormS.SelectedSnomed.SnomedCode;
            }
            else
            {
                textSnomed.Text = sdescript;
            }
        }
Exemplo n.º 13
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn("Reminder Criterion", 200);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Message", 200);
            gridMain.Columns.Add(col);
            listReminders = ReminderRules.SelectAll();
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < listReminders.Count; i++)
            {
                row = new ODGridRow();
                switch (listReminders[i].ReminderCriterion)
                {
                case EhrCriterion.Problem:
                    DiseaseDef def = DiseaseDefs.GetItem(listReminders[i].CriterionFK);
                    row.Cells.Add("Problem =" + def.ICD9Code + " " + def.DiseaseName);
                    break;

                case EhrCriterion.Medication:
                    Medication tempMed = Medications.GetMedication(listReminders[i].CriterionFK);
                    if (tempMed.MedicationNum == tempMed.GenericNum)                           //handle generic medication names.
                    {
                        row.Cells.Add("Medication = " + tempMed.MedName);
                    }
                    else
                    {
                        row.Cells.Add("Medication = " + tempMed.MedName + " / " + Medications.GetGenericName(tempMed.GenericNum));
                    }
                    break;

                case EhrCriterion.Allergy:
                    row.Cells.Add("Allergy = " + AllergyDefs.GetOne(listReminders[i].CriterionFK).Description);
                    break;

                case EhrCriterion.Age:
                    row.Cells.Add("Age " + listReminders[i].CriterionValue);
                    break;

                case EhrCriterion.Gender:
                    row.Cells.Add("Gender is " + listReminders[i].CriterionValue);
                    break;

                case EhrCriterion.LabResult:
                    row.Cells.Add("LabResult " + listReminders[i].CriterionValue);
                    break;
                    //case EhrCriterion.ICD9:
                    //  row.Cells.Add("ICD9 "+ICD9s.GetDescription(listReminders[i].CriterionFK));
                    //  break;
                }
                row.Cells.Add(listReminders[i].Message);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemplo n.º 14
0
        private void butProblem_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormDD = new FormDiseaseDefs();

            FormDD.IsSelectionMode = true;
            FormDD.ShowDialog();
            if (FormDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            DiseaseDef dis = DiseaseDefs.GetItem(FormDD.SelectedDiseaseDefNum);

            if (dis.SnomedCode != "")
            {
                textSNOMED.Text = dis.SnomedCode;
            }
            else if (dis.ICD9Code != "")
            {
                textCompareString.Text = dis.ICD9Code;
                MsgBox.Show(this, "Selected problem does not have a valid SNOMED CT code.");
            }
            else
            {
                MsgBox.Show(this, "Selected problem does not have a valid SNOMED CT code.");
            }
        }
Exemplo n.º 15
0
        private void FillProblems()
        {
            DiseaseList = Diseases.Refresh(PatCur.PatNum);
            gridDiseases.BeginUpdate();
            gridDiseases.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableDiseases", "Name"), 140);        //total is about 325

            gridDiseases.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableDiseases", "Patient Note"), 145);
            gridDiseases.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableDisease", "Status"), 40);
            gridDiseases.Columns.Add(col);
            gridDiseases.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < DiseaseList.Count; i++)
            {
                row = new ODGridRow();
                if (DiseaseList[i].DiseaseDefNum != 0)
                {
                    row.Cells.Add(DiseaseDefs.GetName(DiseaseList[i].DiseaseDefNum));
                }
                else
                {
                    row.Cells.Add(ICD9s.GetDescription(DiseaseList[i].ICD9Num));
                }
                row.Cells.Add(DiseaseList[i].PatNote);
                row.Cells.Add(DiseaseList[i].ProbStatus.ToString());
                gridDiseases.Rows.Add(row);
            }
            gridDiseases.EndUpdate();
        }
Exemplo n.º 16
0
 private void FormSheetFieldCheckBox_Load(object sender, EventArgs e)
 {
     _listDiseaseDefs            = DiseaseDefs.GetDeepCopy(true);
     textYPos.MaxVal             = SheetDefCur.HeightTotal - 1;//The maximum y-value of the sheet field must be within the page vertically.
     labelReportableName.Visible = false;
     textReportableName.Visible  = false;
     if (SheetFieldDefCur.FieldName.StartsWith("misc"))
     {
         labelReportableName.Visible = true;
         textReportableName.Visible  = true;
         textReportableName.Text     = SheetFieldDefCur.ReportableName;
     }
     if (IsReadOnly)
     {
         butOK.Enabled     = false;
         butDelete.Enabled = false;
     }
     //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
     AvailFields    = SheetFieldsAvailable.GetList(SheetDefCur.SheetType, OutInCheck.Check);
     isMedHistSheet = SheetDefCur.SheetType == SheetTypeEnum.MedicalHistory;
     listFields.Items.Clear();
     for (int i = 0; i < AvailFields.Count; i++)
     {
         //static text is not one of the options.
         listFields.Items.Add(AvailFields[i].FieldName);
         //Sheets will have dynamic field names like "allergy:Pen".  They will always start with a valid FieldName.
         if (SheetFieldDefCur.FieldName.StartsWith(AvailFields[i].FieldName))
         {
             listFields.SelectedIndex = i;
         }
     }
     if (isMedHistSheet)
     {
         radioYes.Checked = true;
         if (SheetFieldDefCur.FieldName.StartsWith("allergy:"))
         {
             FillListMedical(MedicalListType.allergy);
             SetListMedicalSelectedIndex(MedicalListType.allergy, SheetFieldDefCur.FieldName.Remove(0, 8));
         }
         else if (SheetFieldDefCur.FieldName.StartsWith("problem:"))
         {
             FillListMedical(MedicalListType.problem);
             SetListMedicalSelectedIndex(MedicalListType.problem, SheetFieldDefCur.FieldName.Remove(0, 8));
         }
         if (SheetFieldDefCur.RadioButtonValue == "N")
         {
             radioNo.Checked  = true;
             radioYes.Checked = false;
         }
     }
     textXPos.Text           = SheetFieldDefCur.XPos.ToString();
     textYPos.Text           = SheetFieldDefCur.YPos.ToString();
     textWidth.Text          = SheetFieldDefCur.Width.ToString();
     textHeight.Text         = SheetFieldDefCur.Height.ToString();
     textRadioGroupName.Text = SheetFieldDefCur.RadioButtonGroup;
     checkRequired.Checked   = SheetFieldDefCur.IsRequired;
     textTabOrder.Text       = SheetFieldDefCur.TabOrder.ToString();
 }
Exemplo n.º 17
0
        private void RxSelected()
        {
            if (gridMain.GetSelectedIndex() == -1)
            {
                //this should never happen
                return;
            }
            RxDef RxDefCur = RxDefList[gridMain.GetSelectedIndex()];

            //Alert
            RxAlert[] alertList = RxAlerts.Refresh(RxDefCur.RxDefNum);
            Disease[] diseases  = Diseases.Refresh(PatCur.PatNum);
            ArrayList matchAL   = new ArrayList();

            for (int i = 0; i < alertList.Length; i++)
            {
                for (int j = 0; j < diseases.Length; j++)
                {
                    if (alertList[i].DiseaseDefNum == diseases[j].DiseaseDefNum)
                    {
                        matchAL.Add(DiseaseDefs.GetName(diseases[j].DiseaseDefNum));
                    }
                }
            }
            if (matchAL.Count > 0)
            {
                string alert = Lan.g(this, "This patient has the following medical conditions or allergies:\r\n");
                for (int i = 0; i < matchAL.Count; i++)
                {
                    alert += "\r\n" + matchAL[i];
                }
                alert += "\r\n\r\n" + Lan.g(this, "Continue anyway?");
                if (MessageBox.Show(alert, "Alert", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) != DialogResult.OK)
                {
                    return;
                }
            }
            //User OK with alert
            RxPat RxPatCur = new RxPat();

            RxPatCur.RxDate  = DateTime.Today;
            RxPatCur.PatNum  = PatCur.PatNum;
            RxPatCur.Drug    = RxDefCur.Drug;
            RxPatCur.Sig     = RxDefCur.Sig;
            RxPatCur.Disp    = RxDefCur.Disp;
            RxPatCur.Refills = RxDefCur.Refills;
            //Notes not copied: we don't want these kinds of notes cluttering things
            FormRxEdit FormE = new FormRxEdit(PatCur, RxPatCur);

            FormE.IsNew = true;
            FormE.ShowDialog();
            if (FormE.DialogResult != DialogResult.OK)
            {
                return;
            }
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 18
0
 private void FillAlerts()
 {
     RxAlertList = RxAlerts.Refresh(RxDefCur.RxDefNum);
     listAlerts.Items.Clear();
     for (int i = 0; i < RxAlertList.Length; i++)
     {
         listAlerts.Items.Add(DiseaseDefs.GetName(RxAlertList[i].DiseaseDefNum));
     }
 }
Exemplo n.º 19
0
        private void butAddExist_Click(object sender, EventArgs e)
        {
            if (gridProbExisting.SelectedIndices.Length == 0)
            {
                MsgBox.Show(this, "A row must be selected to add");
                return;
            }
            Disease    dis;
            DiseaseDef disD;
            int        skipCount = 0;
            bool       isValid;

            for (int i = 0; i < gridProbExisting.SelectedIndices.Length; i++)
            {
                isValid = true;
                //Since gridProbImport and ListProblemPatNew are a 1:1 list we can use the selected index position to get our dis
                dis  = _listProblemCur[gridProbExisting.SelectedIndices[i]];
                disD = DiseaseDefs.GetItem(dis.DiseaseDefNum);
                for (int j = 0; j < _listProblemReconcile.Count; j++)
                {
                    if (_listProblemCur[j].IsNew)
                    {
                        for (int k = 0; k < ListProblemDefNew.Count; k++)
                        {
                            if (disD.SnomedCode != "" && disD.SnomedCode == ListProblemDefNew[k].SnomedCode)
                            {
                                isValid = false;
                                skipCount++;
                                break;
                            }
                        }
                    }
                    if (!isValid)
                    {
                        break;
                    }
                    if (dis.DiseaseDefNum == _listProblemReconcile[j].DiseaseDefNum)
                    {
                        isValid = false;
                        skipCount++;
                        break;
                    }
                }
                if (isValid)
                {
                    _listProblemReconcile.Add(dis);
                }
            }
            if (skipCount > 0)
            {
                MessageBox.Show(Lan.g(this, " Row(s) skipped because problem already present in the reconcile list") + ": " + skipCount);
            }
            FillReconcileGrid();
        }
Exemplo n.º 20
0
        private void FillGrid()
        {
            DiseaseDefs.RefreshCache();
            //listMain.SelectionMode=SelectionMode.MultiExtended;
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn(Lan.g(this, "ICD-9"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "ICD-10"), 50);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "SNOMED CT"), 100);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Description"), 250);
            gridMain.Columns.Add(col);
            if (!IsSelectionMode)
            {
                col = new ODGridColumn(Lan.g(this, "Hidden"), 50);
                gridMain.Columns.Add(col);
            }
            gridMain.Rows.Clear();
            ODGridRow row;

            if (IsSelectionMode)
            {
                for (int i = 0; i < DiseaseDefs.List.Length; i++)
                {
                    row = new ODGridRow();
                    row.Cells.Add(DiseaseDefs.List[i].ICD9Code);
                    row.Cells.Add(DiseaseDefs.List[i].Icd10Code);
                    row.Cells.Add(DiseaseDefs.List[i].SnomedCode);
                    row.Cells.Add(DiseaseDefs.List[i].DiseaseName);
                    gridMain.Rows.Add(row);
                }
            }
            else              //Not selection mode - show hidden
            {
                for (int i = 0; i < DiseaseDefs.ListLong.Length; i++)
                {
                    row = new ODGridRow();
                    row.Cells.Add(DiseaseDefs.ListLong[i].ICD9Code);
                    row.Cells.Add(DiseaseDefs.List[i].Icd10Code);
                    row.Cells.Add(DiseaseDefs.ListLong[i].SnomedCode);
                    row.Cells.Add(DiseaseDefs.ListLong[i].DiseaseName);
                    row.Cells.Add(DiseaseDefs.ListLong[i].IsHidden?"X":"");
                    gridMain.Rows.Add(row);
                }
            }
            gridMain.EndUpdate();
        }
Exemplo n.º 21
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     DiseaseDefCur.DiseaseName = textName.Text;
     DiseaseDefCur.IsHidden    = checkIsHidden.Checked;
     if (IsNew)
     {
         DiseaseDefs.Insert(DiseaseDefCur);
     }
     else
     {
         DiseaseDefs.Update(DiseaseDefCur);
     }
     DialogResult = DialogResult.OK;
 }
Exemplo n.º 22
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     try{
         DiseaseDefs.Delete(DiseaseDefCur);
         DialogResult = DialogResult.OK;
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 23
0
 private void FormDiseaseDefs_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_isChanged)
     {
         DiseaseDefs.Sync(_listDiseaseDefs, _listDiseaseDefsOld);               //Update if anything has changed, even in selection mode.
         //old securitylog pattern pasted from FormDiseaseDefEdit
         _listSecurityLogMsgs.FindAll(x => !string.IsNullOrEmpty(x)).ForEach(x => SecurityLogs.MakeLogEntry(Permissions.ProblemEdit, 0, x));
         DataValid.SetInvalid(InvalidType.Diseases);                //refreshes cache
     }
     ListSelectedDiseaseDefs.Clear();
     for (int i = 0; i < gridMain.SelectedIndices.Count(); i++)
     {
         ListSelectedDiseaseDefs.Add((DiseaseDef)(gridMain.ListGridRows[gridMain.SelectedIndices[i]].Tag));
     }
 }
Exemplo n.º 24
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     try{
         DiseaseDefs.Delete(DiseaseDefCur);
         SecurityLogs.MakeLogEntry(Permissions.ProblemEdit, 0, DiseaseDefCur.DiseaseName + " deleted.");
         DialogResult = DialogResult.OK;
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 25
0
        private void FillGrid()
        {
            DiseaseDefs.Refresh();
            listMain.Items.Clear();
            string s;

            for (int i = 0; i < DiseaseDefs.ListLong.Length; i++)
            {
                s = DiseaseDefs.ListLong[i].DiseaseName;
                if (DiseaseDefs.ListLong[i].IsHidden)
                {
                    s += " " + Lan.g(this, "(hidden)");
                }
                listMain.Items.Add(s);
            }
        }
Exemplo n.º 26
0
        ///<summary>Adds a new disease. New diseases get blank (not null) fields for ICD9, ICD10, and SnoMedCodes
        ///if they are not specified from FormDiseaseDefEdit so that we can do string searches on them.</summary>
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.ProblemEdit))
            {
                return;
            }
            //initialise the new DiseaseDef with blank fields instead of null so we can filter on them.
            DiseaseDef def = new DiseaseDef()
            {
                ICD9Code   = "",
                Icd10Code  = "",
                SnomedCode = "",
                ItemOrder  = DiseaseDefs.GetCount()
            };
            FormDiseaseDefEdit FormD = new FormDiseaseDefEdit(def, true);         //also sets ItemOrder correctly if using alphabetical during the insert diseaseDef call.

            FormD.IsNew = true;
            FormD.ShowDialog();
            if (FormD.DialogResult != DialogResult.OK)
            {
                return;
            }
            _listSecurityLogMsgs.Add(FormD.SecurityLogMsgText);
            //Need to invalidate cache for selection mode so that the new problem shows up.
            if (IsSelectionMode)
            {
                //In Middle Tier, the Sync in FormClosing() was not updating the PKs for the objects in each row tag for gridMain.
                //This was the assumption of what would happen to retain selection when going back to the calling form (ex. FormMedical).
                //As a result, any new defs added here did not have a PK when being sent to the calling form via grid.SelectedTags and threw a UE.
                DiseaseDefs.Insert(FormD.DiseaseDefCur);
                DataValid.SetInvalid(InvalidType.Diseases);
                //No need to re-order as the ItemOrder given is already at the end of the list, and you can't change item order in selection mode.
                _listDiseaseDefsOld.Add(FormD.DiseaseDefCur);
                _listDiseaseDefs.Add(FormD.DiseaseDefCur);
                //Sync on FormClosing() will not happen; we don't need it since Adding a new DiseaseDef is the only change user can make in SelectionMode.
            }
            else
            {
                //Items are already in the right order in the DB, re-order in memory list to match
                _listDiseaseDefs.FindAll(x => x.ItemOrder >= def.ItemOrder).ForEach(x => x.ItemOrder++);
                _listDiseaseDefs.Add(def);
                _listDiseaseDefs.Sort(DiseaseDefs.SortItemOrder);
                _isChanged = true;
            }
            FillGrid();
        }
Exemplo n.º 27
0
        private void butIcd10_Click(object sender, EventArgs e)
        {
            FormIcd10s FormI = new FormIcd10s();

            FormI.IsSelectionMode = true;
            FormI.ShowDialog();
            if (FormI.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (DiseaseDefs.ContainsIcd10(FormI.SelectedIcd10.Icd10Code, DiseaseDefCur.DiseaseDefNum))
            {
                MsgBox.Show(this, "ICD-10 code already exists in the problems list.");
                return;
            }
            DiseaseDefCur.Icd10Code = FormI.SelectedIcd10.Icd10Code;
            textIcd10.Text          = FormI.SelectedIcd10.Icd10Code + "-" + FormI.SelectedIcd10.Description;
        }
Exemplo n.º 28
0
 private void FormEduResourceEdit_Load(object sender, EventArgs e)
 {
     if (EduResourceCur.DiseaseDefNum != 0)
     {
         DiseaseDef def = DiseaseDefs.GetItem(EduResourceCur.DiseaseDefNum);
         textProblem.Text = def.DiseaseName;
         textICD9.Text    = ICD9s.GetCodeAndDescription(def.ICD9Code);
         textSnomed.Text  = Snomeds.GetCodeAndDescription(def.SnomedCode);
     }
     else if (EduResourceCur.MedicationNum != 0)
     {
         textMedication.Text = Medications.GetDescription(EduResourceCur.MedicationNum);
     }
     textLabResultsID.Text = EduResourceCur.LabResultID;
     textLabTestName.Text  = EduResourceCur.LabResultName;
     textCompareValue.Text = EduResourceCur.LabResultCompare;
     textUrl.Text          = EduResourceCur.ResourceUrl;
 }
Exemplo n.º 29
0
 private void FormFamilyHealthEdit_Load(object sender, EventArgs e)
 {
     string[] familyRelationships = Enum.GetNames(typeof(FamilyRelationship));
     for (int i = 0; i < familyRelationships.Length; i++)
     {
         listRelationship.Items.Add(Lan.g("enumFamilyRelationship", familyRelationships[i]));
     }
     listRelationship.SelectedIndex = (int)FamilyHealthCur.Relationship;
     if (FamilyHealthCur.IsNew)
     {
         return;                 //Don't need to set any of the info below.  All null.
     }
     DisDefCur = DiseaseDefs.GetItem(FamilyHealthCur.DiseaseDefNum);
     //Validation is done when deleting diseaseDefs to make sure they are not in use by FamilyHealths.
     textProblem.Text = DisDefCur.DiseaseName;
     textSnomed.Text  = DisDefCur.SnomedCode;
     textName.Text    = FamilyHealthCur.PersonName;
 }
Exemplo n.º 30
0
        private void FillGridEdu()
        {
            gridEdu.BeginUpdate();
            gridEdu.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Criteria", 300);

            gridEdu.Columns.Add(col);
            col = new ODGridColumn("Link", 100);
            gridEdu.Columns.Add(col);
            eduResourceList = EduResources.GenerateForPatient(patCur.PatNum);
            gridEdu.Rows.Clear();
            ODGridRow row;

            foreach (EduResource eduResCur in eduResourceList)
            {
                row = new ODGridRow();
                if (eduResCur.DiseaseDefNum != 0)
                {
                    row.Cells.Add("Problem: " + DiseaseDefs.GetItem(eduResCur.DiseaseDefNum).DiseaseName);
                    //row.Cells.Add("ICD9: "+DiseaseDefs.GetItem(eduResCur.DiseaseDefNum).ICD9Code);
                }
                else if (eduResCur.MedicationNum != 0)
                {
                    row.Cells.Add("Medication: " + Medications.GetDescription(eduResCur.MedicationNum));
                }
                else if (eduResCur.SmokingSnoMed != "")
                {
                    Snomed sCur        = Snomeds.GetByCode(eduResCur.SmokingSnoMed);
                    string criteriaCur = "Tobacco Use Assessment: ";
                    if (sCur != null)
                    {
                        criteriaCur += sCur.Description;
                    }
                    row.Cells.Add(criteriaCur);
                }
                else
                {
                    row.Cells.Add("Lab Results: " + eduResCur.LabResultName);
                }
                row.Cells.Add(eduResCur.ResourceUrl);
                gridEdu.Rows.Add(row);
            }
            gridEdu.EndUpdate();
        }