Esempio n. 1
0
        public IActionResult Delete(int id)
        {
            PatientLogic patLogic = new PatientLogic(_unitOfWork);

            try
            {
                int deleted = patLogic.DeleteCascade(id);
                //int deleted = patLogic.Delete(id);
                if (deleted > 0)
                {
                    return(Ok());
                }
                //else if (deleted== -1 )
                //{
                //    return BadRequest("Cascade delete is not allowed");
                //}
                else
                {
                    return(NotFound());
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }
Esempio n. 2
0
        public async Task DeletePatient_SuccessResult()
        {
            PatientLogic patientData = new PatientLogic(this.patRepo.Object);

            // Create model
            PatientViewModel model = new PatientViewModel()
            {
                PatientId   = 1,
                FirstName   = "Andrew",
                LastName    = "Moshko",
                MiddleName  = "Victor",
                Age         = "18",
                Weight      = "83",
                Height      = "195",
                Email       = "*****@*****.**",
                PhoneNumber = "+380995135682",
                HomeNumber  = "-",
                Sex         = "man",
                Condition   = "test Patient"
            };

            // Create object Doctor
            Patient patient = model.ToEntity();

            this.ultraRepository.Setup(x => x.AddPatientAsync(patient))
            .ReturnsAsync(patient).Verifiable();

            this.ultraRepository.Setup(x => x.DeletePatientAsync(patient.PatientId))
            .ReturnsAsync(true).Verifiable();

            // Run Code
            var result = await patientData.DeletePatientAsync(model.PatientId); // AddAsync(mockModel.Object);

            Assert.True(result);
        }
Esempio n. 3
0
        public IActionResult Post(PatientPostBM inputs)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            else
            {
                PatientLogic aptLogic = new PatientLogic(_unitOfWork);

                Patient pat;
                inputs.ConvertTo(out pat);

                try
                {
                    Patient result = aptLogic.Create(pat);

                    if (result != null)
                    {
                        return(new JsonResult(result));
                    }
                    else
                    {
                        return(NotFound());
                    }
                }
                catch (Exception ex)
                {
                    return(BadRequest(ex));
                }
            }
        }
Esempio n. 4
0
        private async void AppointmentsListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var appointment = (AppointmentModel)e.SelectedItem;

            var patient = await PatientLogic.GetPatientAsync(General.UserId);

            var fullname = PatientLogic.GetFullName(patient.FirstName, patient.Surname);

            if (allAppointments.Any(a => a.PatientName == fullname && a.PatientID == patient.UserID))
            {
                await DisplayAlert("Appointment", "You already have an appointment booked!", "Okay");
            }
            else
            {
                var symptoms = await DisplayPromptAsync("Book Appointment",
                                                        string.Format("{0}, {1}", appointment.AppointmentTime.ToLongDateString(),
                                                                      appointment.AppointmentTime.ToShortTimeString()),
                                                        "Book", "Close", "Your symptoms ...");

                if (string.IsNullOrEmpty(symptoms))
                {
                }
                else
                {
                    appointment.symtoms      = symptoms;
                    appointment.diagnosis    = string.Empty;
                    appointment.PatientModel = patient;
                    appointment.PatientName  = string.Format("{0} {1}", patient.FirstName, patient.Surname);
                    appointment.PatientID    = patient.UserID;

                    await AppointmentLogic.UpdateCustomerAsync(appointment);
                }
            }
        }
Esempio n. 5
0
        public IActionResult Put(PatientPutBM inputs)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            else
            {
                PatientLogic patLogic = new PatientLogic(_unitOfWork);

                try
                {
                    if (patLogic.Update(inputs.Id, inputs.FirstName, inputs.LastName, inputs.DateOfBirth) > 0)
                    {
                        return(Ok());
                    }
                    else
                    {
                        return(NotFound());
                    }
                }
                catch (Exception ex)
                {
                    return(BadRequest(ex));
                }
            }
        }
