Ejemplo n.º 1
0
        private void butDelete_Click(object sender, EventArgs e)
        {
            if (EhrNotPerfCur.IsNew)
            {
                DialogResult = DialogResult.Cancel;
                return;
            }
            if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
            {
                return;
            }
            Vitalsign vitCur = Vitalsigns.GetFromEhrNotPerformedNum(EhrNotPerfCur.EhrNotPerformedNum);

            if (vitCur != null)
            {
                if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "Deleting this will remove it from the vitalsign exam it refers to.\r\nDelete anyway?"))
                {
                    return;
                }
                vitCur.EhrNotPerformedNum = 0;
                Vitalsigns.Update(vitCur);
            }
            EhrNotPerformeds.Delete(EhrNotPerfCur.EhrNotPerformedNum);
            DialogResult = DialogResult.Cancel;
        }
Ejemplo n.º 2
0
        private void butOK_Click(object sender, EventArgs e)
        {
            //validate--------------------------------------
            DateTime date;

            if (textDate.Text == "")
            {
                MsgBox.Show(this, "Please enter a date.");
                return;
            }
            try {
                date = DateTime.Parse(textDate.Text);
            }
            catch {
                MsgBox.Show(this, "Please fix date first.");
                return;
            }
            //we force the date to match the item not being performed (like vitalsign exam) by making the date text box read only if launched from other item.  Users can still manually add a not performed item from FormEhrNotPerformed by pressing Add and choose any valid date they wish, but it will not be linked to an item.
            string codeValReas = "";
            string codeSysReas = "";

            if (comboCodeReason.SelectedIndex < 1)           //selected 'none' or possibly still -1 (although -1 should never happen)
            {
                if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "If you do not select one of the reasons provided it may be harder to meet your Clinical Quality Measures.  Are you sure you want to continue without selecting a valid reason for not performing the " + Enum.GetNames(typeof(EhrNotPerformedItem))[SelectedItemIndex] + "?"))
                {
                    return;
                }
                codeValReas = "";
                codeSysReas = "";
            }
            else
            {
                codeValReas = listEhrCodesReason[comboCodeReason.SelectedIndex - 1].CodeValue;            //SelectedIndex-1 to account for 'none'
                codeSysReas = listEhrCodesReason[comboCodeReason.SelectedIndex - 1].CodeSystem;
            }
            //save--------------------------------------
            EhrNotPerfCur.DateEntry        = date;
            EhrNotPerfCur.CodeValueReason  = codeValReas;
            EhrNotPerfCur.CodeSystemReason = codeSysReas;
            EhrNotPerfCur.Note             = textNote.Text;
            if (EhrNotPerfCur.IsNew)
            {
                EhrNotPerfCur.EhrNotPerformedNum = EhrNotPerformeds.Insert(EhrNotPerfCur);
            }
            else
            {
                EhrNotPerformeds.Update(EhrNotPerfCur);
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 3
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();
        }