private void FillGrid() { gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col; col = new GridColumn("HCPCS Code", 100); gridMain.ListGridColumns.Add(col); col = new GridColumn("Description", 500); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; listHcpcses = Hcpcses.GetBySearchText(textCode.Text); for (int i = 0; i < listHcpcses.Count; i++) { row = new GridRow(); row.Cells.Add(listHcpcses[i].HcpcsCode); row.Cells.Add(listHcpcses[i].DescriptionShort); row.Tag = listHcpcses[i]; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }
public void FormEncounters_Load(object sender, EventArgs e) { _patCur = Patients.GetPat(_encCur.PatNum); this.Text += " - " + _patCur.GetNameLF(); textDateEnc.Text = _encCur.DateEncounter.ToShortDateString(); _provNumSelected = _encCur.ProvNum; comboProv.Items.Clear(); _listProviders = Providers.GetDeepCopy(true); for (int i = 0; i < _listProviders.Count; i++) { comboProv.Items.Add(_listProviders[i].GetLongDesc()); //Only visible provs added to combobox. if (_listProviders[i].ProvNum == _encCur.ProvNum) { comboProv.SelectedIndex = i; //Sets combo text too. } } if (_provNumSelected == 0) //Is new { comboProv.SelectedIndex = 0; _provNumSelected = _listProviders[0].ProvNum; } if (comboProv.SelectedIndex == -1) //The provider exists but is hidden { comboProv.Text = Providers.GetLongDesc(_provNumSelected); //Appends "(hidden)" to the end of the long description. } textNote.Text = _encCur.Note; textCodeValue.Text = _encCur.CodeValue; textCodeSystem.Text = _encCur.CodeSystem; //to get description, first determine which table the code is from. Encounter is only allowed to be a CDT, CPT, HCPCS, and SNOMEDCT. Will be null if new encounter. switch (_encCur.CodeSystem) { case "CDT": textCodeDescript.Text = ProcedureCodes.GetProcCode(_encCur.CodeValue).Descript; break; case "CPT": Cpt cptCur = Cpts.GetByCode(_encCur.CodeValue); if (cptCur != null) { textCodeDescript.Text = cptCur.Description; } break; case "HCPCS": Hcpcs hCur = Hcpcses.GetByCode(_encCur.CodeValue); if (hCur != null) { textCodeDescript.Text = hCur.DescriptionShort; } break; case "SNOMEDCT": Snomed sCur = Snomeds.GetByCode(_encCur.CodeValue); if (sCur != null) { textCodeDescript.Text = sCur.Description; } break; case null: textCodeDescript.Text = ""; break; default: MsgBox.Show(this, "Error: Unknown code system"); break; } }
private void FillGrid() { gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("Date", 80); gridMain.Columns.Add(col); col = new ODGridColumn("Prov", 70); gridMain.Columns.Add(col); col = new ODGridColumn("Code", 110); gridMain.Columns.Add(col); col = new ODGridColumn("Description", 180); gridMain.Columns.Add(col); col = new ODGridColumn("Note", 100); gridMain.Columns.Add(col); listEncs = Encounters.Refresh(PatCur.PatNum); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < listEncs.Count; i++) { row = new ODGridRow(); row.Cells.Add(listEncs[i].DateEncounter.ToShortDateString()); row.Cells.Add(Providers.GetAbbr(listEncs[i].ProvNum)); row.Cells.Add(listEncs[i].CodeValue); string descript = ""; //to get description, first determine which table the code is from. Encounter is only allowed to be a CDT, CPT, HCPCS, and SNOMEDCT. switch (listEncs[i].CodeSystem) { case "CDT": descript = ProcedureCodes.GetProcCode(listEncs[i].CodeValue).Descript; break; case "CPT": Cpt cptCur = Cpts.GetByCode(listEncs[i].CodeValue); if (cptCur != null) { descript = cptCur.Description; } break; case "HCPCS": Hcpcs hCur = Hcpcses.GetByCode(listEncs[i].CodeValue); if (hCur != null) { descript = hCur.DescriptionShort; } break; case "SNOMEDCT": Snomed sCur = Snomeds.GetByCode(listEncs[i].CodeValue); if (sCur != null) { descript = sCur.Description; } break; } row.Cells.Add(descript); row.Cells.Add(listEncs[i].Note); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FillGrid() { gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("Code", 70); gridMain.Columns.Add(col); col = new ODGridColumn("CodeSystem", 90); gridMain.Columns.Add(col); col = new ODGridColumn("Description", 200); gridMain.Columns.Add(col); string selectedValue = comboCodeSet.SelectedItem.ToString(); List <string> listValSetOIDs = new List <string>(); if (selectedValue == "All") { listValSetOIDs = new List <string>(dictValueCodeSets.Values); } else //this will limit the codes to only one value set oid { listValSetOIDs.Add(dictValueCodeSets[selectedValue]); } listCodes = EhrCodes.GetForValueSetOIDs(listValSetOIDs, true); //these codes will exist in the corresponding table or will not be in the list gridMain.Rows.Clear(); ODGridRow row; int selectedIdx = -1; for (int i = 0; i < listCodes.Count; i++) { row = new ODGridRow(); row.Cells.Add(listCodes[i].CodeValue); row.Cells.Add(listCodes[i].CodeSystem); //Retrieve description from the associated table string descript = ""; switch (listCodes[i].CodeSystem) { case "CPT": Cpt cCur = Cpts.GetByCode(listCodes[i].CodeValue); if (cCur != null) { descript = cCur.Description; } break; case "HCPCS": Hcpcs hCur = Hcpcses.GetByCode(listCodes[i].CodeValue); if (hCur != null) { descript = hCur.DescriptionShort; } break; case "ICD9CM": ICD9 i9Cur = ICD9s.GetByCode(listCodes[i].CodeValue); if (i9Cur != null) { descript = i9Cur.Description; } break; case "ICD10CM": Icd10 i10Cur = Icd10s.GetByCode(listCodes[i].CodeValue); if (i10Cur != null) { descript = i10Cur.Description; } break; case "RXNORM": descript = RxNorms.GetDescByRxCui(listCodes[i].CodeValue); break; case "SNOMEDCT": Snomed sCur = Snomeds.GetByCode(listCodes[i].CodeValue); if (sCur != null) { descript = sCur.Description; } break; } row.Cells.Add(descript); gridMain.Rows.Add(row); if (listCodes[i].CodeValue == InterventionCur.CodeValue && listCodes[i].CodeSystem == InterventionCur.CodeSystem) { selectedIdx = i; } } gridMain.EndUpdate(); if (selectedIdx > -1) { gridMain.SetSelected(selectedIdx, true); gridMain.ScrollToIndex(selectedIdx); } }
private void FillDefaultEncCode() { string defaultEncCode = PrefC.GetString(PrefName.CQMDefaultEncounterCodeValue); string defaultEncCodeSystem = PrefC.GetString(PrefName.CQMDefaultEncounterCodeSystem); NewEncCodeSystem = defaultEncCodeSystem; OldEncListSelectedIdx = -1; int countNotInSnomedTable = 0; for (int i = 0; i < ListRecEncCodes.Count; i++) { if (i == 0) { comboEncCodes.Items.Add(ListRecEncCodes[i]); comboEncCodes.SelectedIndex = i; if (defaultEncCode == ListRecEncCodes[i]) { comboEncCodes.SelectedIndex = i; OldEncListSelectedIdx = i; } continue; } if (!Snomeds.CodeExists(ListRecEncCodes[i])) { countNotInSnomedTable++; continue; } comboEncCodes.Items.Add(ListRecEncCodes[i]); if (ListRecEncCodes[i] == defaultEncCode && defaultEncCodeSystem == "SNOMEDCT") { comboEncCodes.SelectedIndex = i; OldEncListSelectedIdx = i; labelEncWarning.Visible = false; textEncCodeDescript.Text = Snomeds.GetByCode(ListRecEncCodes[i]).Description; //Guaranteed to exist in snomed table from above check } } if (countNotInSnomedTable > 0) { MsgBox.Show(this, "The snomed table does not contain one or more codes from the list of recommended encounter codes. The snomed table should be updated by running the Code System Importer tool found in Setup | Chart | EHR."); } if (comboEncCodes.SelectedIndex == -1) //default enc code set to code not in recommended list and not 'none' { switch (defaultEncCodeSystem) { case "CDT": textEncCodeValue.Text = ProcedureCodes.GetProcCode(defaultEncCode).ProcCode; //Will return a new ProcCode object, not null, if not found textEncCodeDescript.Text = ProcedureCodes.GetProcCode(defaultEncCode).Descript; break; case "CPT": Cpt cEnc = Cpts.GetByCode(defaultEncCode); if (cEnc != null) { textEncCodeValue.Text = cEnc.CptCode; textEncCodeDescript.Text = cEnc.Description; } break; case "SNOMEDCT": Snomed sEnc = Snomeds.GetByCode(defaultEncCode); if (sEnc != null) { textEncCodeValue.Text = sEnc.SnomedCode; textEncCodeDescript.Text = sEnc.Description; } break; case "HCPCS": Hcpcs hEnc = Hcpcses.GetByCode(defaultEncCode); if (hEnc != null) { textEncCodeValue.Text = hEnc.HcpcsCode; textEncCodeDescript.Text = hEnc.DescriptionShort; } break; } } }
private void FillGrid() { gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn("Date", 70); gridMain.Columns.Add(col); col = new ODGridColumn("Prov", 50); gridMain.Columns.Add(col); col = new ODGridColumn("Intervention Type", 115); gridMain.Columns.Add(col); col = new ODGridColumn("Code", 70); gridMain.Columns.Add(col); col = new ODGridColumn("Code System", 85); gridMain.Columns.Add(col); col = new ODGridColumn("Code Description", 300); gridMain.Columns.Add(col); col = new ODGridColumn("Note", 100); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; #region Interventions listIntervention = Interventions.Refresh(PatCur.PatNum); for (int i = 0; i < listIntervention.Count; i++) { row = new ODGridRow(); row.Cells.Add(listIntervention[i].DateEntry.ToShortDateString()); row.Cells.Add(Providers.GetAbbr(listIntervention[i].ProvNum)); row.Cells.Add(listIntervention[i].CodeSet.ToString()); row.Cells.Add(listIntervention[i].CodeValue); row.Cells.Add(listIntervention[i].CodeSystem); //Description of Intervention--------------------------------------------- //to get description, first determine which table the code is from. Interventions are allowed to be SNOMEDCT, ICD9, ICD10, HCPCS, or CPT. string descript = ""; switch (listIntervention[i].CodeSystem) { case "SNOMEDCT": Snomed sCur = Snomeds.GetByCode(listIntervention[i].CodeValue); if (sCur != null) { descript = sCur.Description; } break; case "ICD9CM": ICD9 i9Cur = ICD9s.GetByCode(listIntervention[i].CodeValue); if (i9Cur != null) { descript = i9Cur.Description; } break; case "ICD10CM": Icd10 i10Cur = Icd10s.GetByCode(listIntervention[i].CodeValue); if (i10Cur != null) { descript = i10Cur.Description; } break; case "HCPCS": Hcpcs hCur = Hcpcses.GetByCode(listIntervention[i].CodeValue); if (hCur != null) { descript = hCur.DescriptionShort; } break; case "CPT": Cpt cptCur = Cpts.GetByCode(listIntervention[i].CodeValue); if (cptCur != null) { descript = cptCur.Description; } break; } row.Cells.Add(descript); row.Cells.Add(listIntervention[i].Note); row.Tag = listIntervention[i]; gridMain.Rows.Add(row); } #endregion #region MedicationPats listMedPats = MedicationPats.Refresh(PatCur.PatNum, true); if (listMedPats.Count > 0) { //The following medications are used as interventions for some measures. Include them in the intervention window if they belong to these value sets. //Above Normal Medications RxNorm Value Set, Below Normal Medications RxNorm Value Set, Tobacco Use Cessation Pharmacotherapy Value Set List <string> listVS = new List <string> { "2.16.840.1.113883.3.600.1.1498", "2.16.840.1.113883.3.600.1.1499", "2.16.840.1.113883.3.526.3.1190" }; List <EhrCode> listEhrMeds = EhrCodes.GetForValueSetOIDs(listVS, true); for (int i = listMedPats.Count - 1; i > -1; i--) { bool found = false; for (int j = 0; j < listEhrMeds.Count; j++) { if (listMedPats[i].RxCui.ToString() == listEhrMeds[j].CodeValue) { found = true; break; } } if (!found) { listMedPats.RemoveAt(i); } } } for (int i = 0; i < listMedPats.Count; i++) { row = new ODGridRow(); row.Cells.Add(listMedPats[i].DateStart.ToShortDateString()); row.Cells.Add(Providers.GetAbbr(listMedPats[i].ProvNum)); if (listMedPats[i].RxCui == 314153 || listMedPats[i].RxCui == 692876) { row.Cells.Add(InterventionCodeSet.AboveNormalWeight.ToString() + " Medication"); } else if (listMedPats[i].RxCui == 577154 || listMedPats[i].RxCui == 860215 || listMedPats[i].RxCui == 860221 || listMedPats[i].RxCui == 860225 || listMedPats[i].RxCui == 860231) { row.Cells.Add(InterventionCodeSet.BelowNormalWeight.ToString() + " Medication"); } else //There are 48 total medications that can be used as interventions. The remaining 41 medications are tobacco cessation medications { row.Cells.Add(InterventionCodeSet.TobaccoCessation.ToString() + " Medication"); } row.Cells.Add(listMedPats[i].RxCui.ToString()); row.Cells.Add("RXNORM"); //Medications that are used as interventions are all RxNorm codes, get description from that table string descript = RxNorms.GetDescByRxCui(listMedPats[i].RxCui.ToString()); row.Cells.Add(descript); row.Cells.Add(listMedPats[i].PatNote); row.Tag = listMedPats[i]; gridMain.Rows.Add(row); } #endregion gridMain.EndUpdate(); }
private void FormEhrSettings_Load(object sender, EventArgs e) { checkAlertHighSeverity.Checked = PrefC.GetBool(PrefName.EhrRxAlertHighSeverity); checkMU2.Checked = PrefC.GetBool(PrefName.MeaningfulUseTwo); #region DefaultEncounterGroup FillRecEncCodesList(); string defaultEncCode = PrefC.GetString(PrefName.CQMDefaultEncounterCodeValue); string defaultEncCodeSystem = PrefC.GetString(PrefName.CQMDefaultEncounterCodeSystem); NewEncCodeSystem = defaultEncCodeSystem; OldEncListSelectedIdx = -1; int countNotInSnomedTable = 0; for (int i = 0; i < ListRecEncCodes.Count; i++) { if (i == 0) { comboEncCodes.Items.Add(ListRecEncCodes[i]); comboEncCodes.SelectedIndex = i; if (defaultEncCode == ListRecEncCodes[i]) { comboEncCodes.SelectedIndex = i; OldEncListSelectedIdx = i; } continue; } if (!Snomeds.CodeExists(ListRecEncCodes[i])) { countNotInSnomedTable++; continue; } comboEncCodes.Items.Add(ListRecEncCodes[i]); if (ListRecEncCodes[i] == defaultEncCode && defaultEncCodeSystem == "SNOMEDCT") { comboEncCodes.SelectedIndex = i; OldEncListSelectedIdx = i; labelEncWarning.Visible = false; textEncCodeDescript.Text = Snomeds.GetByCode(ListRecEncCodes[i]).Description; //Guaranteed to exist in snomed table from above check } } if (countNotInSnomedTable > 0) { MsgBox.Show(this, "The snomed table does not contain one or more codes from the list of recommended encounter codes. The snomed table should be updated by running the Code System Importer tool found in Setup | EHR."); } if (comboEncCodes.SelectedIndex == -1) //default enc code set to code not in recommended list and not 'none' { switch (defaultEncCodeSystem) { case "CDT": textEncCodeValue.Text = ProcedureCodes.GetProcCode(defaultEncCode).ProcCode; //Will return a new ProcCode object, not null, if not found textEncCodeDescript.Text = ProcedureCodes.GetProcCode(defaultEncCode).Descript; break; case "CPT": Cpt cEnc = Cpts.GetByCode(defaultEncCode); if (cEnc != null) { textEncCodeValue.Text = cEnc.CptCode; textEncCodeDescript.Text = cEnc.Description; } break; case "SNOMEDCT": Snomed sEnc = Snomeds.GetByCode(defaultEncCode); if (sEnc != null) { textEncCodeValue.Text = sEnc.SnomedCode; textEncCodeDescript.Text = sEnc.Description; } break; case "HCPCS": Hcpcs hEnc = Hcpcses.GetByCode(defaultEncCode); if (hEnc != null) { textEncCodeValue.Text = hEnc.HcpcsCode; textEncCodeDescript.Text = hEnc.DescriptionShort; } break; } } #endregion #region DefaultPregnancyGroup FillRecPregCodesList(); string defaultPregCode = PrefC.GetString(PrefName.PregnancyDefaultCodeValue); string defaultPregCodeSystem = PrefC.GetString(PrefName.PregnancyDefaultCodeSystem); NewPregCodeSystem = defaultPregCodeSystem; OldPregListSelectedIdx = -1; countNotInSnomedTable = 0; for (int i = 0; i < ListRecPregCodes.Count; i++) { if (i == 0) { comboPregCodes.Items.Add(ListRecPregCodes[i]); comboPregCodes.SelectedIndex = i; if (defaultPregCode == ListRecPregCodes[i]) { comboPregCodes.SelectedIndex = i; OldPregListSelectedIdx = i; } continue; } if (!Snomeds.CodeExists(ListRecPregCodes[i])) { countNotInSnomedTable++; continue; } comboPregCodes.Items.Add(ListRecPregCodes[i]); if (ListRecPregCodes[i] == defaultPregCode && defaultPregCodeSystem == "SNOMEDCT") { comboPregCodes.SelectedIndex = i; OldPregListSelectedIdx = i; labelPregWarning.Visible = false; textPregCodeDescript.Text = Snomeds.GetByCode(ListRecPregCodes[i]).Description; //Guaranteed to exist in snomed table from above check } } if (countNotInSnomedTable > 0) { MsgBox.Show(this, "The snomed table does not contain one or more codes from the list of recommended pregnancy codes. The snomed table should be updated by running the Code System Importer tool found in Setup | EHR."); } if (comboPregCodes.SelectedIndex == -1) //default preg code set to code not in recommended list and not 'none' { switch (defaultPregCodeSystem) { case "ICD9CM": ICD9 i9Preg = ICD9s.GetByCode(defaultPregCode); if (i9Preg != null) { textPregCodeValue.Text = i9Preg.ICD9Code; textPregCodeDescript.Text = i9Preg.Description; } break; case "SNOMEDCT": Snomed sPreg = Snomeds.GetByCode(defaultPregCode); if (sPreg != null) { textPregCodeValue.Text = sPreg.SnomedCode; textPregCodeDescript.Text = sPreg.Description; } break; case "ICD10CM": Icd10 i10Preg = Icd10s.GetByCode(defaultPregCode); if (i10Preg != null) { textPregCodeValue.Text = i10Preg.Icd10Code; textPregCodeDescript.Text = i10Preg.Description; } break; default: break; } } #endregion }