Exemplo n.º 1
0
        private void FillFamily()
        {
            PatNumSelected = _patCur.PatNum;          //just in case user has selected a different family member
            _listRecalls   = Recalls.GetList(_famCur.ListPats.ToList());
            //Appointment[] aptsOnePat;
            List <PatientLink> listLinks = PatientLinks.GetLinks(_famCur.ListPats.Select(x => x.PatNum).ToList(), PatientLinkType.Merge);

            listViewFamily.Items.Clear();
            ListViewItem item;
            DateTime     dateDue;
            DateTime     dateSched;

            for (int i = 0; i < _famCur.ListPats.Length; i++)
            {
                if (PatientLinks.WasPatientMerged(_famCur.ListPats[i].PatNum, listLinks))
                {
                    continue;                    //Do not include Merged patients in the displayed list.
                }
                item     = new ListViewItem(_famCur.GetNameInFamFLI(i));
                item.Tag = _famCur.ListPats[i];
                if (_famCur.ListPats[i].PatNum == _patCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(_famCur.ListPats[i].Age.ToString());
                item.SubItems.Add(_famCur.ListPats[i].Gender.ToString());
                dateDue   = DateTime.MinValue;
                dateSched = DateTime.MinValue;
                bool isdisabled = false;
                for (int j = 0; j < _listRecalls.Count; j++)
                {
                    if (_listRecalls[j].PatNum == _famCur.ListPats[i].PatNum &&
                        (_listRecalls[j].RecallTypeNum == RecallTypes.PerioType ||
                         _listRecalls[j].RecallTypeNum == RecallTypes.ProphyType))
                    {
                        dateDue    = _listRecalls[j].DateDue;
                        dateSched  = _listRecalls[j].DateScheduled;
                        isdisabled = _listRecalls[j].IsDisabled;
                    }
                }
                if (isdisabled)
                {
                    item.SubItems.Add(Lan.g(this, "disabled"));
                }
                else if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                if (dateSched.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateSched.ToShortDateString());
                }
                listViewFamily.Items.Add(item);
            }
            checkDone.Checked = _patCur.PlannedIsDone;
            textFinUrg.Text   = _famCur.ListPats[0].FamFinUrgNote;
        }
