Ejemplo n.º 1
0
        private void butProblem_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormDD = new FormDiseaseDefs();

            FormDD.IsSelectionMode = true;
            FormDD.ShowDialog();
            if (FormDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            //the list should only ever contain one item.
            DiseaseDef dis = FormDD.ListSelectedDiseaseDefs[0];

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

            FormDD.IsSelectionMode = true;
            FormDD.ShowDialog();
            if (FormDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            //the list should only ever contain one item.
            DiseaseDef diseaseDef = FormDD.ListSelectedDiseaseDefs[0];

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

            FormDD.IsSelectionMode = true;
            FormDD.ShowDialog();
            if (FormDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            //the list should only ever contain one item.
            DiseaseDef disCur = FormDD.ListSelectedDiseaseDefs[0];

            if (disCur == null)
            {
                return;
            }
            EduResourceCur.DiseaseDefNum    = disCur.DiseaseDefNum;
            EduResourceCur.MedicationNum    = 0;
            EduResourceCur.SmokingSnoMed    = "";
            EduResourceCur.LabResultID      = "";
            EduResourceCur.LabResultName    = "";
            EduResourceCur.LabResultCompare = "";
            textProblem.Text           = disCur.DiseaseName;
            textICD9.Text              = ICD9s.GetCodeAndDescription(disCur.ICD9Code);
            textSnomed.Text            = Snomeds.GetCodeAndDescription(disCur.SnomedCode);
            textMedication.Text        = "";
            textTobaccoAssessment.Text = "";
            textLabResultsID.Text      = "";
            textLabTestName.Text       = "";
            textCompareValue.Text      = "";
        }
Ejemplo n.º 4
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        = "";
        }
Ejemplo n.º 5
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.");
            }
        }
Ejemplo n.º 6
0
        private void butSelectFK_Click(object sender, EventArgs e)
        {
            switch ((EhrCriterion)comboReminderCriterion.SelectedIndex)
            {
            case EhrCriterion.Problem:
                FormDiseaseDefs formD = new FormDiseaseDefs();
                formD.IsSelectionMode = true;
                formD.ShowDialog();
                if (formD.DialogResult != DialogResult.OK)
                {
                    RuleCur.CriterionFK = -1;
                    return;
                }
                RuleCur.CriterionFK = formD.SelectedDiseaseDefNum;
                break;

            case EhrCriterion.Medication:
                FormMedications formM = new FormMedications();
                formM.IsSelectionMode = true;
                formM.ShowDialog();
                if (formM.DialogResult != DialogResult.OK)
                {
                    RuleCur.CriterionFK = -1;
                    return;
                }
                RuleCur.CriterionFK = formM.SelectedMedicationNum;
                break;

            case EhrCriterion.Allergy:
                FormAllergySetup formA = new FormAllergySetup();
                formA.IsSelectionMode = true;
                formA.ShowDialog();
                if (formA.DialogResult != DialogResult.OK)
                {
                    RuleCur.CriterionFK = -1;
                    return;
                }
                RuleCur.CriterionFK = formA.SelectedAllergyDefNum;
                break;

            case EhrCriterion.ICD9:
                FormIcd9s FormICD9Select = new FormIcd9s();
                FormICD9Select.IsSelectionMode = true;
                FormICD9Select.ShowDialog();
                if (FormICD9Select.DialogResult != DialogResult.OK)
                {
                    RuleCur.CriterionFK = -1;
                    return;
                }
                RuleCur.CriterionFK = FormICD9Select.SelectedIcd9Num;
                break;

            default:
                MessageBox.Show("You should never see this error message. Something has stopped working properly.");
                break;
            }
            FillFK();
        }
		private void butPick_Click(object sender,EventArgs e) {
			FormDiseaseDefs FormD=new FormDiseaseDefs();
			FormD.IsSelectionMode=true;
			FormD.ShowDialog();
			if(FormD.DialogResult!=DialogResult.OK) {
				return;
			}
			DiseaseDef disDef=DiseaseDefs.GetItem(FormD.SelectedDiseaseDefNum);
			if(disDef.SnomedCode=="") {
				MsgBox.Show(this,"Selection must have a SNOMED CT code associated");
				return;
			}
			textProblem.Text=disDef.DiseaseName;
			textSnomed.Text=disDef.SnomedCode;
			DisDefCur=disDef;
		}
Ejemplo n.º 8
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormD = new FormDiseaseDefs();

            FormD.IsSelectionMode = true;
            FormD.ShowDialog();
            if (FormD.DialogResult != DialogResult.OK)
            {
                return;
            }
            RxAlert alert = new RxAlert();

            alert.DiseaseDefNum = FormD.SelectedDiseaseDefNum;
            alert.RxDefNum      = RxDefCur.RxDefNum;
            RxAlerts.Insert(alert);
            FillAlerts();
        }