Esempio n. 6
0
        public async Task DeletePatient_ExceptionResult()
        {
            PatientLogic doctorLogic = new PatientLogic(this.patRepo.Object);

            int?id = null;

            await Assert.ThrowsAsync <Exception>(async() =>
            {
                var result = await doctorLogic.DeletePatientAsync((int)id);
            });
        }
Esempio n. 7
0
        public async Task AddPatient_ExceptionResult()
        {
            PatientLogic patientLogic = new PatientLogic(this.patRepo.Object);

            PatientViewModel model = new PatientViewModel();

            await Assert.ThrowsAsync <Exception>(async() =>
            {
                var result = await patientLogic.AddPatientAsync(model);
            });
        }
Esempio n. 8
0
        public void Insert_ValidPatient_True()
        {
            // Arrange
            var logic   = new PatientLogic(new PatientRepo(new MemoryPatientContext()));
            var patient = GenerateValidPatient();

            // Act
            var isAccepted = logic.Insert(patient);

            // Assert
            Assert.True(isAccepted);
        }
Esempio n. 9
0
        public void Update_PatientDoesNotExist_False()
        {
            // Arrange
            var logic   = new PatientLogic(new PatientRepo(new MemoryPatientContext()));
            var patient = GenerateValidPatient();

            // Act
            var isAccepted = logic.Update(patient);

            // Assert
            Assert.False(isAccepted);
        }
Esempio n. 10
0
        public void Insert_AlreadyExistsInContext_False()
        {
            // Arrange
            var logic   = new PatientLogic(new PatientRepo(new MemoryPatientContext()));
            var patient = GenerateValidPatient();

            // Act
            logic.Insert(patient);
            var isAccepted = logic.Insert(patient);

            // Assert
            Assert.False(isAccepted);
        }
Esempio n. 11
0
        public void Update_ValidPatient_True()
        {
            // Arrange
            var logic           = new PatientLogic(new PatientRepo(new MemoryPatientContext()));
            var existingPatient = GenerateValidPatient();
            var patient         = existingPatient;

            // Act
            logic.Insert(existingPatient);
            var isAccepted = logic.Update(patient);

            // Assert
            Assert.True(isAccepted);
        }
Esempio n. 12
0
 private void FormCloneAdd_Load(object sender, EventArgs e)
 {
     //Make sure that this patient is not already a clone of another patient.  We don't allow clones of clones.
     //PatientLink.PatNumFrom is the master and PatientLink.PatNumTo is the actual clone.  We care if this patient has ever been a "PatNumTo".
     if (PatientLinks.IsPatientAClone(_patientMaster.PatNum))
     {
         MsgBox.Show(this, "Cannot create a clone of a clone.  Please select the original patient in order to create another clone.");
         return;
     }
     textLName.Text     = _patientMaster.LName;
     textFName.Text     = _patientMaster.FName;
     textPreferred.Text = _patientMaster.Preferred;
     textMiddleI.Text   = _patientMaster.MiddleI;
     textBirthDate.Text = (_patientMaster.Birthdate.Year < 1880) ? "" : _patientMaster.Birthdate.ToShortDateString();
     textAge.Text       = PatientLogic.DateToAgeString(_patientMaster.Birthdate, _patientMaster.DateTimeDeceased);
     //We intentionally don't synch the patient's provider since the clone feature is so the clone can be assigned to a different provider for tracking production.
     _provNumSelected = PrefC.GetLong(PrefName.PracticeDefaultProv);
     _listProviders   = Providers.GetDeepCopy(true);
     comboPriProv.Items.Clear();
     for (int i = 0; i < _listProviders.Count; i++)
     {
         comboPriProv.Items.Add(_listProviders[i].GetLongDesc());
         if (_listProviders[i].ProvNum == _provNumSelected)
         {
             comboPriProv.SelectedIndex = i;
         }
     }
     if (_provNumSelected == 0)
     {
         comboPriProv.SelectedIndex = 0;
         _provNumSelected           = _listProviders[0].ProvNum;
     }
     if (comboPriProv.SelectedIndex == -1)
     {
         comboPriProv.Text = Providers.GetLongDesc(_provNumSelected);
     }
     labelSpecialty.Visible = true;
     comboSpecialty.Visible = true;
     if (PrefC.HasClinicsEnabled)
     {
         labelClinic.Visible = true;
         comboClinic.Visible = true;
         FillClinicComboBoxes();
     }
     else             //Without clinics enabled the specialty box is filled differently.
     {
         FillComboSpecialtyNoClinics();
     }
 }