Exemplo n.º 2
0
        private void FillRecall()
        {
            comboStatus.Items.Clear();
            comboStatus.Items.Add(Lan.g(this, "None"));
            comboStatus.SelectedIndex = 0;
            for (int i = 0; i < DefB.Short[(int)DefCat.RecallUnschedStatus].Length; i++)
            {
                comboStatus.Items.Add(DefB.Short[(int)DefCat.RecallUnschedStatus][i].ItemName);
                if (DefB.Short[(int)DefCat.RecallUnschedStatus][i].DefNum == RecallCur.RecallStatus)
                {
                    comboStatus.SelectedIndex = i + 1;
                }
            }
            textNote.Text = RecallCur.Note;
            //Now, the family list:
            listFamily.Items.Clear();
            Appointment[] aptsOnePat;
            ListViewItem  item;

            Recall[] recallList = Recalls.GetList(FamCur.List);
            DateTime dateDue;

            for (int i = 0; i < FamCur.List.Length; i++)
            {
                item = new ListViewItem(FamCur.GetNameInFamFLI(i));
                if (FamCur.List[i].PatNum == PatCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(Shared.AgeToString(FamCur.List[i].Age));
                item.SubItems.Add(FamCur.List[i].Gender.ToString());
                dateDue = DateTime.MinValue;
                for (int j = 0; j < recallList.Length; j++)
                {
                    if (recallList[j].PatNum == FamCur.List[i].PatNum)
                    {
                        dateDue = recallList[j].DateDue;
                    }
                }
                if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                aptsOnePat = Appointments.GetForPat(FamCur.List[i].PatNum);
                for (int a = 0; a < aptsOnePat.Length; a++)
                {
                    if (aptsOnePat[a].AptDateTime.Date <= DateTime.Today)
                    {
                        continue;                        //disregard old appts.
                    }
                    item.SubItems.Add(aptsOnePat[a].AptDateTime.ToShortDateString());
                    break;                    //we only want one appt
                    //could add condition here to add blank subitem if no date found
                }
                listFamily.Items.Add(item);
                //if(Patients.FamilyList[i].PatNum==Patients.Cur.PatNum){
                //	listFamily.Items[i].Selected=true;//doesn't work
                //}
            }
        }
Exemplo n.º 3
0
        private void Filltb()
        {
            SelectedPatNum = PatCur.PatNum;          //just in case user has selected a different family member
            RecallList     = Recalls.GetList(FamCur.List);
            Appointment[] aptsOnePat;
            listFamily.Items.Clear();
            ListViewItem item;
            DateTime     dateDue;

            for (int i = 0; i < FamCur.List.Length; i++)
            {
                item = new ListViewItem(FamCur.GetNameInFamFLI(i));
                if (FamCur.List[i].PatNum == PatCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(FamCur.List[i].Age.ToString());
                item.SubItems.Add(FamCur.List[i].Gender.ToString());
                dateDue = DateTime.MinValue;
                for (int j = 0; j < RecallList.Length; j++)
                {
                    if (RecallList[j].PatNum == FamCur.List[i].PatNum)
                    {
                        dateDue = RecallList[j].DateDue;
                    }
                }
                if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                aptsOnePat = Appointments.GetForPat(FamCur.List[i].PatNum);
                for (int a = 0; a < aptsOnePat.Length; a++)
                {
                    if (aptsOnePat[a].AptDateTime.Date <= DateTime.Today)
                    {
                        continue;                        //disregard old appts.
                    }
                    item.SubItems.Add(aptsOnePat[a].AptDateTime.ToShortDateString());
                    break;                    //we only want one appt
                    //could add condition here to add blank subitem if no date found
                }
                listFamily.Items.Add(item);
            }
            if (PatCur.NextAptNum == -1)
            {
                checkDone.Checked = true;
            }
            else
            {
                checkDone.Checked = false;
            }
            ListOth = Appointments.GetForPat(PatCur.PatNum);
            tbApts.ResetRows(ListOth.Length);
            tbApts.SetGridColor(Color.DarkGray);
            for (int i = 0; i < ListOth.Length; i++)
            {
                tbApts.Cell[0, i] = ListOth[i].AptStatus.ToString();
                if (ListOth[i].AptDateTime.Year > 1880)
                {
                    //only regular still scheduled appts
                    if (ListOth[i].AptStatus != ApptStatus.Planned && ListOth[i].AptStatus != ApptStatus.PtNote &&
                        ListOth[i].AptStatus != ApptStatus.PtNoteCompleted && ListOth[i].AptStatus != ApptStatus.UnschedList &&
                        ListOth[i].AptStatus != ApptStatus.Broken)
                    {
                        tbApts.Cell[1, i] = ListOth[i].AptDateTime.ToString("d");
                        tbApts.Cell[2, i] = ListOth[i].AptDateTime.ToString("t");
                        if (ListOth[i].AptDateTime < DateTime.Today)                          //Past
                        {
                            tbApts.SetBackColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][11].ItemColor));
                            tbApts.SetTextColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][10].ItemColor));
                        }
                        else if (ListOth[i].AptDateTime.Date == DateTime.Today.Date)                          //Today
                        {
                            tbApts.SetBackColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][9].ItemColor));
                            tbApts.SetTextColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][8].ItemColor));
                            tbApts.Cell[0, i] = Lan.g(this, "Today");
                        }
                        else if (ListOth[i].AptDateTime > DateTime.Today)                          //Future
                        {
                            tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][13].ItemColor);
                            tbApts.SetTextColorRow(i, (DefB.Long[(int)DefCat.ProgNoteColors][12].ItemColor));
                        }
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.Planned)                      //show line for planned appt
                    {
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][16].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][17].ItemColor);
                        tbApts.Cell[0, i] = Lan.g("enumApptStatus", "Planned");
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.PtNote)
                    {
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][18].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][19].ItemColor);
                        tbApts.Cell[0, i] = Lan.g("enumApptStatus", "PtNote");
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.PtNoteCompleted)
                    {
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][20].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][21].ItemColor);
                        tbApts.Cell[0, i] = Lan.g("enumApptStatus", "PtNoteCompleted");
                    }
                    else if (ListOth[i].AptStatus == ApptStatus.Broken | ListOth[i].AptStatus == ApptStatus.UnschedList)
                    {
                        if (ListOth[i].AptStatus == ApptStatus.Broken)
                        {
                            tbApts.Cell[0, i] = Lan.g("enumApptStatus", "Broken");
                        }
                        else
                        {
                            tbApts.Cell[0, i] = Lan.g("enumApptStatus", "UnschedList");
                        }
                        tbApts.SetTextColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][14].ItemColor);
                        tbApts.SetBackColorRow(i, DefB.Long[(int)DefCat.ProgNoteColors][15].ItemColor);
                    }
                }
                else
                {
                    tbApts.Cell[1, i] = "";
                    tbApts.Cell[2, i] = "";
                }
                tbApts.Cell[3, i] = (ListOth[i].Pattern.Length * 5).ToString();
                tbApts.Cell[4, i] = ListOth[i].ProcDescript;
                tbApts.Cell[5, i] = ListOth[i].Note;
            }
            textFinUrg.Text = PatCur.FamFinUrgNote;
            tbApts.LayoutTables();
        }