Ejemplo n.º 9
0
        private void butAddProblem_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs formDD = new FormDiseaseDefs();

            formDD.IsSelectionMode = true;
            formDD.ShowDialog();
            if (formDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            Disease disease = new Disease();

            disease.PatNum        = PatCur.PatNum;
            disease.DiseaseDefNum = formDD.SelectedDiseaseDefNum;
            Diseases.Insert(disease);
            FillProblems();
        }
Ejemplo n.º 10
0
        private void butProblemSelect_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormDD = new FormDiseaseDefs();

            FormDD.IsSelectionMode = true;
            FormDD.ShowDialog();
            if (FormDD.DialogResult != DialogResult.OK)
            {
                return;
            }
            textProblem.Text             = DiseaseDefs.GetName(FormDD.SelectedDiseaseDefNum);
            EduResourceCur.DiseaseDefNum = FormDD.SelectedDiseaseDefNum;
            textICD9.Text                = "";
            EduResourceCur.Icd9Num       = 0;
            textMedication.Text          = "";
            EduResourceCur.MedicationNum = 0;
            textLabResultsID.Text        = "";
            textLabTestName.Text         = "";
            textCompareValue.Text        = "";
        }
Ejemplo n.º 11
0
        private void butAddProblem_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormD = new FormDiseaseDefs();

            FormD.IsSelectionMode = true;
            FormD.IsMultiSelect   = true;
            FormD.ShowDialog();
            if (FormD.DialogResult != DialogResult.OK)
            {
                return;
            }
            for (int i = 0; i < FormD.ListSelectedDiseaseDefs.Count; i++)
            {
                RxAlert alert = new RxAlert();
                alert.DiseaseDefNum = FormD.ListSelectedDiseaseDefs[i].DiseaseDefNum;
                alert.RxDefNum      = RxDefCur.RxDefNum;
                RxAlerts.Insert(alert);
            }
            FillAlerts();
        }
Ejemplo n.º 12
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="";
		}
Ejemplo n.º 13
0
        private void butPick_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormD = new FormDiseaseDefs();

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

            if (disDef.SnomedCode == "")
            {
                MsgBox.Show(this, "Selection must have a SNOMED CT code associated");
                return;
            }
            textProblem.Text = disDef.DiseaseName;
            textSnomed.Text  = disDef.SnomedCode;
            DisDefCur        = disDef;
        }
Ejemplo n.º 14
0
        private void butPick_Click(object sender, EventArgs e)
        {
            FormDiseaseDefs FormD = new FormDiseaseDefs();

            FormD.IsSelectionMode = true;
            FormD.ShowDialog();
            if (FormD.DialogResult != DialogResult.OK)
            {
                return;
            }
            //the list should only ever contain one item.
            DiseaseDef disDef = FormD.ListSelectedDiseaseDefs[0];

            if (disDef.SnomedCode == "")
            {
                MsgBox.Show(this, "Selection must have a SNOMED CT code associated");
                return;
            }
            textProblem.Text = disDef.DiseaseName;
            textSnomed.Text  = disDef.SnomedCode;
            DisDefCur        = disDef;
        }
Ejemplo n.º 15
0
 private void menuItemProblems_Click(object sender,EventArgs e)
 {
     if(!Security.IsAuthorized(Permissions.Setup)) {
         return;
     }
     FormDiseaseDefs FormD=new FormDiseaseDefs();
     FormD.ShowDialog();
     //RefreshCurrentModule();
     SecurityLogs.MakeLogEntry(Permissions.Setup,0,"Disease Defs");
 }
Ejemplo n.º 16
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();
		}
