Ejemplo n.º 1
0
		private void listValueType_SelectedIndexChanged(object sender,EventArgs e) {
			textValue.Text="";
			_loincValue=null;
			_snomedValue=null;
			_icd9Value=null;
			_icd10Value=null;
			SetFlags();
		}
Ejemplo n.º 2
0
 ///<summary></summary>
 public static void Update(ICD9 icd9)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), icd9);
         return;
     }
     Crud.ICD9Crud.Update(icd9);
 }
Ejemplo n.º 3
0
 ///<summary></summary>
 public static long Insert(ICD9 icd9)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         icd9.ICD9Num = Meth.GetLong(MethodBase.GetCurrentMethod(), icd9);
         return(icd9.ICD9Num);
     }
     return(Crud.ICD9Crud.Insert(icd9));
 }
Ejemplo n.º 4
0
 private void butAdd_Click(object sender,EventArgs e)
 {
     changed=true;
     ICD9 icd9=new ICD9();
     FormIcd9Edit FormI=new FormIcd9Edit(icd9);
     FormI.IsNew=true;
     FormI.ShowDialog();
     FillGrid();
 }
Ejemplo n.º 5
0
		private void FormEhrAptObsEdit_Load(object sender,EventArgs e) {
			_appt=Appointments.GetOneApt(_ehrAptObsCur.AptNum);
			comboObservationQuestion.Items.Clear();
			string[] arrayQuestionNames=Enum.GetNames(typeof(EhrAptObsIdentifier));
			for(int i=0;i<arrayQuestionNames.Length;i++) {
				comboObservationQuestion.Items.Add(arrayQuestionNames[i]);
				EhrAptObsIdentifier ehrAptObsIdentifier=(EhrAptObsIdentifier)i;
				if(_ehrAptObsCur.IdentifyingCode==ehrAptObsIdentifier) {
					comboObservationQuestion.SelectedIndex=i;
				}
			}
			listValueType.Items.Clear();
			string[] arrayValueTypeNames=Enum.GetNames(typeof(EhrAptObsType));
			for(int i=0;i<arrayValueTypeNames.Length;i++) {
				listValueType.Items.Add(arrayValueTypeNames[i]);
				EhrAptObsType ehrAptObsType=(EhrAptObsType)i;
				if(_ehrAptObsCur.ValType==ehrAptObsType) {
					listValueType.SelectedIndex=i;
				}
			}
			if(_ehrAptObsCur.ValType==EhrAptObsType.Coded) {
				_strValCodeSystem=_ehrAptObsCur.ValCodeSystem;
				if(_ehrAptObsCur.ValCodeSystem=="LOINC") {
					_loincValue=Loincs.GetByCode(_ehrAptObsCur.ValReported);
					textValue.Text=_loincValue.NameShort;
				}
				else if(_ehrAptObsCur.ValCodeSystem=="SNOMEDCT") {
					_snomedValue=Snomeds.GetByCode(_ehrAptObsCur.ValReported);
					textValue.Text=_snomedValue.Description;
				}
				else if(_ehrAptObsCur.ValCodeSystem=="ICD9") {
					_icd9Value=ICD9s.GetByCode(_ehrAptObsCur.ValReported);
					textValue.Text=_icd9Value.Description;
				}
				else if(_ehrAptObsCur.ValCodeSystem=="ICD10") {
					_icd10Value=Icd10s.GetByCode(_ehrAptObsCur.ValReported);
					textValue.Text=_icd10Value.Description;
				}
			}
			else {
				textValue.Text=_ehrAptObsCur.ValReported;
			}
			comboUnits.Items.Clear();
			comboUnits.Items.Add("none");
			comboUnits.SelectedIndex=0;
			List<string> listUcumCodes=Ucums.GetAllCodes();
			for(int i=0;i<listUcumCodes.Count;i++) {
				string ucumCode=listUcumCodes[i];
				comboUnits.Items.Add(ucumCode);
				if(ucumCode==_ehrAptObsCur.UcumCode) {
					comboUnits.SelectedIndex=i+1;
				}
			}
			SetFlags();
		}
Ejemplo n.º 6
0
        ///<summary>Returns the code and description of the icd9.</summary>
        public static string GetCodeAndDescription(string icd9Code)
        {
            if (string.IsNullOrEmpty(icd9Code))
            {
                return("");
            }
            //No need to check RemotingRole; no call to db.
            ICD9 icd9 = GetFirstOrDefault(x => x.ICD9Code == icd9Code);

            return(icd9 == null ? "" : (icd9.ICD9Code + "-" + icd9.Description));
        }
