コード例 #1
0
        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;
            }
        }
コード例 #2
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn("Date", 70);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Prov", 50);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Item Not Performed", 130);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Code", 102);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Code Description", 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Reason Code", 80);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Reason Description", 150);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn("Note", 150);
            gridMain.ListGridColumns.Add(col);
            listNotPerf = EhrNotPerformeds.Refresh(PatCur.PatNum);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < listNotPerf.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(listNotPerf[i].DateEntry.ToShortDateString());
                row.Cells.Add(Providers.GetAbbr(listNotPerf[i].ProvNum));
                //Item not performed------------------------------------------------------------
                switch (listNotPerf[i].CodeValue)
                {
                case "39156-5":                        //BMI exam
                    row.Cells.Add(EhrNotPerformedItem.BMIExam.ToString());
                    break;

                case "428191000124101":                        //CurrentMedsDocumented
                    row.Cells.Add(EhrNotPerformedItem.DocumentCurrentMeds.ToString());
                    break;

                case "11366-2":                        //History of tobacco use Narrative
                case "68535-4":                        //Have you used tobacco in the last 30 days
                case "68536-2":                        //Have you used smokeless tobacco in last 30 days
                    row.Cells.Add(EhrNotPerformedItem.TobaccoScreening.ToString());
                    break;

                default:                        //We will default to Influenza Vaccine, there are 26 codes, for this item
                    row.Cells.Add(EhrNotPerformedItem.InfluenzaVaccination.ToString());
                    break;
                }
                //Code not performed------------------------------------------------------------
                row.Cells.Add(listNotPerf[i].CodeValue + " (" + listNotPerf[i].CodeSystem + ")");
                //Description of code not performed---------------------------------------------
                string descript = "";
                //to get description, first determine which table the code is from.  EhrNotPerformed is allowed to be CPT, CVX, LOINC, SNOMEDCT.
                switch (listNotPerf[i].CodeSystem)
                {
                case "CPT":
                    Cpt cptCur = Cpts.GetByCode(listNotPerf[i].CodeValue);
                    if (cptCur != null)
                    {
                        descript = cptCur.Description;
                    }
                    break;

                case "CVX":
                    Cvx cvxCur = Cvxs.GetOneFromDb(listNotPerf[i].CodeValue);
                    if (cvxCur != null)
                    {
                        descript = cvxCur.Description;
                    }
                    break;

                case "LOINC":
                    Loinc lCur = Loincs.GetByCode(listNotPerf[i].CodeValue);
                    if (lCur != null)
                    {
                        descript = lCur.NameLongCommon;
                    }
                    break;

                case "SNOMEDCT":
                    Snomed sCur = Snomeds.GetByCode(listNotPerf[i].CodeValue);
                    if (sCur != null)
                    {
                        descript = sCur.Description;
                    }
                    break;
                }
                row.Cells.Add(descript);
                //Reason Code-------------------------------------------------------------------
                row.Cells.Add(listNotPerf[i].CodeValueReason + " (" + listNotPerf[i].CodeSystemReason + ")");
                //Reason Description------------------------------------------------------------
                descript = "";
                if (listNotPerf[i].CodeValueReason != "")
                {
                    //reason codes are only allowed to be SNOMEDCT codes
                    Snomed sCur = Snomeds.GetByCode(listNotPerf[i].CodeValueReason);
                    if (sCur != null)
                    {
                        descript = sCur.Description;
                    }
                }
                row.Cells.Add(descript);
                //Note--------------------------------------------------------------------------
                row.Cells.Add(listNotPerf[i].Note);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
ファイル: FormEncounters.cs プロジェクト: steev90/opendental
        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();
        }