Esempio n. 13
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            patients = await PatientLogic.GetPatients();

            HttpClientHandler httpClientHandler = new HttpClientHandler();

            httpClientHandler.ServerCertificateCustomValidationCallback =
                (message, cert, chain, errors) => { return(true); };

            var client = new System.Net.Http.HttpClient(httpClientHandler);

            System.IO.Stream imagestream = await client.GetStreamAsync(General.URL + "/Content/title.jpg");

            imageLogin.Source = ImageSource.FromStream(() => imagestream);
        }
Esempio n. 14
0
        public void Insert_NegativeAge_False()
        {
            // Arrange
            var logic   = new PatientLogic(new PatientRepo(new MemoryPatientContext()));
            var patient = new Patient()
            {
                Name       = "Mark",
                Age        = -6,
                IsApproved = false
            };

            // Act
            var isAccepted = logic.Insert(patient);

            // Assert
            Assert.False(isAccepted);
        }
Esempio n. 15
0
        public void Insert_NameWhitespace_False()
        {
            // Arrange
            var logic   = new PatientLogic(new PatientRepo(new MemoryPatientContext()));
            var patient = new Patient
            {
                Name       = " ",
                Age        = 18,
                IsApproved = false
            };

            // Act
            var isAccepted = logic.Insert(patient);

            // Assert
            Assert.False(isAccepted);
        }
Esempio n. 16
0
        public async Task AddPatient_SuccessResult()
        {
            PatientLogic patientData = new PatientLogic(this.patRepo.Object);

            // Create model
            PatientViewModel model = new PatientViewModel()
            {
                PatientId   = 1,
                FirstName   = "Andrew",
                LastName    = "Moshko",
                MiddleName  = "Victor",
                Age         = "18",
                Weight      = "83",
                Height      = "195",
                Email       = "*****@*****.**",
                PhoneNumber = "+380995135682",
                HomeNumber  = "-",
                Sex         = "man",
                Condition   = "test Patient"
            };

            // Create object Doctor
            Patient patient = model.ToEntity();

            this.ultraRepository.Setup(x => x.AddPatientAsync(patient))
            .ReturnsAsync(patient).Verifiable();

            // Run Code
            var result = await patientData.AddPatientAsync(model);

            // validate true result
            Assert.Equal(result.PatientId, model.PatientId);
            Assert.Equal(result.FirstName, model.FirstName);
            Assert.Equal(result.LastName, model.LastName);
            Assert.Equal(result.MiddleName, model.MiddleName);
            Assert.Equal(result.Age, model.Age);
            Assert.Equal(result.Weight, model.Weight);
            Assert.Equal(result.Height, model.Height);
            Assert.Equal(result.Email, model.Email);
            Assert.Equal(result.PhoneNumber, model.PhoneNumber);
            Assert.Equal(result.HomeNumber, model.HomeNumber);
            Assert.Equal(result.Sex, model.Sex);
            Assert.Equal(result.Condition, model.Condition);
        }
Esempio n. 17
0
        public void Update_NameWhitespace_False()
        {
            // Arrange
            var logic           = new PatientLogic(new PatientRepo(new MemoryPatientContext()));
            var existingPatient = GenerateValidPatient();
            var patient         = new Patient
            {
                Name       = " ",
                Age        = 18,
                IsApproved = false
            };

            // Act
            logic.Insert(existingPatient);
            var isAccepted = logic.Update(patient);

            // Assert
            Assert.False(isAccepted);
        }