Ejemplo n.º 7
0
		private void listMain_DoubleClick(object sender,System.EventArgs e) {
			if(listMain.SelectedIndex==-1) {
				return;
			}
			if(IsSelectionMode) {
				SelectedIcd9=icd9List[listMain.SelectedIndex];
				DialogResult=DialogResult.OK;
				return;
			}
			/* Commented to prevent Icd9 edit window from being shown
			changed=true;
			FormIcd9Edit FormI=new FormIcd9Edit(icd9List[listMain.SelectedIndex]);
			FormI.ShowDialog();
			if(FormI.DialogResult!=DialogResult.OK) {
				return;
			}
			FillGrid();
			*/
		}
Ejemplo n.º 8
0
        ///<summary>Called after file is downloaded.  Throws exceptions.  It is assumed that this is called from a worker thread.  Progress delegate will be called every 100th iteration to inform thread of current progress. Quit flag can be set at any time in order to quit importing prematurely.</summary>
        public static void ImportIcd9(string tempFileName, ProgressArgs progress, ref bool quit, ref int numCodesImported, ref int numCodesUpdated,
                                      bool updateExisting)
        {
            if (tempFileName == null)
            {
                return;
            }
            //Customers may have an old codeset that has a truncated uppercase description, if so we want to update with new descriptions.
            bool IsOldDescriptions = ICD9s.IsOldDescriptions();
            Dictionary <string, ICD9> dictCodes = ICD9s.GetAll().ToDictionary(x => x.ICD9Code, x => x);

            string[] lines = File.ReadAllLines(tempFileName);
            string[] arrayICD9;
            ICD9     icd9 = new ICD9();

            for (int i = 0; i < lines.Length; i++)       //each loop should read exactly one line of code. and each line of code should be a unique code
            {
                if (quit)
                {
                    return;
                }
                if (i % 100 == 0)
                {
                    progress(i + 1, lines.Length);
                }
                arrayICD9 = lines[i].Split('\t');
                if (dictCodes.ContainsKey(arrayICD9[0]))                 //code already exists
                {
                    icd9 = dictCodes[arrayICD9[0]];
                    if ((IsOldDescriptions || updateExisting) && icd9.Description != arrayICD9[1])                   //The new description does not match the description in the database.
                    {
                        icd9.Description = arrayICD9[1];
                        ICD9s.Update(icd9);
                        numCodesUpdated++;
                    }
                    continue;
                }
                icd9.ICD9Code    = arrayICD9[0];
                icd9.Description = arrayICD9[1];
                ICD9s.Insert(icd9);
                numCodesImported++;
            }
        }
Ejemplo n.º 9
0
        ///<summary>Called after file is downloaded.  Throws exceptions.  It is assumed that this is called from a worker thread.  Progress delegate will be called every 100th iteration to inform thread of current progress. Quit flag can be set at any time in order to quit importing prematurely.</summary>
        public static void ImportIcd9(string tempFileName, ProgressArgs progress, ref bool quit)
        {
            if (tempFileName == null)
            {
                return;
            }
            //Customers may have an old codeset that has a truncated uppercase description, if so we want to update with new descriptions.
            bool             IsOldDescriptions = ICD9s.IsOldDescriptions();
            HashSet <string> codeHash          = new HashSet <string>(ICD9s.GetAllCodes());

            string[] lines = File.ReadAllLines(tempFileName);
            string[] arrayICD9;
            ICD9     icd9 = new ICD9();

            for (int i = 0; i < lines.Length; i++)       //each loop should read exactly one line of code. and each line of code should be a unique code
            {
                if (quit)
                {
                    return;
                }
                if (i % 100 == 0)
                {
                    progress(i + 1, lines.Length);
                }
                arrayICD9 = lines[i].Split('\t');
                if (codeHash.Contains(arrayICD9[0]))                 //code already exists
                {
                    if (!IsOldDescriptions)
                    {
                        continue;                        //code exists and has updated description
                    }
                    string command = "UPDATE icd9 SET description='" + POut.String(arrayICD9[1]) + "' WHERE ICD9Code='" + POut.String(arrayICD9[0]) + "'";
                    Db.NonQ(command);
                    continue;                    //we have updated the description of an existing code.
                }
                icd9.ICD9Code    = arrayICD9[0];
                icd9.Description = arrayICD9[1];
                ICD9s.Insert(icd9);
            }
        }