コード例 #5
0
        private void FillGridInterventions()
        {
            gridInterventions.BeginUpdate();
            gridInterventions.Columns.Clear();
            gridInterventions.Columns.Add(new ODGridColumn("Date", 70));
            gridInterventions.Columns.Add(new ODGridColumn("Type", 150));
            gridInterventions.Columns.Add(new ODGridColumn("Description", 160));
            gridInterventions.Columns.Add(new ODGridColumn("Declined", 60)
            {
                TextAlign = HorizontalAlignment.Center
            });
            gridInterventions.Columns.Add(new ODGridColumn("Documentation", 140));
            gridInterventions.Rows.Clear();
            //build list of rows of CessationInterventions and CessationMedications so we can order the list by date and type before filling the grid
            List <ODGridRow> listRows = new List <ODGridRow>();
            ODGridRow        row;

            #region CessationInterventions
            List <Intervention> listInterventions = Interventions.Refresh(PatCur.PatNum, InterventionCodeSet.TobaccoCessation);
            foreach (Intervention iCur in listInterventions)
            {
                row = new ODGridRow();
                row.Cells.Add(iCur.DateEntry.ToShortDateString());
                string type     = InterventionCodeSet.TobaccoCessation.ToString() + " Counseling";
                string descript = "";
                switch (iCur.CodeSystem)
                {
                case "CPT":
                    Cpt cptCur = Cpts.GetByCode(iCur.CodeValue);
                    descript = cptCur != null?cptCur.Description:"";
                    break;

                case "SNOMEDCT":
                    Snomed sCur = Snomeds.GetByCode(iCur.CodeValue);
                    descript = sCur != null?sCur.Description:"";
                    break;

                case "RXNORM":
                    //if the user checks the "Patient Declined" checkbox, we enter the tobacco cessation medication as an intervention that was declined
                    type = InterventionCodeSet.TobaccoCessation.ToString() + " Medication";
                    RxNorm rCur = RxNorms.GetByRxCUI(iCur.CodeValue);
                    descript = rCur != null?rCur.Description:"";
                    break;
                }
                row.Cells.Add(type);
                row.Cells.Add(descript);
                row.Cells.Add(iCur.IsPatDeclined?"X":"");
                row.Cells.Add(iCur.Note);
                row.Tag = iCur;
                listRows.Add(row);
            }
            #endregion
            #region CessationMedications
            //Tobacco Use Cessation Pharmacotherapy Value Set
            string[] arrayRxCuiStrings = EhrCodes.GetForValueSetOIDs(new List <string> {
                "2.16.840.1.113883.3.526.3.1190"
            }, true)
                                         .Select(x => x.CodeValue).ToArray();
            //arrayRxCuiStrings will contain 41 RxCui strings for tobacco cessation medications if those exist in the rxnorm table
            List <MedicationPat> listMedPats = MedicationPats.Refresh(PatCur.PatNum, true).FindAll(x => arrayRxCuiStrings.Contains(x.RxCui.ToString()));
            foreach (MedicationPat medPatCur in listMedPats)
            {
                row = new ODGridRow();
                List <string> listMedDates = new List <string>();
                if (medPatCur.DateStart.Year > 1880)
                {
                    listMedDates.Add(medPatCur.DateStart.ToShortDateString());
                }
                if (medPatCur.DateStop.Year > 1880)
                {
                    listMedDates.Add(medPatCur.DateStop.ToShortDateString());
                }
                if (listMedDates.Count == 0)
                {
                    listMedDates.Add(medPatCur.DateTStamp.ToShortDateString());
                }
                row.Cells.Add(string.Join(" - ", listMedDates));
                row.Cells.Add(InterventionCodeSet.TobaccoCessation.ToString() + " Medication");
                row.Cells.Add(RxNorms.GetDescByRxCui(medPatCur.RxCui.ToString()));
                row.Cells.Add(medPatCur.PatNote);
                row.Tag = medPatCur;
                listRows.Add(row);
            }
            #endregion
            listRows.OrderBy(x => PIn.Date(x.Cells[0].Text))            //rows ordered by date, oldest first
            .ThenBy(x => x.Cells[3].Text != "")
            //interventions at the top, declined med interventions below normal interventions
            .ThenBy(x => x.Tag.GetType().Name != "Intervention" || ((Intervention)x.Tag).CodeSystem == "RXNORM").ToList()
            .ForEach(x => gridInterventions.Rows.Add(x));                    //then add rows to gridInterventions
            gridInterventions.EndUpdate();
        }