Ejemplo n.º 17
0
		private void butSelectFK_Click(object sender,EventArgs e) {
			switch((EhrCriterion)comboReminderCriterion.SelectedIndex) {
				case EhrCriterion.Problem:
					FormDiseaseDefs formD=new FormDiseaseDefs();
					formD.IsSelectionMode=true;
					formD.ShowDialog();
					if(formD.DialogResult!=DialogResult.OK) {
						RuleCur.CriterionFK=-1;
						return;
					}
					RuleCur.CriterionFK=formD.SelectedDiseaseDefNum;
					break;
				case EhrCriterion.Medication:
					FormMedications formM=new FormMedications();
					formM.IsSelectionMode=true;
					formM.ShowDialog();
					if(formM.DialogResult!=DialogResult.OK) {
						RuleCur.CriterionFK=-1;
						return;
					}
					RuleCur.CriterionFK=formM.SelectedMedicationNum;
					break;
				case EhrCriterion.Allergy:
					FormAllergySetup formA=new FormAllergySetup();
					formA.IsSelectionMode=true;
					formA.ShowDialog();
					if(formA.DialogResult!=DialogResult.OK) {
						RuleCur.CriterionFK=-1;
						return;
					}
					RuleCur.CriterionFK=formA.SelectedAllergyDefNum;
					break;
				//case EhrCriterion.ICD9:
				//  FormIcd9s FormICD9Select = new FormIcd9s();
				//  FormICD9Select.IsSelectionMode=true;
				//  FormICD9Select.ShowDialog();
				//  if(FormICD9Select.DialogResult!=DialogResult.OK){
				//    RuleCur.CriterionFK=-1;
				//    return;
				//  }
				//  RuleCur.CriterionFK=ICD9s.GetByCode(FormICD9Select.SelectedIcd9Code).ICD9Num;
				//  break;
				default:
					MessageBox.Show("You should never see this error message. Something has stopped working properly.");
					break;
			}
			FillFK();
		}
		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.");
			}
		}
Ejemplo n.º 19
0
		private void butAddProblem_Click(object sender,EventArgs e) {
			FormDiseaseDefs formDD=new FormDiseaseDefs();
			formDD.IsSelectionMode=true;
			formDD.IsMultiSelect=true;
			formDD.ShowDialog();
			if(formDD.DialogResult!=DialogResult.OK) {
				return;
			}
			for(int i=0;i<formDD.SelectedDiseaseDefNums.Count;i++) {
				if(CDSPermissions.GetForUser(Security.CurUser.UserNum).ShowCDS && CDSPermissions.GetForUser(Security.CurUser.UserNum).ProblemCDS){
					FormCDSIntervention FormCDSI=new FormCDSIntervention();
					FormCDSI.ListCDSI=EhrTriggers.TriggerMatch(DiseaseDefs.GetItem(formDD.SelectedDiseaseDefNums[i]),PatCur);
					FormCDSI.ShowIfRequired();
					if(FormCDSI.DialogResult==DialogResult.Abort) {
						continue;//cancel 
					}
				}
				SecurityLogs.MakeLogEntry(Permissions.PatProblemListEdit,PatCur.PatNum,DiseaseDefs.GetName(formDD.SelectedDiseaseDefNums[i])+" added"); //Audit log made outside form because the form is just a list of problems and is called from many places.
				Disease disease=new Disease();
				disease.PatNum=PatCur.PatNum;
				disease.DiseaseDefNum=formDD.SelectedDiseaseDefNums[i];
				Diseases.Insert(disease);
			}
			FillProblems();
		}
Ejemplo n.º 20
0
		private void butProblemsIndicateNone_Click(object sender,EventArgs e) {
			FormDiseaseDefs formD=new FormDiseaseDefs();
			formD.IsSelectionMode=true;
			formD.ShowDialog();
			if(formD.DialogResult!=DialogResult.OK) {
				return;
			}
			if(Prefs.UpdateLong(PrefName.ProblemsIndicateNone,formD.SelectedDiseaseDefNum)) {
				_changed=true;
			}
			textProblemsIndicateNone.Text=DiseaseDefs.GetName(formD.SelectedDiseaseDefNum);
		}
Ejemplo n.º 21
0
		private void butAddProblem_Click(object sender,EventArgs e) {
			FormDiseaseDefs FormD=new FormDiseaseDefs();
			FormD.IsSelectionMode=true;
			FormD.IsMultiSelect=true;
			FormD.ShowDialog();
			if(FormD.DialogResult!=DialogResult.OK) {
				return;
			}
			for(int i=0;i<FormD.SelectedDiseaseDefNums.Count;i++) {
				RxAlert alert=new RxAlert();
				alert.DiseaseDefNum=FormD.SelectedDiseaseDefNums[i];
				alert.RxDefNum=RxDefCur.RxDefNum;
				RxAlerts.Insert(alert);
			}
			FillAlerts();
		}
