Beispiel #1
0
        ///<summary>Fills listMedical with the corresponding list type.  This saves on load time by only filling necessary lists.</summary>
        private void FillListMedical(MedicalListType medListType)
        {
            switch (medListType)
            {
            case MedicalListType.allergy:
                if (allergyList == null)
                {
                    allergyList = AllergyDefs.GetAll(false);
                }
                listMedical.Items.Clear();
                for (int i = 0; i < allergyList.Count; i++)
                {
                    listMedical.Items.Add(allergyList[i].Description);
                }
                break;

            case MedicalListType.problem:
                listMedical.Items.Clear();
                for (int i = 0; i < _listDiseaseDefs.Count; i++)
                {
                    listMedical.Items.Add(_listDiseaseDefs[i].DiseaseName);
                }
                break;
            }
        }
Beispiel #2
0
        ///<summary>Loops through corresponding list and sets the index to the item matching fieldName passed in.  Only called on load.</summary>
        private void SetListMedicalSelectedIndex(MedicalListType medListType, string fieldName)
        {
            switch (medListType)
            {
            case MedicalListType.allergy:
                for (int i = 0; i < allergyList.Count; i++)
                {
                    if (AllergyDefs.GetDescription(allergyList[i].AllergyDefNum) == fieldName)
                    {
                        listMedical.SelectedIndex = i;
                    }
                }
                break;

            case MedicalListType.problem:
                for (int i = 0; i < _listDiseaseDefs.Count; i++)
                {
                    if (_listDiseaseDefs[i].DiseaseName == fieldName)
                    {
                        listMedical.SelectedIndex = i;
                    }
                }
                break;
            }
        }
Beispiel #3
0
		///<summary>Fills listMedical with the corresponding list type.  This saves on load time by only filling necessary lists.</summary>
		private void FillListMedical(MedicalListType medListType) {
			switch(medListType) {
				case MedicalListType.allergy:
					if(allergyList==null) {
						allergyList=AllergyDefs.GetAll(false);
					}
					listMedical.Items.Clear();
					for(int i=0;i<allergyList.Count;i++) {
						listMedical.Items.Add(allergyList[i].Description);
					}
					break;
				case MedicalListType.problem:
					listMedical.Items.Clear();
					for(int i=0;i<DiseaseDefs.List.Length;i++) {
						listMedical.Items.Add(DiseaseDefs.List[i].DiseaseName);
					}
					break;
			}
		}
        ///<summary>Fills listMedical with the corresponding list type.  This saves on load time by only filling necessary lists.
        ///Attempts to seelct the cooresponding allergy/problem. Will select nothing if it does not exist. </summary>
        private void FillListMedical(MedicalListType medListType)
        {
            string medSelection = SheetFieldDefCur.FieldName.Remove(0, Math.Min(SheetFieldDefCur.FieldName.Length, 8));

            switch (medListType)
            {
            case MedicalListType.allergy:
                if (_listAllergies == null)
                {
                    _listAllergies = AllergyDefs.GetAll(false);
                }
                listMedical.SetItems(_listAllergies, (item) => item.Description, (item) => item.Description == medSelection);
                break;

            case MedicalListType.problem:
                listMedical.SetItems(_listDiseaseDefs, (item) => item.DiseaseName, (item) => item.DiseaseName == medSelection);
                break;
            }
        }
Beispiel #5
0
		///<summary>Loops through corresponding list and sets the index to the item matching fieldName passed in.  Only called on load.</summary>
		private void SetListMedicalSelectedIndex(MedicalListType medListType,string fieldName) {
			switch(medListType) {
				case MedicalListType.allergy:
					for(int i=0;i<allergyList.Count;i++) {
						if(AllergyDefs.GetDescription(allergyList[i].AllergyDefNum)==fieldName) {
							listMedical.SelectedIndex=i;
						}
					}
					break;
				case MedicalListType.problem:
					for(int i=0;i<DiseaseDefs.List.Length;i++) {
						if(DiseaseDefs.List[i].DiseaseName==fieldName) {
							listMedical.SelectedIndex=i;
						}
					}
					break;
			}
		}