コード例 #6
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Date", 70);

            gridMain.Columns.Add(col);
            col = new ODGridColumn("Type", 170);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Description", 170);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Documentation", 170);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow        row;
            List <ODGridRow> listRows = new List <ODGridRow>();

            #region AssessedEvents
            _ListEvents = EhrMeasureEvents.RefreshByType(PatCur.PatNum, EhrMeasureEventType.TobaccoUseAssessed);
            for (int i = 0; i < _ListEvents.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(_ListEvents[i].DateTEvent.ToShortDateString());
                Loinc lCur = Loincs.GetByCode(_ListEvents[i].CodeValueEvent);              //TobaccoUseAssessed events can be one of three types, all LOINC codes
                if (lCur != null)
                {
                    row.Cells.Add(lCur.NameLongCommon);
                }
                else
                {
                    row.Cells.Add(_ListEvents[i].EventType.ToString());
                }
                Snomed sCur = Snomeds.GetByCode(_ListEvents[i].CodeValueResult);
                if (sCur != null)
                {
                    row.Cells.Add(sCur.Description);
                }
                else
                {
                    row.Cells.Add("");
                }
                row.Cells.Add(_ListEvents[i].MoreInfo);
                row.Tag = _ListEvents[i];
                listRows.Add(row);
            }
            #endregion
            #region CessationInterventions
            _ListInterventions = Interventions.Refresh(PatCur.PatNum, InterventionCodeSet.TobaccoCessation);
            for (int i = 0; i < _ListInterventions.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(_ListInterventions[i].DateEntry.ToShortDateString());
                row.Cells.Add(InterventionCodeSet.TobaccoCessation.ToString() + " Counseling");
                string descript = "";
                switch (_ListInterventions[i].CodeSystem)
                {
                case "CPT":
                    Cpt cptCur = Cpts.GetByCode(_ListInterventions[i].CodeValue);
                    if (cptCur != null)
                    {
                        descript = cptCur.Description;
                    }
                    break;

                case "SNOMEDCT":
                    Snomed sCur = Snomeds.GetByCode(_ListInterventions[i].CodeValue);
                    if (sCur != null)
                    {
                        descript = sCur.Description;
                    }
                    break;
                }
                row.Cells.Add(descript);
                row.Cells.Add(_ListInterventions[i].Note);
                row.Tag = _ListInterventions[i];
                listRows.Add(row);
            }
            #endregion
            #region CessationMedications
            _ListMedPats = MedicationPats.Refresh(PatCur.PatNum, true);
            List <EhrCode> listEhrMeds = EhrCodes.GetForValueSetOIDs(new List <string> {
                "2.16.840.1.113883.3.526.3.1190"
            }, true);                                                                                                                     //Tobacco Use Cessation Pharmacotherapy Value Set
            //listEhrMeds will contain 41 medications for tobacco cessation if those exist in the rxnorm table
            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();
                string dateRange = "";
                if (_ListMedPats[i].DateStart.Year > 1880)
                {
                    dateRange = _ListMedPats[i].DateStart.ToShortDateString();
                }
                if (_ListMedPats[i].DateStop.Year > 1880)
                {
                    if (dateRange != "")
                    {
                        dateRange += " - ";
                    }
                    dateRange += _ListMedPats[i].DateStop.ToShortDateString();
                }
                if (dateRange == "")
                {
                    dateRange = _ListMedPats[i].DateTStamp.ToShortDateString();
                }
                row.Cells.Add(dateRange);
                row.Cells.Add(InterventionCodeSet.TobaccoCessation.ToString() + " Medication");
                string medDescript = RxNorms.GetDescByRxCui(_ListMedPats[i].RxCui.ToString());
                row.Cells.Add(medDescript);
                row.Cells.Add(_ListMedPats[i].PatNote);
                row.Tag = _ListMedPats[i];
                listRows.Add(row);
            }
            #endregion
            listRows.Sort(SortDate);
            for (int i = 0; i < listRows.Count; i++)
            {
                gridMain.Rows.Add(listRows[i]);
            }
            gridMain.EndUpdate();
        }
コード例 #7
0
ファイル: FormEhrSettings.cs プロジェクト: kjb7749/testImport
        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;
                }
            }
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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
        }