Ejemplo n.º 22
0
		//private void butProbPick_Click(object sender,EventArgs e) {
		//	FormDiseaseDefs FormDD = new FormDiseaseDefs();
		//	FormDD.IsSelectionMode=true;
		//	FormDD.ShowDialog();
		//	if(FormDD.DialogResult!=DialogResult.OK) {
		//		return;
		//	}
		//	//ProblemCur=DiseaseDefs.GetItem(FormDD.SelectedDiseaseDefNum);
		//	//fillProblem();
		//}

		private void butAddDisease_Click(object sender,EventArgs e) {
			FormDiseaseDefs FormDD = new FormDiseaseDefs();
			FormDD.IsSelectionMode=true;
			FormDD.ShowDialog();
			if(FormDD.DialogResult!=DialogResult.OK) {
				return;
			}
			ListObjects.Add(DiseaseDefs.GetItem(FormDD.SelectedDiseaseDefNum));
			fillKnowledgeRequestitems();
		}
Ejemplo n.º 23
0
 private void butAddProblem_Click(object sender,EventArgs e)
 {
     FormDiseaseDefs formDD=new FormDiseaseDefs();
     formDD.IsSelectionMode=true;
     formDD.ShowDialog();
     if(formDD.DialogResult!=DialogResult.OK) {
         return;
     }
     Disease disease=new Disease();
     disease.PatNum=PatCur.PatNum;
     disease.DiseaseDefNum=formDD.SelectedDiseaseDefNum;
     Diseases.Insert(disease);
     FillProblems();
 }