Ejemplo n.º 10
0
		public FormIcd9Edit(ICD9 icd9Cur) {
			InitializeComponent();
			Lan.F(this);
			Icd9Cur=icd9Cur;
		}
Ejemplo n.º 11
0
		/* Deprecated. This is populated from a list and follows a standard so we do not allow custom ICD-9 Codes.
		private void butAdd_Click(object sender,EventArgs e) {
			changed=true;
			ICD9 icd9=new ICD9();
			FormIcd9Edit FormI=new FormIcd9Edit(icd9);
			FormI.IsNew=true;
			FormI.ShowDialog();
			FillGrid();
		}
		*/
		
		private void butOK_Click(object sender,EventArgs e) {
			//not even visible unless IsSelectionMode
			if(listMain.SelectedIndex==-1) {
				MsgBox.Show(this,"Please select an item first.");
				return;
			}
			SelectedIcd9=icd9List[listMain.SelectedIndex];
			DialogResult=DialogResult.OK;
		}
Ejemplo n.º 12
0
		///<summary>Called after file is downloaded.  Throws exceptions.  It is assumed that this is called from a worker thread.  Progress delegate will be called every 100th iteration to inform thread of current progress. Quit flag can be set at any time in order to quit importing prematurely.</summary>
		public static void ImportIcd9(string tempFileName,ProgressArgs progress,ref bool quit) {
			if(tempFileName==null) {
				return;
			}
			//Customers may have an old codeset that has a truncated uppercase description, if so we want to update with new descriptions.
			bool IsOldDescriptions=ICD9s.IsOldDescriptions();
			HashSet<string> codeHash=new HashSet<string>(ICD9s.GetAllCodes());
			string[] lines=File.ReadAllLines(tempFileName);
			string[] arrayICD9;
			ICD9 icd9=new ICD9();
			for(int i=0;i<lines.Length;i++) {//each loop should read exactly one line of code. and each line of code should be a unique code
				if(quit) {
					return;
				}
				if(i%100==0) {
					progress(i+1,lines.Length);
				}
				arrayICD9=lines[i].Split('\t');
				if(codeHash.Contains(arrayICD9[0])) {//code already exists
					if(!IsOldDescriptions) {
						continue;//code exists and has updated description
					}
					string command="UPDATE icd9 SET description='"+POut.String(arrayICD9[1])+"' WHERE ICD9Code='"+POut.String(arrayICD9[0])+"'";
					Db.NonQ(command);
					continue;//we have updated the description of an existing code.
				}
				icd9.ICD9Code		=arrayICD9[0];
				icd9.Description=arrayICD9[1];
				ICD9s.Insert(icd9);
			}
		}
Ejemplo n.º 13
0
		public void AddCode(ICD9 icd9) {
			subject4List.Add(new Subject3(new Value(icd9.ICD9Code,"2.16.840.1.113883.6.103","ICD9CM",icd9.Description)));
			subject4List[subject4List.Count-1].mainSearchCriteria.originalText=icd9.Description;
		}
Ejemplo n.º 14
0
		private void butPickValueIcd9_Click(object sender,EventArgs e) {
			FormIcd9s formI=new FormIcd9s();
			formI.IsSelectionMode=true;
			if(formI.ShowDialog()==DialogResult.OK) {
				_icd9Value=formI.SelectedIcd9;
				textValue.Text=_icd9Value.Description;
				_strValCodeSystem="ICD9";
				labelValue.Text=_strValCodeSystem+" Value";
			}
		}
Ejemplo n.º 15
0
 ///<summary></summary>
 public static void Update(ICD9 icd9)
 {
     if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){
         Meth.GetVoid(MethodBase.GetCurrentMethod(),icd9);
         return;
     }
     Crud.ICD9Crud.Update(icd9);
 }
Ejemplo n.º 16
0
 ///<summary></summary>
 public static long Insert(ICD9 icd9)
 {
     if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){
         icd9.ICD9Num=Meth.GetLong(MethodBase.GetCurrentMethod(),icd9);
         return icd9.ICD9Num;
     }
     return Crud.ICD9Crud.Insert(icd9);
 }