Exemple #1
0
 private void SaveAndClose()
 {
     DiseaseCur.DiseaseDefNum = DiseaseDefs.List[listMain.SelectedIndex].DiseaseDefNum;
     DiseaseCur.PatNote       = textNote.Text;
     if (IsNew)
     {
         Diseases.Insert(DiseaseCur);
     }
     else
     {
         Diseases.Update(DiseaseCur);
     }
     DialogResult = DialogResult.OK;
 }
Exemple #2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDateStart.errorProvider1.GetError(textDateStart) != "" ||
         textDateStop.errorProvider1.GetError(textDateStop) != "")
     {
         MsgBox.Show(this, "Please fix date.");
         return;
     }
     DiseaseCur.DateStart  = PIn.Date(textDateStart.Text);
     DiseaseCur.DateStop   = PIn.Date(textDateStop.Text);
     DiseaseCur.ProbStatus = (ProblemStatus)comboStatus.SelectedIndex;
     DiseaseCur.PatNote    = textNote.Text;
     //Todo: Save DateStop and DateStart values.
     if (IsNew)
     {
         Diseases.Insert(DiseaseCur);
     }
     else
     {
         Diseases.Update(DiseaseCur);
     }
     DialogResult = DialogResult.OK;
 }
        private void butOK_Click(object sender, EventArgs e)
        {
            if (_listProblemReconcile.Count == 0)
            {
                if (!MsgBox.Show(this, true, "The reconcile list is empty which will cause all existing problems to be removed.  Continue?"))
                {
                    return;
                }
            }
            Disease    dis;
            DiseaseDef disD;
            bool       isActive;

            //Discontinue any current medications that are not present in the reconcile list.
            for (int i = 0; i < _listProblemCur.Count; i++)       //Start looping through all current problems
            {
                isActive = false;
                dis      = _listProblemCur[i];
                disD     = DiseaseDefs.GetItem(dis.DiseaseDefNum);
                for (int j = 0; j < _listProblemReconcile.Count; j++)           //Compare each reconcile problem to the current problem
                {
                    DiseaseDef disDR = DiseaseDefs.GetItem(_listProblemReconcile[j].DiseaseDefNum);
                    if (_listProblemReconcile[j].DiseaseDefNum == _listProblemCur[i].DiseaseDefNum)                   //Has identical DiseaseDefNums
                    {
                        isActive = true;
                        break;
                    }
                    if (disDR == null)
                    {
                        continue;
                    }
                    if (disDR.SnomedCode != "" && disDR.SnomedCode == disD.SnomedCode)                 //Has a Snomed code and they are equal
                    {
                        isActive = true;
                        break;
                    }
                }
                if (!isActive)                 //Update current problems.
                {
                    dis.ProbStatus = ProblemStatus.Inactive;
                    Diseases.Update(_listProblemCur[i]);
                }
            }
            //Always update every current problem for the patient so that DateTStamp reflects the last reconcile date.
            if (_listProblemCur.Count > 0)
            {
                Diseases.ResetTimeStamps(_patCur.PatNum, ProblemStatus.Active);
            }
            DiseaseDef disDU = null;
            int        index;

            for (int j = 0; j < _listProblemReconcile.Count; j++)
            {
                index = ListProblemNew.IndexOf(_listProblemReconcile[j]);
                if (index < 0)
                {
                    continue;
                }
                if (_listProblemReconcile[j] == ListProblemNew[index])
                {
                    disDU = DiseaseDefs.GetItem(DiseaseDefs.GetNumFromCode(ListProblemDefNew[index].SnomedCode));
                    if (disDU == null)
                    {
                        ListProblemNew[index].DiseaseDefNum = DiseaseDefs.Insert(ListProblemDefNew[index]);
                    }
                    else
                    {
                        ListProblemNew[index].DiseaseDefNum = disDU.DiseaseDefNum;
                    }
                    Diseases.Insert(ListProblemNew[index]);
                }
            }
            DataValid.SetInvalid(InvalidType.Diseases);
            //EhrMeasureEvent newMeasureEvent = new EhrMeasureEvent();
            //newMeasureEvent.DateTEvent=DateTime.Now;
            //newMeasureEvent.EventType=EhrMeasureEventType.ProblemReconcile;
            //newMeasureEvent.PatNum=PatCur.PatNum;
            //newMeasureEvent.MoreInfo="";
            //EhrMeasureEvents.Insert(newMeasureEvent);
            for (int inter = 0; inter < _listProblemReconcile.Count; inter++)
            {
                if (CDSPermissions.GetForUser(Security.CurUser.UserNum).ShowCDS&& CDSPermissions.GetForUser(Security.CurUser.UserNum).ProblemCDS)
                {
                    DiseaseDef          disDInter = DiseaseDefs.GetItem(_listProblemReconcile[inter].DiseaseDefNum);
                    FormCDSIntervention FormCDSI  = new FormCDSIntervention();
                    FormCDSI.ListCDSI = EhrTriggers.TriggerMatch(disDInter, _patCur);
                    FormCDSI.ShowIfRequired(false);
                }
            }
            DialogResult = DialogResult.OK;
        }
