//If this table type will exist as cached data, uncomment the CachePattern region below. /* #region CachePattern //This region can be eliminated if this is not a table type with cached data. //If leaving this region in place, be sure to add RefreshCache and FillCache //to the Cache.cs file with all the other Cache types. ///<summary>A list of all Icd10s.</summary> private static List<Icd10> listt; ///<summary>A list of all Icd10s.</summary> public static List<Icd10> Listt{ get { if(listt==null) { RefreshCache(); } return listt; } set { listt=value; } } ///<summary></summary> public static DataTable RefreshCache(){ //No need to check RemotingRole; Calls GetTableRemotelyIfNeeded(). string command="SELECT * FROM icd10 ORDER BY ItemOrder";//stub query probably needs to be changed DataTable table=Cache.GetTableRemotelyIfNeeded(MethodBase.GetCurrentMethod(),command); table.TableName="Icd10"; FillCache(table); return table; } ///<summary></summary> public static void FillCache(DataTable table){ //No need to check RemotingRole; no call to db. listt=Crud.Icd10Crud.TableToList(table); } #endregion */ ///<summary></summary> public static long Insert(Icd10 icd10){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){ icd10.Icd10Num=Meth.GetLong(MethodBase.GetCurrentMethod(),icd10); return icd10.Icd10Num; } return Crud.Icd10Crud.Insert(icd10); }
///<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 ImportIcd10(string tempFileName, ProgressArgs progress, ref bool quit) { if (tempFileName == null) { return; } HashSet <string> codeHash = new HashSet <string>(Icd10s.GetAllCodes()); string[] lines = File.ReadAllLines(tempFileName); string[] arrayICD10; Icd10 icd10 = new Icd10(); 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); } arrayICD10 = lines[i].Split('\t'); if (codeHash.Contains(arrayICD10[0])) //code already exists { continue; } icd10.Icd10Code = arrayICD10[0]; icd10.Description = arrayICD10[1]; icd10.IsCode = arrayICD10[2]; Icd10s.Insert(icd10); } }
//If this table type will exist as cached data, uncomment the CachePattern region below. /* #region CachePattern * //This region can be eliminated if this is not a table type with cached data. * //If leaving this region in place, be sure to add RefreshCache and FillCache * //to the Cache.cs file with all the other Cache types. * * ///<summary>A list of all Icd10s.</summary> * private static List<Icd10> listt; * * ///<summary>A list of all Icd10s.</summary> * public static List<Icd10> Listt{ * get { * if(listt==null) { * RefreshCache(); * } * return listt; * } * set { * listt=value; * } * } * * ///<summary></summary> * public static DataTable RefreshCache(){ * //No need to check RemotingRole; Calls GetTableRemotelyIfNeeded(). * string command="SELECT * FROM icd10 ORDER BY ItemOrder";//stub query probably needs to be changed * DataTable table=Cache.GetTableRemotelyIfNeeded(MethodBase.GetCurrentMethod(),command); * table.TableName="Icd10"; * FillCache(table); * return table; * } * * ///<summary></summary> * public static void FillCache(DataTable table){ * //No need to check RemotingRole; no call to db. * listt=Crud.Icd10Crud.TableToList(table); * } #endregion */ ///<summary></summary> public static long Insert(Icd10 icd10) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { icd10.Icd10Num = Meth.GetLong(MethodBase.GetCurrentMethod(), icd10); return(icd10.Icd10Num); } return(Crud.Icd10Crud.Insert(icd10)); }
///<summary></summary> public static void Update(Icd10 icd10) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), icd10); return; } Crud.Icd10Crud.Update(icd10); }
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(); }
///<summary>Returns the code and description of the icd10.</summary> public static string GetCodeAndDescription(string icd10Code) { if (string.IsNullOrEmpty(icd10Code)) { return(""); } //No need to check RemotingRole; no call to db. Icd10 icd10 = GetByCode(icd10Code); return(icd10 == null ? "" : (icd10.Icd10Code + "-" + icd10.Description)); }
///<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 ImportIcd10(string tempFileName, ProgressArgs progress, ref bool quit, ref int numCodesImported, ref int numCodesUpdated, bool updateExisting) { if (tempFileName == null) { return; } Dictionary <string, Icd10> dictIcd10s = Icd10s.GetAll().ToDictionary(x => x.Icd10Code, x => x); string[] lines = File.ReadAllLines(tempFileName); string[] arrayICD10; Icd10 icd10 = new Icd10(); 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); } arrayICD10 = lines[i].Split('\t'); if (dictIcd10s.ContainsKey(arrayICD10[0])) //code already exists { icd10 = dictIcd10s[arrayICD10[0]]; if (updateExisting && (icd10.Description != arrayICD10[1] || icd10.IsCode != arrayICD10[2])) //Code informatin is different { icd10.Description = arrayICD10[1]; icd10.IsCode = arrayICD10[2]; Icd10s.Update(icd10); numCodesUpdated++; } continue; } icd10.Icd10Code = arrayICD10[0]; icd10.Description = arrayICD10[1]; icd10.IsCode = arrayICD10[2]; Icd10s.Insert(icd10); numCodesImported++; } }
///<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 ImportIcd10(string tempFileName,ProgressArgs progress,ref bool quit) { if(tempFileName==null) { return; } HashSet<string> codeHash=new HashSet<string>(Icd10s.GetAllCodes()); string[] lines=File.ReadAllLines(tempFileName); string[] arrayICD10; Icd10 icd10=new Icd10(); 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); } arrayICD10=lines[i].Split('\t'); if(codeHash.Contains(arrayICD10[0])) {//code already exists continue; } icd10.Icd10Code =arrayICD10[0]; icd10.Description =arrayICD10[1]; icd10.IsCode =arrayICD10[2]; Icd10s.Insert(icd10); } }
public void AddCode(Icd10 icd10) { subject4List.Add(new Subject3(new Value(icd10.Icd10Code,"2.16.840.1.113883.6.90","ICD10CM",icd10.Description))); subject4List[subject4List.Count-1].mainSearchCriteria.originalText=icd10.Description; }
private void listValueType_SelectedIndexChanged(object sender,EventArgs e) { textValue.Text=""; _loincValue=null; _snomedValue=null; _icd9Value=null; _icd10Value=null; SetFlags(); }
private void butPickValueIcd10_Click(object sender,EventArgs e) { FormIcd10s formI=new FormIcd10s(); formI.IsSelectionMode=true; if(formI.ShowDialog()==DialogResult.OK) { _icd10Value=formI.SelectedIcd10; textValue.Text=_icd10Value.Description; _strValCodeSystem="ICD10"; labelValue.Text=_strValCodeSystem+" Value"; } }
///<summary>Sort function to put the codes that apply to the most number of CQM's at the top so the user can see which codes they should select.</summary> //private int SortMeasuresMet(ODGridRow row1,ODGridRow row2) { // //First sort by the number of measures the codes apply to in a comma delimited list // int diff=row2.Cells[2].Text.Split(new string[] { "," },StringSplitOptions.RemoveEmptyEntries).Length-row1.Cells[2].Text.Split(new string[] { "," },StringSplitOptions.RemoveEmptyEntries).Length; // if(diff!=0) { // return diff; // } // try { // //if the codes apply to the same number of CQMs, order by the code values // return PIn.Long(row1.Cells[0].Text).CompareTo(PIn.Long(row2.Cells[0].Text)); // } // catch(Exception ex) { // return 0; // } //} private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) { if(IsSelectionMode) { SelectedIcd10=(Icd10)gridMain.Rows[e.Row].Tag; DialogResult=DialogResult.OK; return; } //changed=true; //FormSnomedEdit FormSE=new FormSnomedEdit((Snomed)gridMain.Rows[e.Row].Tag); //FormSE.ShowDialog(); //if(FormSE.DialogResult!=DialogResult.OK) { // return; //} //FillGrid(); }
/*private void butAdd_Click(object sender,EventArgs e) { //TODO: Either change to adding a snomed code instead of an ICD9 or don't allow users to add SNOMED codes other than importing. changed=true; Snomed snomed=new Snomed(); FormSnomedEdit FormI=new FormSnomedEdit(snomed); FormI.IsNew=true; FormI.ShowDialog(); FillGrid(); }*/ private void butOK_Click(object sender,EventArgs e) { //not even visible unless IsSelectionMode if(gridMain.GetSelectedIndex()==-1) { MsgBox.Show(this,"Please select an item first."); return; } SelectedIcd10=(Icd10)gridMain.Rows[gridMain.GetSelectedIndex()].Tag; DialogResult=DialogResult.OK; }