Exemplo n.º 4
0
        private void Filltb()
        {
            RecallList = Recalls.GetList(FamCur.List);
            Appointment[] aptsOnePat;
            listFamily.Items.Clear();
            ListViewItem item;
            DateTime     dateDue;

            for (int i = 0; i < FamCur.List.Length; i++)
            {
                item = new ListViewItem(FamCur.GetNameInFamFLI(i));
                if (FamCur.List[i].PatNum == PatCur.PatNum)
                {
                    item.BackColor = Color.Silver;
                }
                item.SubItems.Add(FamCur.List[i].Age.ToString());
                item.SubItems.Add(FamCur.List[i].Gender.ToString());
                dateDue = DateTime.MinValue;
                for (int j = 0; j < RecallList.Length; j++)
                {
                    if (RecallList[j].PatNum == FamCur.List[i].PatNum)
                    {
                        dateDue = RecallList[j].DateDue;
                    }
                }
                if (dateDue.Year < 1880)
                {
                    item.SubItems.Add("");
                }
                else
                {
                    item.SubItems.Add(dateDue.ToShortDateString());
                }
                if (dateDue <= DateTime.Today)
                {
                    item.ForeColor = Color.Red;
                }
                aptsOnePat = Appointments.GetForPat(FamCur.List[i].PatNum);
                for (int a = 0; a < aptsOnePat.Length; a++)
                {
                    if (aptsOnePat[a].AptDateTime.Date <= DateTime.Today)
                    {
                        continue;                        //disregard old appts.
                    }
                    item.SubItems.Add(aptsOnePat[a].AptDateTime.ToShortDateString());
                    break;                    //we only want one appt
                    //could add condition here to add blank subitem if no date found
                }
                listFamily.Items.Add(item);
            }
            if (PatCur.NextAptNum == -1)
            {
                checkDone.Checked = true;
            }
            else
            {
                checkDone.Checked = false;
            }
            ListOth = Appointments.GetForPat(PatCur.PatNum);
            tbApts.ResetRows(ListOth.Length);
            tbApts.SetGridColor(Color.DarkGray);
            for (int i = 0; i < ListOth.Length; i++)
            {
                tbApts.Cell[0, i] = ListOth[i].AptStatus.ToString();
                if (ListOth[i].AptDateTime.Year > 1880)
                {
                    if (ListOth[i].AptStatus != ApptStatus.Planned)                  //don't show date/time for planned appts.
                    {
                        tbApts.Cell[1, i] = ListOth[i].AptDateTime.ToString("d");
                        tbApts.Cell[2, i] = ListOth[i].AptDateTime.ToString("t");
                    }
                }
                else
                {
                    tbApts.Cell[1, i] = "";
                    tbApts.Cell[2, i] = "";
                }
                tbApts.Cell[3, i] = (ListOth[i].Pattern.Length * 5).ToString();
                tbApts.Cell[4, i] = ListOth[i].ProcDescript;
                tbApts.Cell[5, i] = ListOth[i].Note;
            }
            tbApts.LayoutTables();
        }