Exemple #4
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDateStart.errorProvider1.GetError(textDateStart) != "" ||
         textDateStop.errorProvider1.GetError(textDateStop) != "")
     {
         MsgBox.Show(this, "Please fix date.");
         return;
     }
     DiseaseCur.DateStart  = PIn.Date(textDateStart.Text);
     DiseaseCur.DateStop   = PIn.Date(textDateStop.Text);
     DiseaseCur.ProbStatus = (ProblemStatus)comboStatus.SelectedIndex;
     DiseaseCur.PatNote    = textNote.Text;
     if (comboSnomedProblemType.SelectedIndex == 1)           //Finding
     {
         DiseaseCur.SnomedProblemType = "404684003";
     }
     else if (comboSnomedProblemType.SelectedIndex == 2)           //Complaint
     {
         DiseaseCur.SnomedProblemType = "409586006";
     }
     else if (comboSnomedProblemType.SelectedIndex == 3)           //Dignosis
     {
         DiseaseCur.SnomedProblemType = "282291009";
     }
     else if (comboSnomedProblemType.SelectedIndex == 4)           //Condition
     {
         DiseaseCur.SnomedProblemType = "64572001";
     }
     else if (comboSnomedProblemType.SelectedIndex == 5)           //FunctionalLimitation
     {
         DiseaseCur.SnomedProblemType = "248536006";
     }
     else if (comboSnomedProblemType.SelectedIndex == 6)           //Symptom
     {
         DiseaseCur.SnomedProblemType = "418799008";
     }
     else              //Problem
     {
         DiseaseCur.SnomedProblemType = "55607006";
     }
     DiseaseCur.FunctionStatus = (FunctionalStatus)comboEhrFunctionalStatus.SelectedIndex;
     if (IsNew)
     {
         //This code is never hit in current implementation 09/26/2013.
         Diseases.Insert(DiseaseCur);
         SecurityLogs.MakeLogEntry(Permissions.PatProblemListEdit, DiseaseCur.PatNum, DiseaseDefs.GetName(DiseaseCur.DiseaseDefNum) + " added");
     }
     else
     {
         //See if this problem is the pregnancy linked to a vitalsign exam
         List <Vitalsign> listVitalsAttached = Vitalsigns.GetListFromPregDiseaseNum(DiseaseCur.DiseaseNum);
         if (listVitalsAttached.Count > 0)
         {
             //See if the vitalsign exam date is now outside of the active dates of the disease (pregnancy)
             string dates = "";
             for (int i = 0; i < listVitalsAttached.Count; i++)
             {
                 if (listVitalsAttached[i].DateTaken < DiseaseCur.DateStart || (DiseaseCur.DateStop.Year > 1880 && listVitalsAttached[i].DateTaken > DiseaseCur.DateStop))
                 {
                     dates += "\r\n" + listVitalsAttached[i].DateTaken.ToShortDateString();
                 }
             }
             //If vitalsign exam is now outside the dates of the problem, tell the user they must fix the dates of the pregnancy dx
             if (dates.Length > 0)
             {
                 MsgBox.Show(this, "This problem is attached to 1 or more vital sign exams as a pregnancy diagnosis with dates:" + dates + "\r\nNot allowed to change the active dates of the diagnosis to be outside the dates of the exam(s).  You must first remove the diagnosis from the vital sign exam(s).");
                 return;
             }
         }
         Diseases.Update(DiseaseCur);
         SecurityLogs.MakeLogEntry(Permissions.PatProblemListEdit, DiseaseCur.PatNum, DiseaseDefs.GetName(DiseaseCur.DiseaseDefNum) + " edited");
     }
     DialogResult = DialogResult.OK;
 }