Esempio n. 18
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            var appointmentLogic = new AppointmentLogic();
            await appointmentLogic.Init();

            var patient = await PatientLogic.GetPatientAsync(General.UserId);

            if (appointmentLogic.AllAppointments.Any(a => a.PatientName == PatientLogic.GetFullName(patient.FirstName, patient.Surname) &&
                                                     !a.Complete && a.PatientID == patient.UserID))
            {
                current = appointmentLogic.GetCurrentAppointment(patient, appointmentLogic.AllAppointments);

                titleLabel.IsVisible   = false;
                loadingLabel.IsVisible = false;
                detailsFrame.IsVisible = true;
                dateSpan.Text          = current.AppointmentTime.ToLongDateString() + ", ";
                timeSpan.Text          = current.AppointmentTime.ToShortTimeString();
                symptomsSpan.Text      = current.symtoms;

                if (current.Confirmed)
                {
                    statusSpan.TextColor = Color.Green;
                    statusSpan.Text      = "confirmed";
                }
                else
                {
                    statusSpan.TextColor = Color.Red;
                    statusSpan.Text      = "Pending";
                }
            }
            else
            {
                titleLabel.IsVisible = true;
                titleLabel.Text      = "You don't have an appointment booked.";
                titleLabel.HorizontalTextAlignment = TextAlignment.Center;
                loadingLabel.IsVisible             = false;
                detailsFrame.IsVisible             = false;
            }
        }