Ejemplo n.º 24
0
		///<summary>Sets the pregnancy code and description text box with either the attached pregnancy dx if exists or the default preg dx set in FormEhrSettings or a manually selected def.  If the pregnancy diseasedef with the default pregnancy code and code system does not exist, it will be inserted.  The pregnancy problem will be inserted when closing if necessary.</summary>
		private void SetPregCodeAndDescript() {
			labelPregNotice.Text=pregDefaultText;
			pregDisDefNumCur=0;//this will be set to the correct problem def at the end of this function and will be the def of the problem we will insert/attach this exam to
			string pregCode="";
			string descript="";
			Disease disCur=null;
			DiseaseDef disdefCur=null;
			DateTime examDate=PIn.Date(textDateTaken.Text);//this may be different than the saved Vitalsign.DateTaken if user edited
			#region Get DiseaseDefNum from attached pregnancy problem
			if(VitalsignCur.PregDiseaseNum>0) {//already pointing to a disease, get that one
				disCur=Diseases.GetOne(VitalsignCur.PregDiseaseNum);//get disease this vital sign is pointing to, see if it exists
				if(disCur==null) {
					VitalsignCur.PregDiseaseNum=0;
				}
				else {
					if(examDate.Year<1880 || disCur.DateStart>examDate.Date || (disCur.DateStop.Year>1880 && disCur.DateStop<examDate.Date)) {
						VitalsignCur.PregDiseaseNum=0;
						disCur=null;
					}
					else {
						disdefCur=DiseaseDefs.GetItem(disCur.DiseaseDefNum);
						if(disdefCur==null) {
							VitalsignCur.PregDiseaseNum=0;
							disCur=null;
						}
						else {//disease points to valid def
							pregDisDefNumCur=disdefCur.DiseaseDefNum;
						}
					}
				}
			}
			#endregion
			if(VitalsignCur.PregDiseaseNum==0) {//not currently attached to a disease
				#region Get DiseaseDefNum from existing pregnancy problem
				if(examDate.Year>1880) {//only try to find existing problem if a valid exam date is entered before checking the box, otherwise we do not know what date to compare to the active dates of the pregnancy dx
					List<DiseaseDef> listPregDisDefs=DiseaseDefs.GetAllPregDiseaseDefs();
					List<Disease> listPatDiseases=Diseases.Refresh(VitalsignCur.PatNum,true);
					for(int i=0;i<listPatDiseases.Count;i++) {//loop through all diseases for this patient, shouldn't be very many
						if(listPatDiseases[i].DateStart>examDate.Date //startdate for current disease is after the exam date set in form
							|| (listPatDiseases[i].DateStop.Year>1880 && listPatDiseases[i].DateStop<examDate.Date))//or current disease has a stop date and stop date before exam date
						{
							continue;
						}
						for(int j=0;j<listPregDisDefs.Count;j++) {//loop through preg disease defs in the db, shouldn't be very many
							if(listPatDiseases[i].DiseaseDefNum!=listPregDisDefs[j].DiseaseDefNum) {//see if this problem is a pregnancy problem
								continue;
							}
							if(disCur==null || listPatDiseases[i].DateStart>disCur.DateStart) {//if we haven't found a disease match yet or this match is more recent (later start date)
								disCur=listPatDiseases[i];
								break;
							}
						}
					}
				}
				if(disCur!=null) {
					pregDisDefNumCur=disCur.DiseaseDefNum;
					VitalsignCur.PregDiseaseNum=disCur.DiseaseNum;
				}
				#endregion
				else {//we are going to insert either the default pregnancy problem or a manually selected problem
					#region Get DiseaseDefNum from global default pregnancy problem
					//if preg dx doesn't exist, use the default pregnancy code if set to something other than blank or 'none'
					pregCode=PrefC.GetString(PrefName.PregnancyDefaultCodeValue);//could be 'none' which disables the automatic dx insertion
					string pregCodeSys=PrefC.GetString(PrefName.PregnancyDefaultCodeSystem);//if 'none' for code, code system will default to 'SNOMEDCT', display will be ""
					if(pregCode!="" && pregCode!="none") {//default pregnancy code set to a code other than 'none', should never be blank, we set in ConvertDB and don't allow blank
						pregDisDefNumCur=DiseaseDefs.GetNumFromCode(pregCode);//see if the code is attached to a valid diseasedef
						if(pregDisDefNumCur==0) {//no diseasedef in db for the default code, create and insert def
							disdefCur=new DiseaseDef();
							disdefCur.DiseaseName="Pregnant";
							switch(pregCodeSys) {
								case "ICD9CM":
									disdefCur.ICD9Code=pregCode;
									break;
								case "ICD10CM":
									disdefCur.Icd10Code=pregCode;
									break;
								case "SNOMEDCT":
									disdefCur.SnomedCode=pregCode;
									break;
							}
							pregDisDefNumCur=DiseaseDefs.Insert(disdefCur);
							DiseaseDefs.RefreshCache();
							DataValid.SetInvalid(InvalidType.Diseases);
							SecurityLogs.MakeLogEntry(Permissions.ProblemEdit,0,disdefCur.DiseaseName+" added.");
						}
					}
					#endregion
					#region Get DiseaseDefNum from manually selected pregnancy problem
					else if(pregCode=="none") {//if pref for default preg dx is 'none', make user choose a problem from list
						FormDiseaseDefs FormDD=new FormDiseaseDefs();
						FormDD.IsSelectionMode=true;
						FormDD.IsMultiSelect=false;
						FormDD.ShowDialog();
						if(FormDD.DialogResult!=DialogResult.OK) {
							checkPregnant.Checked=false;
							textPregCode.Clear();
							textPregCodeDescript.Clear();
							labelPregNotice.Visible=false;
							butChangeDefault.Text="Change Default";
							return;
						}
						labelPregNotice.Text=pregManualText;
						pregDisDefNumCur=FormDD.SelectedDiseaseDefNum;
					}
					#endregion
				}
			}
			#region Set description and code from DiseaseDefNum
			if(pregDisDefNumCur==0) {
				textPregCode.Clear();
				textPregCodeDescript.Clear();
				labelPregNotice.Visible=false;
				return;
			}
			disdefCur=DiseaseDefs.GetItem(pregDisDefNumCur);
			if(disdefCur.ICD9Code!="") {
				ICD9 i9Preg=ICD9s.GetByCode(disdefCur.ICD9Code);
				if(i9Preg!=null) {
					pregCode=i9Preg.ICD9Code;
					descript=i9Preg.Description;
				}
			}
			else if(disdefCur.Icd10Code!="") {
				Icd10 i10Preg=Icd10s.GetByCode(disdefCur.Icd10Code);
				if(i10Preg!=null) {
					pregCode=i10Preg.Icd10Code;
					descript=i10Preg.Description;
				}
			}
			else if(disdefCur.SnomedCode!="") {
				Snomed sPreg=Snomeds.GetByCode(disdefCur.SnomedCode);
				if(sPreg!=null) {
					pregCode=sPreg.SnomedCode;
					descript=sPreg.Description;
				}
			}
			if(pregCode=="none" || pregCode=="") {
				descript=disdefCur.DiseaseName;
			}
			#endregion
			textPregCode.Text=pregCode;
			textPregCodeDescript.Text=descript;
		}
Ejemplo n.º 25
0
 private void butProblemSelect_Click(object sender,EventArgs e)
 {
     FormDiseaseDefs FormDD = new FormDiseaseDefs();
     FormDD.IsSelectionMode=true;
     FormDD.ShowDialog();
     if(FormDD.DialogResult!=DialogResult.OK) {
         return;
     }
     textProblem.Text=DiseaseDefs.GetName(FormDD.SelectedDiseaseDefNum);
     EduResourceCur.DiseaseDefNum=FormDD.SelectedDiseaseDefNum;
     textICD9.Text="";
     EduResourceCur.Icd9Num=0;
     textMedication.Text="";
     EduResourceCur.MedicationNum=0;
     textLabResultsID.Text="";
     textLabTestName.Text="";
     textCompareValue.Text="";
 }