Esempio n. 19
0
        public static void FillPtInfo(OpenDental.ContrChart sender, Patient PatCur)
        {
            //first, get all the objects we need. Because they are by ref, the original gets altered.
            ODGrid     gridPtInfo         = (ODGrid)sender.Controls.Find("gridPtInfo", true)[0];
            TabControl tabControlImages   = (TabControl)sender.Controls.Find("tabControlImages", true)[0];
            TextBox    textTreatmentNotes = (TextBox)sender.Controls.Find("textTreatmentNotes", true)[0];
            //bool TreatmentNoteChanged=sender.TreatmentNoteChanged;//might have to do a by ref here?
            //Then get some data that we need
            Family         fam            = null;
            PatientNote    PatientNoteCur = null;
            List <PatPlan> PatPlanList    = null;
            List <InsSub>  SubList        = null;
            List <InsPlan> PlanList       = null;

            if (PatCur != null)
            {
                fam            = Patients.GetFamily(PatCur.PatNum);
                PatientNoteCur = PatientNotes.Refresh(PatCur.PatNum, PatCur.Guarantor);
                PatPlanList    = PatPlans.Refresh(PatCur.PatNum);
                SubList        = InsSubs.RefreshForFam(fam);
                PlanList       = InsPlans.RefreshForSubList(SubList);
            }
            //Then, continue with the slightly altered original method.
            gridPtInfo.Height       = tabControlImages.Top - gridPtInfo.Top;
            textTreatmentNotes.Text = "";
            if (PatCur != null)
            {
                textTreatmentNotes.Text    = PatientNoteCur.Treatment;
                textTreatmentNotes.Enabled = true;
                textTreatmentNotes.Select(textTreatmentNotes.Text.Length + 2, 1);
                textTreatmentNotes.ScrollToCaret();
                sender.TreatmentNoteChanged = false;
            }
            gridPtInfo.BeginUpdate();
            gridPtInfo.Columns.Clear();
            ODGridColumn col = new ODGridColumn("", 100);         //Lan.g("TableChartPtInfo",""),);

            gridPtInfo.Columns.Add(col);
            col = new ODGridColumn("", 300);
            gridPtInfo.Columns.Add(col);
            gridPtInfo.Rows.Clear();
            if (PatCur == null)
            {
                gridPtInfo.EndUpdate();
                return;
            }
            ODGridRow row;

            //Age
            row = new ODGridRow();
            row.Cells.Add("Age");
            row.Cells.Add(PatientLogic.DateToAgeString(PatCur.Birthdate));
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Credit type
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "ABC0"));
            row.Cells.Add(PatCur.CreditType);
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Billing type
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Billing Type"));
            row.Cells.Add(DefC.GetName(DefCat.BillingTypes, PatCur.BillingType));
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Referrals
            RefAttach[] RefAttachList = RefAttaches.Refresh(PatCur.PatNum);
            for (int i = 0; i < RefAttachList.Length; i++)
            {
                row            = new ODGridRow();
                row.ColorBackG = Color.Aquamarine;
                if (RefAttachList[i].IsFrom)
                {
                    row.Cells.Add("Referred From");
                }
                else
                {
                    row.Cells.Add("Referred To");
                }
                row.Cells.Add(Referrals.GetNameLF(RefAttachList[i].ReferralNum));
                row.Tag = null;
                gridPtInfo.Rows.Add(row);
            }
            //Date First Visit
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Date First Visit"));
            if (PatCur.DateFirstVisit.Year < 1880)
            {
                row.Cells.Add("??");
            }
            else if (PatCur.DateFirstVisit == DateTime.Today)
            {
                row.Cells.Add(Lan.g("TableChartPtInfo", "NEW PAT"));
            }
            else
            {
                row.Cells.Add(PatCur.DateFirstVisit.ToShortDateString());
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Prov - Pri & Sec
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Prov. (Pri, Sec)"));
            if (PatCur.SecProv != 0)
            {
                row.Cells.Add(Providers.GetAbbr(PatCur.PriProv) + ", " + Providers.GetAbbr(PatCur.SecProv));
            }
            else
            {
                row.Cells.Add(Providers.GetAbbr(PatCur.PriProv) + ", " + "None");
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //PriIns
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Pri Ins"));
            string name;

            if (PatPlanList.Count > 0)
            {
                name = InsPlans.GetCarrierName(PatPlans.GetPlanNum(PatPlanList, 1), PlanList);
                if (PatPlanList[0].IsPending)
                {
                    name += Lan.g("TableChartPtInfo", " (pending)");
                }
                row.Cells.Add(name);
            }
            else
            {
                row.Cells.Add("");
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //SecIns
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Sec Ins"));
            if (PatPlanList.Count > 1)
            {
                name = InsPlans.GetCarrierName(PatPlans.GetPlanNum(PatPlanList, 2), PlanList);
                if (PatPlanList[1].IsPending)
                {
                    name += Lan.g("TableChartPtInfo", " (pending)");
                }
                row.Cells.Add(name);
            }
            else
            {
                row.Cells.Add("");
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Registration keys-------------------------------------------------------------------------------------------
            if (PrefC.GetBool(PrefName.DistributorKey))
            {
                RegistrationKey[] keys = RegistrationKeys.GetForPatient(PatCur.PatNum);
                for (int i = 0; i < keys.Length; i++)
                {
                    row = new ODGridRow();
                    row.Cells.Add(Lan.g("TableChartPtInfo", "Registration Key"));
                    string str = keys[i].RegKey.Substring(0, 4) + "-" + keys[i].RegKey.Substring(4, 4) + "-" +
                                 keys[i].RegKey.Substring(8, 4) + "-" + keys[i].RegKey.Substring(12, 4);
                    if (keys[i].IsForeign)
                    {
                        str += "\r\nForeign";
                    }
                    else
                    {
                        str += "\r\nUSA";
                    }
                    str += "\r\nStarted: " + keys[i].DateStarted.ToShortDateString();
                    if (keys[i].DateDisabled.Year > 1880)
                    {
                        str += "\r\nDisabled: " + keys[i].DateDisabled.ToShortDateString();
                    }
                    if (keys[i].DateEnded.Year > 1880)
                    {
                        str += "\r\nEnded: " + keys[i].DateEnded.ToShortDateString();
                    }
                    if (keys[i].Note != "")
                    {
                        str += keys[i].Note;
                    }
                    row.Cells.Add(str);
                    row.Tag = keys[i].Copy();
                    gridPtInfo.Rows.Add(row);
                }
            }
            ODGridCell cell;
            //medical fields-----------------------------------------------------------------
            bool showMed = true;

            if (Programs.IsEnabled(ProgramName.eClinicalWorks) && ProgramProperties.GetPropVal(ProgramName.eClinicalWorks, "IsStandalone") == "0")
            {
                showMed = false;
            }
            if (showMed)
            {
                //premed flag.
                if (PatCur.Premed)
                {
                    row = new ODGridRow();
                    row.Cells.Add("");
                    cell           = new ODGridCell();
                    cell.Text      = Lan.g("TableChartPtInfo", "Premedicate");
                    cell.ColorText = Color.Red;
                    cell.Bold      = YN.Yes;
                    row.Cells.Add(cell);
                    row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                    row.Tag        = "med";
                    gridPtInfo.Rows.Add(row);
                }
                //diseases
                Disease[] DiseaseList = Diseases.Refresh(PatCur.PatNum);
                row       = new ODGridRow();
                cell      = new ODGridCell(Lan.g("TableChartPtInfo", "Diseases"));
                cell.Bold = YN.Yes;
                row.Cells.Add(cell);
                if (DiseaseList.Length > 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(Lan.g("TableChartPtInfo", "none"));
                }
                row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                for (int i = 0; i < DiseaseList.Length; i++)
                {
                    row            = new ODGridRow();
                    cell           = new ODGridCell(DiseaseDefs.GetName(DiseaseList[i].DiseaseDefNum));
                    cell.ColorText = Color.Red;
                    cell.Bold      = YN.Yes;
                    row.Cells.Add(cell);
                    row.Cells.Add(DiseaseList[i].PatNote);
                    row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                    row.Tag        = "med";
                    gridPtInfo.Rows.Add(row);
                }
                //MedUrgNote
                row = new ODGridRow();
                row.Cells.Add(Lan.g("TableChartPtInfo", "Med Urgent"));
                cell           = new ODGridCell();
                cell.Text      = PatCur.MedUrgNote;
                cell.ColorText = Color.Red;
                cell.Bold      = YN.Yes;
                row.Cells.Add(cell);
                row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                //Medical
                row = new ODGridRow();
                row.Cells.Add(Lan.g("TableChartPtInfo", "Medical Summary"));
                row.Cells.Add(PatientNoteCur.Medical);
                row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                //Service
                row = new ODGridRow();
                row.Cells.Add(Lan.g("TableChartPtInfo", "Service Notes"));
                row.Cells.Add(PatientNoteCur.Service);
                row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                //medications
                Medications.Refresh();
                MedicationPats.Refresh(PatCur.PatNum);
                row       = new ODGridRow();
                cell      = new ODGridCell(Lan.g("TableChartPtInfo", "Medications"));
                cell.Bold = YN.Yes;
                row.Cells.Add(cell);
                if (MedicationPats.List.Length > 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(Lan.g("TableChartPtInfo", "none"));
                }
                row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                string     text;
                Medication med;
                for (int i = 0; i < MedicationPats.List.Length; i++)
                {
                    row  = new ODGridRow();
                    med  = Medications.GetMedication(MedicationPats.List[i].MedicationNum);
                    text = med.MedName;
                    if (med.MedicationNum != med.GenericNum)
                    {
                        text += "(" + Medications.GetMedication(med.GenericNum).MedName + ")";
                    }
                    row.Cells.Add(text);
                    text = MedicationPats.List[i].PatNote
                           + "(" + Medications.GetGeneric(MedicationPats.List[i].MedicationNum).Notes + ")";
                    row.Cells.Add(text);
                    row.ColorBackG = DefC.Long[(int)DefCat.MiscColors][3].ItemColor;
                    row.Tag        = "med";
                    gridPtInfo.Rows.Add(row);
                }
            }            //if !eCW.enabled
            gridPtInfo.EndUpdate();
        }