Пример #1
0
        // GET: Patient
        //public ActionResult Index()
        //{
        //    return View();
        //}

        public ActionResult Index(PatientList pl)
        {
            if (pl != null && !string.IsNullOrEmpty(pl.Searchname))
            {
                pl = DbUtils.FetchData(pl.Searchname);
            }

            return(View(pl));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "ID,PatientID,phone,Name,DiseaseType,VisitDate,Gender")] PatientList patientList)
 {
     if (ModelState.IsValid)
     {
         db.Entry(patientList).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(patientList));
 }
Пример #3
0
        private void addPatientForm_PatientUpdateEvent(object sender, PersonIdentityEventArgs e)
        {
            var patientAttributesArray = new string[] { e.Id, e.Surname, e.Name, e.Patronymic };
            var patientItem            = new ListViewItem(patientAttributesArray);

            PatientList.Items.Add(patientItem);
            patientItem.EnsureVisible();
            patientItem.Selected = true;
            PatientList.Focus();
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "ID,PatientID,phone,Name,DiseaseType,VisitDate,Gender")] PatientList patientList)
        {
            if (ModelState.IsValid)
            {
                db.Patient.Add(patientList);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(patientList));
        }
Пример #5
0
 private void Add(object p)
 {
     if (PatientList != null)
     {
         PatientList.Add(new MyData()
         {
             Name    = PatientName,
             Address = PatientAddr,
             Age     = PatientAge
         });
     }
 }
Пример #6
0
        /// <summary>
        /// Carga _PatientList
        /// </summary>
        void Populate(out Exception ex)
        {
            ex = null;

            try
            {
                _PatientList = ServiceCalls.RetrivePatients(null);
            }
            catch (Exception err)
            {
                err.Source = "Origen de datos";
                ex         = err;
            }
        }
Пример #7
0
        // GET: PatientLists/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PatientList patientList = db.Patient.Find(id);

            if (patientList == null)
            {
                return(HttpNotFound());
            }
            return(View(patientList));
        }
Пример #8
0
        /// <summary>
        /// Fills Patients' ListView with the query results.
        /// </summary>
        /// <param name="query">Query that implements IMongoQuery interface.</param>
        private void SearchPatients(IMongoQuery query)
        {
            PatientList.InvokeIfRequired(c => { c.Items.Clear(); });
            PatientList.InvokeIfRequired(c => { c.BeginUpdate(); });
            var collection = ServerConnection.GetCollection <Patient>();

            foreach (var patientItem in collection.Find(query))
            {
                string[] patientAttributesArray = new string[] { patientItem.Id.ToString(), patientItem.Surname, patientItem.Name, patientItem.Patronymic };
                PatientList.InvokeIfRequired(c => { c.Items.Add(new ListViewItem(patientAttributesArray)); });
            }
            PatientList.InvokeIfRequired(c => { c.EndUpdate(); });
            PatientList.InvokeIfRequired(c => { c.ListViewItemSorter = new ListViewSorter(); });
        }
Пример #9
0
        public HttpResponseMessage GetAllPatients(Patients _patient)
        {
            PatientList plist = new PatientList();

            plist.patients = GetAll(_patient);
            if (plist.patients.Count > 0)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, plist));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.OK, "No patient found."));
            }
        }
Пример #10
0
        private void OnRefresh(object obj)
        {
            PatientList.Clear();
            // typ wyszukiwania (rozpoczynamy od pacjenta)
            gdcm.ERootType typ = gdcm.ERootType.ePatientRootType;

            // do jakiego poziomu wyszukujemy
            gdcm.EQueryLevel poziom = gdcm.EQueryLevel.ePatient; // zobacz inne

            // klucze (filtrowanie lub okreœlenie, które dane s¹ potrzebne)
            gdcm.KeyValuePairArrayType klucze = new gdcm.KeyValuePairArrayType();
            //gdcm.Tag tag = new gdcm.Tag(0x0010, 0x0010);
            gdcm.KeyValuePairType klucz1 = new gdcm.KeyValuePairType(new gdcm.Tag(0x0010, 0x0010), "*");
            klucze.Add(klucz1);
            klucze.Add(new gdcm.KeyValuePairType(new gdcm.Tag(0x0010, 0x0020), ""));

            // skonstruuj zapytanie
            gdcm.BaseRootQuery zapytanie = gdcm.CompositeNetworkFunctions.ConstructQuery(typ, poziom, klucze);

            // sprawdŸ, czy zapytanie spe³nia kryteria
            if (!zapytanie.ValidateQuery())
            {
                State = "B³êdne zapytanie";
                return;
            }

            // wykonaj zapytanie
            gdcm.DataSetArrayType wynik = new gdcm.DataSetArrayType();
            bool stan = gdcm.CompositeNetworkFunctions.CFind(IP, ushort.Parse(Port), zapytanie, wynik, AET, "ARCHIWUM");

            // sprawdŸ stan
            if (!stan)
            {
                State = "Nie dzia³a";
                return;
            }

            // poka¿ wyniki
            foreach (gdcm.DataSet x in wynik)
            {
                // jeden element pary klucz-wartoϾ
                gdcm.DataElement de = x.GetDataElement(new gdcm.Tag(0x0010, 0x0020)); // konkretnie 10,20 = PATIENT_ID

                // dostêp jako string
                gdcm.Value val = de.GetValue();  // pobierz wartoϾ dla wskazanego klucza...
                string     str = val.toString(); // ...jako napis
                PatientList.Add(str);
            }
        }
Пример #11
0
        private void BtnSearchPatient_Click(object sender, RoutedEventArgs e)
        {
            PatientList selectPatient = new PatientList();

            if (selectPatient.ShowDialog() == true)
            {
                this.SystemCase = new Case(selectPatient.SelectedPatient)
                {
                    Status = "Wartet", Location = "Wartezimmer"
                };
                this.DataContext                   = this.SystemCase;
                this.btnEditData.IsEnabled         = true;
                this.btnAddNewParameters.IsEnabled = true;
            }
        }
Пример #12
0
        void ExecuteLoadingCommand()
        {
            _paientListRegion = RegionMannager.Regions[RegionNames.PatientListRegion];
            _patientListView  = ContainerLocator.Current.Resolve <PatientList>();
            _paientListRegion.Add(_patientListView);

            var uniformContentRegion = RegionMannager.Regions["UniformContentRegion"];
            var regionAdapterView1   = ContainerLocator.Current.Resolve <RegionAdapterView1>();

            uniformContentRegion.Add(regionAdapterView1);
            var regionAdapterView2 = ContainerLocator.Current.Resolve <RegionAdapterView2>();

            uniformContentRegion.Add(regionAdapterView2);

            _medicineListRegion = RegionMannager.Regions[RegionNames.MedicineMainContentRegion];
        }
        // GET: PatientInfoes
        public ActionResult Index()
        {
            IEnumerable <PatientInfo> PatientList;

            if (!string.IsNullOrEmpty(Request.Unvalidated["searchItem"]))
            {
                string searchItem = Request.Unvalidated["searchItem"];
                int    Labno      = -1;
                if (int.TryParse(searchItem, out Labno)) //searchItem is lab no
                {
                    if (db.PatientInfo.Where(x => x.LabNo == Labno).SingleOrDefault() != null)
                    {
                        PatientList = db.PatientInfo.Where(x => x.LabNo == Labno);
                        PatientList = PatientList.OrderByDescending(x => x.CreatedOn.Date).ThenByDescending(x => x.CreatedOn.TimeOfDay);
                        return(View(PatientList));
                    }
                    else
                    {
                        ViewBag.message = "No record found. Click to go back";
                        return(View());
                    }
                }
                else if (searchItem.All(c => Char.IsLetter(c) || c == ' ')) //searchItem is name
                {
                    PatientList = db.PatientInfo.Where(x => x.Name.Contains(searchItem));
                    PatientList = PatientList.OrderByDescending(x => x.CreatedOn.Date).ThenByDescending(x => x.CreatedOn.TimeOfDay);
                    if (PatientList != null && PatientList.Any() == true)
                    {
                        return(View(PatientList));
                    }
                    else
                    {
                        ViewBag.message = "No record found. Click to go back";
                        return(View());
                    }
                }
                else //searchItem is bad
                {
                    ViewBag.message = "No record found. Click to go back";
                    return(View());
                }
            }

            PatientList = db.PatientInfo;
            PatientList = PatientList.OrderByDescending(x => x.CreatedOn.Date).ThenByDescending(x => x.CreatedOn.TimeOfDay);
            return(View(PatientList));
        }
Пример #14
0
        public static PatientList FetchData(string name)
        {
            PatientContext db = new PatientContext();

            PatientList patientList = new PatientList();

            patientList.Searchname = name;

            string query = "SELECT * FROM Patient WHERE PatientName='" + name + "' and IsSensitive = 0";

            //db.Database.ExecuteSqlCommand(query);

            patientList.Patients = db.Patients
                                   .SqlQuery(query)
                                   .ToList <Patient>();
            return(patientList);
        }
Пример #15
0
        private void DeletePatientMethod()
        {
            int id = SelectedPatient.id;

            if (Patients.DeletePatient(id))
            {
                var msg = Utils.Utils.createMessageBox("Le patient " + SelectedPatient.prettyname + " a été supprimé avec succès !");
                msg.Show();
                //MessageBox.Show("Le patient " + SelectedPatient.prettyname + " a été supprimé avec succès !");
                PatientList.Remove(PatientList.Where(i => i.id == id).Single());
                SelectedPatient = PatientList.Count > 0 ? PatientList.First() : null;
            }
            else
            {
                MaterialMessageBox.ShowError("Le patient " + SelectedPatient.prettyname + " n'a pas put être supprimé Réessayez plus tard !");
                //MessageBox.Show("Le patient " + SelectedPatient.prettyname + " n'a pas put être supprimé Réessayez plus tard !");
            }
        }
Пример #16
0
        public MainWindowViewModel()
        {
            PatientList.Add(new PatientData()
            {
                PatientName   = "이선주",
                PatientNumber = "A20",
                PatientGender = "여",
                PatientAge    = 10
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "송재원",
                PatientNumber = "B30",
                PatientGender = "남",
                PatientAge    = 20
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "류다영",
                PatientNumber = "C40",
                PatientGender = "여",
                PatientAge    = 30
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "박종현",
                PatientNumber = "D50",
                PatientGender = "남",
                PatientAge    = 40
            });

            PatientList.Add(new PatientData()
            {
                PatientName   = "채민규",
                PatientNumber = "E60",
                PatientGender = "남",
                PatientAge    = 50
            });
        }
Пример #17
0
        /// <summary>
        /// Dicomdir 정보를 화면에 보여준다.
        /// </summary>
        private void GetPatientDicomImages(PatientList patList)
        {
            try
            {
                if (patList == null)
                {
                    return;
                }

                if (patList.Base != null)
                {
                    DataTable dt = DicomDirReader.GetImageList(patList.Base);
                    this.DisplayPatientDicomInfo(dt);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #18
0
        private void List_Selection(object sender, SelectionChangedEventArgs e)
        {
            var Patient = PatientList.SelectedItem as Patient;

            if (Patient != null)
            {
                var window = new SelectedPatient(Patient)
                {
                    Owner = (Window)PresentationSource.FromVisual(this).RootVisual
                };
                window.Closed += Window_Closed;
                window.ShowDialog();
                PatientList.UnselectAll();
            }

            if (!string.IsNullOrEmpty(SearchTextBox.Text))
            {
                SearchTextBox.Text = string.Empty;
            }
        }
Пример #19
0
        public MainViewModel()
        {
            initCharts();

            DeleteUserCommand    = new RelayCommand(DeleteUserMethod);
            NewUserCommand       = new RelayCommand(NewUserMethod);
            NewObsCommand        = new RelayCommand(NewObsMethod);
            DeletePatientCommand = new RelayCommand(DeletePatientMethod);
            NewPatientCommand    = new RelayCommand(NewPatientMethod);
            DisconnectCommand    = new RelayCommand(DisconnectMethod);
            RefreshPatientList   = new RelayCommand(RefreshPatientListMethod);
            RefreshUserList      = new RelayCommand(RefreshUserListMethod);
            _worker.DoWork      += new DoWorkEventHandler((s, e) =>
            {
                ListUsers    = Users.GetAllUsers();
                CurrUser     = Users.GetUser(CurrUserLogin);
                SelectedUser = ListUsers.First();
                FullListUser = new ObservableCollection <User>(ListUsers);
                setVisibility(CurrUserLogin);
            });
            _worker.RunWorkerAsync();
            _workerPatients.RunWorkerCompleted += new RunWorkerCompletedEventHandler((e, s) =>
            {
                SelectedPatient = PatientList.Count > 0 ? PatientList.Last() : null;
            }
                                                                                     );
            _workerPatients.DoWork += new DoWorkEventHandler((s, e) =>
            {
                PatientList     = Patients.GetAllPatients();
                FullListPatient = new ObservableCollection <Patient>(PatientList);
            });
            _workerPatients.RunWorkerAsync();
            _searchUserWorker.DoWork += new DoWorkEventHandler((e, s) =>
            {
                DoWorkSearchUser(SearchBoxTextUser);
            });
            _searchPatientWorker.DoWork += new DoWorkEventHandler((e, s) =>
            {
                DoWorkSearchPatient(SearchBoxTextPatient);
            });
        }
Пример #20
0
        public List <Patient> Patients()   //sorted patients
        {
            List <Patient> PatientSortedList = new List <Patient>();

            if (HowToSort == "Alphabetically")   //sorted doctors by alphabetically
            {
                var sortAlph = PatientList.OrderBy(i => i.User.Lastname).ThenBy(i => i.User.Name).ThenBy(i => i.User.Patronymic);
                PatientSortedList = sortAlph.ToList();
            }
            else if (HowToSort == "Birthday")
            {
                var sortByBirth = PatientList.OrderBy(i => i.User.Birthday);
                PatientSortedList = sortByBirth.ToList();
            }
            else
            {
                PatientSortedList = CreateListOf.Patients();
            }

            return(PatientSortedList);
        }
Пример #21
0
        //private ICommand _AddCommand;
        //public ICommand AddCommand
        //{
        //    get
        //    {
        //        if (_AddCommand == null)
        //            _AddCommand = new RelayCommand(p => this.Add(p));
        //        return _AddCommand;
        //    }
        //}


        #endregion

        #region Methods
        private void Search(object p)
        {
            for (int i = 0; i < PatientList.Count; i++)
            {
                if (_SearchNameNumber == PatientList.ElementAt(i).PatientName ||
                    _SearchNameNumber == PatientList.ElementAt(i).PatientNumber)
                {
                    PatientData data = new PatientData()
                    {
                        PatientName   = PatientList.ElementAt(i).PatientName,
                        PatientNumber = PatientList.ElementAt(i).PatientNumber,
                        PatientGender = PatientList.ElementAt(i).PatientGender,
                        PatientAge    = PatientList.ElementAt(i).PatientAge
                    };
                    PatientSearchList.Add(data);
                }
            }
            PatientTempList   = PatientList;
            PatientList       = PatientSearchList;
            PatientSearchList = PatientTempList;
        }
Пример #22
0
        private void BuildPatientList()
        {
            string dataset         = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            int    protocolId      = int.Parse(BaseProtocolId);
            bool   showIdentifiers = base.ShowPatientIdentifiers();

            // get list
            bool      canViewIdentifiers = base.ShowPatientIdentifiers();
            DataTable patientsList       = ProtocolMgmtDa.GetPatientsByProtocol(protocolId, dataset, showIdentifiers, true);
            DataView  sortedPatients     = PatientProtocolController.SortPatientsByStudyId(patientsList, "ASC");
            var       patients           = from patient in sortedPatients.ToTable().AsEnumerable()
                                           let name = patient["Name"].ToString()
                                                      select new
            {
                PatientDisplayName = patient[PatientProtocol.PtProtocolStudyId].ToString() + (canViewIdentifiers && !string.IsNullOrEmpty(name) ? " : " + name : ""),
                PatientProtocolId  = patient[PatientProtocol.PatientProtocolId].ToString()
            };

            PatientList.DataSource = patients;
            PatientList.DataBind();
        }
Пример #23
0
        public ActionResult Index()
        {
            ViewBag.Message = "Click a patient to start PRO Center.";

            var          connectionString = WebConfigurationManager.ConnectionStrings["ProCenterSqlDatabase"].ToString();
            const string query            = @"SELECT FirstName +' '+ LastName as Name, 
                                          GenderCode as Gender,  
                                          PatientKey   
                                 FROM PatientModule.Patient";

            using (var connection = new SqlConnection(connectionString))
            {
                var patients = connection.Query <PatientViewModel>(query).ToList();

                var patientList = new PatientList()
                {
                    Patients = patients
                };

                return(View(patientList));
            }
        }
Пример #24
0
        public IActionResult Details(int id)
        {
            //dummy record for checking
            //Student s = new Student { StudentID = Student_ID, cpi = 92, email = "*****@*****.**", mobile = "9998889998", Name = "j", Subjects = null };

            Patient patient = patientRepository.GetPatient(id);

            if (patient == null)
            {
                TempData["ErrorMessage"] = "Patient Data not found!";
                return(RedirectToAction("Index", "Patient"));
            }

            var logged_usr_id           = signInManager.UserManager.GetUserId(User);
            var logged_user_hospital_id = userManager.Users
                                          .Where(usr => usr.Id == logged_usr_id)
                                          .FirstOrDefault()
                                          .HospitalId;

            if (patient.Hospital.HospitalId != logged_user_hospital_id)
            {
                TempData["ErrorMessage"] = "Access Denied!";
                return(RedirectToAction("Index", "Patient"));
            }

            var citizen         = userManager.Users.Where(us => us.CitizenId == patient.CitizenId).FirstOrDefault();
            var patient_citizen = new PatientList()
            {
                CitizenId   = patient.CitizenId,
                PatientId   = patient.PatientId,
                CheckupData = citizen.CheckupData,
                Name        = citizen.Name,
                Email       = citizen.Email,
                Mobile      = citizen.Mobile,
            };

            return(View(patient_citizen));
        }
Пример #25
0
        /// <summary>
        /// Убрать фильтрацию
        /// </summary>
        /// <param name="sender">Объект, пославший сообщение</param>
        /// <param name="e">Объект, содержащий данные посланного сообщения</param>
        private void buttonFilterRemove_Click(object sender, EventArgs e)
        {
            dateTimePickerFilterDeliveryDateEnd.Checked                    =
                dateTimePickerFilterDeliveryDateStart.Checked              =
                    dateTimePickerFilterReleaseDateEnd.Checked             =
                        dateTimePickerFilterReleaseDateStart.Checked       =
                            dateTimePickerFilterVisitDateEnd.Checked       =
                                dateTimePickerFilterVisitDateStart.Checked = false;

            textBoxFilterFIO.Text          = comboBoxFilterAgeMode.Text = textBoxFilterNosology.Text =
                textBoxFilterDiagnose.Text = textBoxFilterAge.Text =
                    textBoxFilterKD.Text   = comboBoxFilterKDMode.Text =
                        comboBoxFilterHospitalizationCntMode.Text    =
                            comboBoxFilterVisitCntMode.Text          = comboBoxFilterOperationCntMode.Text =
                                textBoxFilterHospitalizationCnt.Text = textBoxFilterVisitCnt.Text =
                                    textBoxFilterOperationCnt.Text   = textBoxFilterOperationType.Text = string.Empty;

            PatientList.Focus();

            timerShowPatients.Enabled = false;
            timerShowPatients.Enabled = true;

            EnableOrDisableRemoveFilterButton();
        }
Пример #26
0
 /// <summary>
 /// Сброс фокуса с кнопок при нажатии
 /// </summary>
 /// <param name="sender">Объект, пославший сообщение</param>
 /// <param name="e">Объект, содержащий данные посланного сообщения</param>
 private void button_DropFocus(object sender, EventArgs e)
 {
     PatientList.Focus();
 }
Пример #27
0
        public static PatientList Patients_Get()
        {
            //DataSet ds;
            //MySqlDataAdapter da;
            PatientList wPatientList = new PatientList();
            Patient     wPatient;

            using (MySqlConnection conn = new MySqlConnection(cmsys_cnnstring))
            {
                try
                {
                    conn.Open();
                    MySqlCommand wCommand = new MySqlCommand("select * from patient", conn);
                    //da = new MySqlDataAdapter("select * from patients", conn);
                    //MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
                    //ds = new DataSet();


                    //da.Fill(ds, "Patients");

                    MySqlDataReader myReader = wCommand.ExecuteReader();
                    while (myReader.Read())
                    {
                        wPatient = new Patient();
                        if (myReader["birth"] != DBNull.Value)
                        {
                            wPatient.birth = myReader.GetDateTime("birth");
                        }
                        if (myReader["business_addy"] != DBNull.Value)
                        {
                            wPatient.business_addy = myReader.GetString("business_addy");
                        }
                        if (myReader["business_city"] != DBNull.Value)
                        {
                            wPatient.business_city = myReader.GetString("business_city");
                        }

                        if (myReader["business_country_id"] != DBNull.Value)
                        {
                            wPatient.business_country_id = myReader.GetInt32("business_country_id");
                        }
                        if (myReader["business_email"] != DBNull.Value)
                        {
                            wPatient.business_email = myReader.GetString("business_email");
                        }
                        if (myReader["business_phone"] != DBNull.Value)
                        {
                            wPatient.business_phone = myReader.GetString("business_phone");
                        }

                        if (myReader["business_province_id"] != DBNull.Value)
                        {
                            wPatient.business_province_id = myReader.GetInt32("business_province_id");
                        }

                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_province_name = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_zip_code = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_zip_code = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.cuil = myReader.GetString("business_province_name");
                        }

                        if (myReader["death"] != DBNull.Value)
                        {
                            wPatient.death = myReader.GetDateTime("death");
                        }

                        //wPatient.extra = myReader.GetString("extra");
                        if (myReader["first_name"] != DBNull.Value)
                        {
                            wPatient.first_name = myReader.GetString("first_name");
                        }
                        if (myReader["home_addy"] != DBNull.Value)
                        {
                            wPatient.home_addy = myReader.GetString("home_addy");
                        }
                        if (myReader["home_city"] != DBNull.Value)
                        {
                            wPatient.home_city = myReader.GetString("home_city");
                        }



                        if (myReader["home_country_id"] != DBNull.Value)
                        {
                            wPatient.home_country_id = myReader.GetInt32("home_country_id");
                        }

                        if (myReader["home_email"] != DBNull.Value)
                        {
                            wPatient.home_phone = myReader.GetString("home_email");
                        }

                        if (myReader["home_province_id"] != DBNull.Value)
                        {
                            wPatient.home_province_id = myReader.GetInt32("home_province_id");
                        }

                        if (myReader["home_province_name"] != DBNull.Value)
                        {
                            wPatient.home_province_name = myReader.GetString("home_province_name");
                        }
                        if (myReader["home_zip_code"] != DBNull.Value)
                        {
                            wPatient.home_zip_code = myReader.GetString("home_zip_code");
                        }

                        wPatient.id1 = myReader.GetInt32("id1");
                        wPatient.id2 = myReader.GetInt32("id2");

                        if (myReader["last_name"] != DBNull.Value)
                        {
                            wPatient.last_name = myReader.GetString("last_name");
                        }

                        if (myReader["marital_status"] != DBNull.Value)
                        {
                            wPatient.marital_status = myReader.GetInt32("marital_status");
                        }

                        if (myReader["notes"] != DBNull.Value)
                        {
                            wPatient.notes = myReader.GetString("notes");
                        }

                        if (myReader["occupation"] != DBNull.Value)
                        {
                            wPatient.occupation = myReader.GetString("occupation");
                        }

                        if (myReader["patient_medins_default_plan_id"] != DBNull.Value)
                        {
                            wPatient.patient_medins_default_plan_id = myReader.GetInt32("patient_medins_default_plan_id");
                        }

                        if (myReader["relative_addy"] != DBNull.Value)
                        {
                            wPatient.relative_addy = myReader.GetString("relative_addy");
                        }

                        if (myReader["relative_city"] != DBNull.Value)
                        {
                            wPatient.relative_city = myReader.GetString("relative_city");
                        }

                        if (myReader["relative_country_id"] != DBNull.Value)
                        {
                            wPatient.relative_country_id = myReader.GetInt32("relative_country_id");
                        }

                        wPatientList.Add(wPatient);
                    }
                    myReader.Close();
                }
                catch (MySql.Data.MySqlClient.MySqlException ex1)
                {
                    Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Problemas de coneccion a base de adatos MySQL\r\ncomuniquese con su administrador", ex1);
                    te.ErrorId = "3001";
                    throw te;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                return(wPatientList);
            }
        }
 private void UpdatePatientCount()
 {
     PatientCount = PatientList.Count();
     RaisePropertyChanged("PatientCount");
 }
Пример #29
0
        /// <summary>
        /// Carga _PatientList
        /// </summary>
        void Populate(out Exception ex)
        {
            ex = null;

            try
            {
                _PatientList = Controller.RetrivePatients(null);
            }
            catch (Exception err)
            {
                err.Source = "Origen de datos";
                ex = err;
            }
        }
Пример #30
0
        /// <summary>
        /// 환자정보 가져오기
        /// </summary>
        /// <param name="srcFolder"></param>
        /// <param name="imgFiles"></param>
        /// <param name="patInfor"></param>
        /// <param name="patList"></param>
        /// <returns></returns>
        public static Dictionary <string, string> GetPatient(string srcFolder, string disableMultiPatient, out List <string> imgFiles, out PatientList patInfor, out Dictionary <string, string> patList)
        {
            imgFiles = null;
            patList  = null;
            Dictionary <string, string> dicResult = null;
            string   DicomDirFile = Path.Combine(srcFolder, "DICOMDIR");
            FileInfo fi           = new FileInfo(DicomDirFile);
            bool     isDicomRead  = false;

            patInfor = null;

            try
            {
                if (fi.Exists)
                {
                    dicResult = new Dictionary <string, string>();
                    dicResult.Add("ID", "");
                    dicResult.Add("Name", "");
                    dicResult.Add("Sex", "");
                    dicResult.Add("SexKr", "");
                    dicResult.Add("BirthDay", "");
                    dicResult.Add("Age", "");
                    dicResult.Add("StudyDesc", "");
                    dicResult.Add("Modality", "");
                    dicResult.Add("ImageCount", "");
                    dicResult.Add("ImagePath", "");
                    dicResult.Add("DicomDesc", "");
                    dicResult.Add("StudyModality", "");
                    dicResult.Add("PatientCount", "0");

                    //먼저 원래것으로..
                    patInfor = DicomDirReader.GetPatientrFromDicomNet(DicomDirFile);

                    if (patInfor == null || patInfor.Base.Count == 0)
                    {
                        //EvilDicom으로
                        patInfor = DicomDirReader.GetPatientrFromEvil(DicomDirFile);
                    }

                    //DICOMDIR에서 정보를 읽을 수 없을 경우 image file에서..
                    if (patInfor == null || patInfor.Base.Count == 0)
                    {
                        //환자 폴더 내에서 이미지 파일을 찾아 정보를 가져오도록 하자.
                        DicomInfomation di = new DicomInfomation();

                        //이미지 파일 목록 가져오기 - .dcm
                        List <string> lstFiles = FileControl.GetDicomImageFiles(new DirectoryInfo(srcFolder));

                        if (lstFiles != null && lstFiles.Count > 0)
                        {
                            foreach (string dcm in lstFiles)
                            {
                                di._DicomFilePath = dcm;
                                fi = new FileInfo(dcm);
                                di._DicomFileName = fi.Name;

                                dicResult = di.PatientInfo();

                                if (dicResult != null)
                                {
                                    isDicomRead = true;

                                    patList = di.PatientLST;
                                    dicResult["PatientCount"] = di.PatientCount.ToString();

                                    dicResult.Add("DcmFilePath", dcm);
                                    dicResult.Add("DcmFileName", fi.Name);

                                    break;
                                }
                            }

                            imgFiles = lstFiles;
                        }
                    }
                    else
                    {
                        isDicomRead = true;

                        dicResult["ID"]            = patInfor.Base[0].Patient.ID;
                        dicResult["Name"]          = patInfor.Base[0].Patient.Name;
                        dicResult["Sex"]           = Utils.CheckNull(patInfor.Base[0].Patient.Gender);
                        dicResult["SexKr"]         = Utils.CheckNull(patInfor.Base[0].Patient.GenderKR);
                        dicResult["BirthDay"]      = Utils.CheckNull(patInfor.Base[0].Patient.BirthDate);
                        dicResult["Age"]           = Utils.CheckNull(patInfor.Base[0].Patient.Age);
                        dicResult["StudyDesc"]     = patInfor.Base[0].StudyDescArray;
                        dicResult["Modality"]      = patInfor.Base[0].ModalityArray;
                        dicResult["ImageCount"]    = patInfor.Base[0].RecordList.Count.ToString();
                        dicResult["StudyModality"] = patInfor.Base[0].StudyModalityArray;

                        //// 다중환자굽기 사용안함 설정 + 다중환자인 경우
                        if (disableMultiPatient == "Y" && patInfor.Base.Count > 1)
                        {
                            List <string> lstStdy = new List <string>();
                            foreach (PatientInfoEntity pInfo in patInfor.Base)
                            {
                                lstStdy.Add(pInfo.StudyModalityArray);
                            }
                            dicResult["StudyModality"] = string.Join("^^", lstStdy);
                        }

                        if (null != patInfor.Base[0].RecordList && patInfor.Base[0].RecordList.Count > 0)
                        {
                            dicResult["ImagePath"] = patInfor.Base[0].RecordList[0].ImageFilePath;
                        }

                        //생일 또는 성별을 못 가져왔을 때 이미지 파일에서 가져오도록..
                        if (string.IsNullOrEmpty(patInfor.Base[0].Patient.BirthDate) ||
                            string.IsNullOrEmpty(patInfor.Base[0].Patient.Gender))
                        {
                            DicomInfomation di = new DicomInfomation();
                            di._DicomFilePath = DicomDirFile;
                            Dictionary <string, string> dicImgInfo = di.PatientInfoFromDCM(dicResult["ImagePath"]);

                            if (dicImgInfo != null)
                            {
                                dicResult["Sex"]      = dicImgInfo["Sex"];
                                dicResult["SexKr"]    = dicImgInfo["SexKr"];
                                dicResult["BirthDay"] = dicImgInfo["BirthDay"];
                                dicResult["Age"]      = dicImgInfo["Age"];
                            }
                        }

                        dicResult["DicomDesc"] = patInfor.AllDesc;

                        patList = patInfor.SimpleList;
                        dicResult["PatientCount"] = patInfor.Base.Count.ToString();

                        dicResult.Add("DcmFilePath", DicomDirFile);
                        dicResult.Add("DcmFileName", "DICOMDIR");
                    }

                    if (isDicomRead == false)
                    {
                        dicResult = new Dictionary <string, string>();
                        dicResult.Add("Result", "NotFound");
                    }
                    else
                    {
                        dicResult.Add("Result", "");
                    }
                }
                else
                {
                    ////this.ErrMsgShow("DICOMDIR 파일을 찾을 수 없습니다.\r\n", "Rimage Message : Not Exists DICOMDIR file");
                    dicResult.Add("Result", "NotFound");
                }
            }
            catch { }

            return(dicResult);
        }
Пример #31
0
        /// <summary>
        /// 폴더에서 환자 정보 조회하기
        /// </summary>
        /// <param name="sdir"></param>
        /// <param name="existDicomDir"></param>
        /// <param name="folderPattern">생성되는 환자 폴더 형태</param>
        /// <param name="DBConnInfo"></param>
        /// <param name="checkFile"></param>
        /// <param name="cdMaxSize"></param>
        /// <param name="dvdMaxSize"></param>
        /// <param name="autoLoaderMediaType"></param>
        /// <returns></returns>
        public static BurnOrderedInfoEntity Get(string programPath, DirectoryInfo sdir,
                                                Dictionary <string, string> DBConnInfo, string autoLoaderMediaType, string checkFile = "")
        {
            try
            {
                string mdbFileName     = "PiView.mdb";
                string mdbFileNameMaro = @"Viewer\Export.mdb";

                bool existCheckFile   = true;
                bool isBurnEnd        = true;
                bool existPatInfoFile = true;
                bool isDicom          = false;
                bool isMdb            = false;
                bool isNoDicom        = false;
                bool isText           = false;
                bool isINI            = false;

                //// root에 checkFile ("end.txt") 파일이 존재하는지 체크하자.
                if (checkFile != "")
                {
                    existCheckFile = CheckFileExists(sdir, checkFile);
                }

                //// 다운로드 완료 파일로 체크시 파일이 존재할 경우 (기본은 true)
                if (existCheckFile)
                {
                    //// 굽기완료된 폴더인지 체크(burn.end 파일체크)
                    //// 완료된 상태이면 True
                    isBurnEnd = CheckFileExists(sdir, GlobalVar.BURN_CHK_FL_NM);
                }

                //// 조회조건 모두 통과시 (
                if (existCheckFile && !isBurnEnd)
                {
                    //// 굽기 정보
                    BurnOrderedInfoEntity orderInfo = new BurnOrderedInfoEntity();
                    orderInfo.patDate           = DateTime.Now.ToString("yyyy-MM-dd");
                    orderInfo.LocalShareFolder  = sdir.Name;
                    orderInfo.patFolder         = sdir.Name;
                    orderInfo.patFolderFullPath = sdir.FullName;
                    orderInfo.DeleteIcon        = global::RimageMedicalSystemV2.Properties.Resources.close_16x16;
                    orderInfo.copies            = 1;
                    orderInfo.BurnPatientKind   = "N";

                    string pID       = string.Empty;
                    string pName     = string.Empty;
                    string pSex      = string.Empty;
                    string pAge      = string.Empty;
                    string pModality = string.Empty;
                    Dictionary <string, string> pList        = null;
                    Dictionary <string, string> dicomdirInfo = null;
                    Dictionary <string, string> patList      = null;
                    int patCount = 0;

                    //// 먼저 DicomDir 파일이 존재하는지 체크
                    if (GlobalVar.configEntity.ExistDicomDir == "Y")
                    {
                        if (File.Exists(Path.Combine(sdir.FullName, "DICOMDIR")))
                        {
                            existPatInfoFile = true;
                        }
                        else
                        {
                            existPatInfoFile = false;
                        }

                        //// 존재하지 않으면 Pass
                        if (!existPatInfoFile)
                        {
                            return(null);
                        }
                    }

                    //// 다시 한번 체크 >> 환자정보가 담긴 파일이 존재하지 않을 경우 Pass
                    if (GlobalVar.configEntity.ExistDicomDir == "Y")
                    {
                        //// 환자정보가 담긴 파일이 존재하지 않을 경우 Pass
                        if (File.Exists(Path.Combine(sdir.FullName, "DICOMDIR")) ||
                            File.Exists(Path.Combine(sdir.FullName, mdbFileName)) ||
                            File.Exists(Path.Combine(sdir.FullName, mdbFileNameMaro)) ||
                            File.Exists(Path.Combine(sdir.FullName, GlobalVar.CD_INFO_FILE)) ||
                            File.Exists(Path.Combine(sdir.FullName, GlobalVar.CD_STUDY_INFO_FILE)))
                        {
                            existPatInfoFile = true;
                        }
                        else
                        {
                            existPatInfoFile = false;
                        }

                        //// 존재하지 않으면 Pass
                        if (!existPatInfoFile)
                        {
                            return(null);
                        }
                    }

                    //// MDB 파일이 존재하면 우선 MDB파일에서 정보를 가져온다.
                    isMdb = false;
                    if (File.Exists(Path.Combine(sdir.FullName, mdbFileName)))
                    {
                        #region -- MDB 파일에서 읽기 --
                        GetPatientInfoFromMDB cls = new GetPatientInfoFromMDB(Path.Combine(sdir.FullName, mdbFileName));
                        dicomdirInfo = new Dictionary <string, string>();
                        dicomdirInfo = cls.GetInfo();

                        if (dicomdirInfo != null)
                        {
                            pID   = dicomdirInfo["ID"];
                            pName = dicomdirInfo["Name"];
                            pSex  = dicomdirInfo["SexKr"];
                            pAge  = dicomdirInfo["Age"];

                            pList    = cls.PatientLST;
                            patCount = cls.PatientCount;

                            isMdb = true;
                        }
                        #endregion
                    }
                    else if (File.Exists(Path.Combine(sdir.FullName, mdbFileNameMaro)))    //Maro형태에서..
                    {
                        #region -- MDB 파일에서 읽기 --
                        GetPatientInfoFromMDB2 cls2 = new GetPatientInfoFromMDB2(Path.Combine(sdir.FullName, mdbFileNameMaro));
                        dicomdirInfo = new Dictionary <string, string>();
                        dicomdirInfo = cls2.GetInfo();

                        if (dicomdirInfo != null)
                        {
                            pID       = dicomdirInfo["ID"];
                            pName     = dicomdirInfo["Name"];
                            pSex      = dicomdirInfo["SexKr"];
                            pAge      = dicomdirInfo["Age"];
                            pModality = dicomdirInfo["Modality"];

                            pList    = cls2.PatientLST;
                            patCount = cls2.PatientCount;

                            isMdb = true;
                        }
                        #endregion
                    }

                    //// 환자명 정보가 담긴 파일이 존재하면 거기서 정보를 가져오자
                    if (File.Exists(Path.Combine(sdir.FullName, GlobalVar.CD_INFO_FILE)))
                    {
                        GetPatientInfoFromTextFile cls = new GetPatientInfoFromTextFile();
                        cls.GetInfo(Path.Combine(sdir.FullName, GlobalVar.CD_INFO_FILE));

                        pID   = cls.ID;
                        pName = cls.Name;
                        pSex  = cls.Sex;

                        if (Utils.IsHangul(cls.Name) == false)
                        {
                            pName = string.Empty;
                        }

                        isText = true;
                    }

                    //// DICOMDIR 파일에서 읽기
                    isDicom   = false;
                    isNoDicom = false;
                    if (File.Exists(Path.Combine(sdir.FullName, "DICOMDIR")))
                    {
                        #region -- DICOMDIR 파일에서 환자정보를 읽어온다. --
                        //DICOMDIR에서 가져온다.
                        dicomdirInfo = new Dictionary <string, string>();
                        List <string> dicImgList = null;
                        PatientList   patInfor   = null;
                        dicomdirInfo = GetPatient(sdir.FullName, GlobalVar.configEntity.DisableMultiPatient, out dicImgList, out patInfor, out patList);

                        orderInfo.PatInfor = patInfor;

                        if (dicomdirInfo != null && dicomdirInfo["Result"] != "NotFound")
                        {
                            orderInfo.patNo            = dicomdirInfo["ID"];
                            orderInfo.patName          = dicomdirInfo["Name"];
                            orderInfo.patSex           = dicomdirInfo["SexKr"];
                            orderInfo.patAge           = dicomdirInfo["Age"];
                            orderInfo.patBirtyDay      = dicomdirInfo["BirthDay"];
                            orderInfo.Modality         = dicomdirInfo["Modality"];
                            orderInfo.StudyDescription = dicomdirInfo["StudyDesc"];
                            orderInfo.DicomDescription = dicomdirInfo["DicomDesc"];
                            orderInfo.StudyModality    = dicomdirInfo["StudyModality"];
                            orderInfo.Count            = Convert.ToInt32(dicomdirInfo["PatientCount"]);
                            orderInfo.patList          = patList;
                            orderInfo.DicomImgList     = dicImgList;

                            isDicom = true;
                        }
                        #endregion
                    }
                    else
                    {
                        //// DicomDir 파일이 없을 시 폴더명에서 환자아이디, 이름만 가져온다.
                        if (sdir.Name.Contains("_"))
                        {
                            try
                            {
                                string[] arrStr = sdir.Name.Split('_');
                                orderInfo.patNo   = arrStr[1];
                                orderInfo.patName = arrStr[2];

                                isNoDicom = true;
                            }
                            catch { }
                        }
                    }

                    //// MDB파일에서 가져온 데이터가 있으면 대체.
                    if (isMdb == true)
                    {
                        orderInfo.patNo   = (string.IsNullOrWhiteSpace(pID)) ? orderInfo.patNo : pID;
                        orderInfo.patName = (string.IsNullOrWhiteSpace(pName)) ? orderInfo.patName : pName;
                        orderInfo.patSex  = (string.IsNullOrWhiteSpace(pSex)) ? orderInfo.patSex : pSex;
                        orderInfo.patAge  = (string.IsNullOrWhiteSpace(pAge)) ? orderInfo.patAge : pAge;
                        orderInfo.Count   = (pList.Count.Equals(0)) ? orderInfo.Count : pList.Count;
                        orderInfo.patList = (pList == null) ? orderInfo.patList : pList;
                    }

                    //// TextFile에서 가져온 데이터가 있으면 대체
                    if (isText == true)
                    {
                        orderInfo.patNo   = (string.IsNullOrWhiteSpace(pID)) ? orderInfo.patNo : pID;
                        orderInfo.patName = (string.IsNullOrWhiteSpace(pName)) ? orderInfo.patName : pName;
                        orderInfo.patSex  = (string.IsNullOrWhiteSpace(pSex)) ? orderInfo.patSex : pSex;
                    }

                    //// Studyinfo.ini에서 환자아이디,명,나이를 가져올 경우
                    if (File.Exists(Path.Combine(sdir.FullName, "Studyinfo.ini")))
                    {
                        /* [Studyinfo]
                         *  PatientName=허경례
                         *  PatientId=15621928
                         *  PatientAge/Sex=51/F
                         */
                        try
                        {
                            string[] fullText = File.ReadAllLines(Path.Combine(sdir.FullName, "Studyinfo.ini"), Encoding.Default);
                            foreach (string str in fullText)
                            {
                                if (str.Contains("PatientName"))
                                {
                                    orderInfo.patName = str.Substring(str.IndexOf('=') + 1);
                                }
                                if (str.Contains("PatientId"))
                                {
                                    orderInfo.patNo = str.Substring(str.IndexOf('=') + 1);
                                }
                                if (str.Contains("PatientAge"))
                                {
                                    string[] arrTxt = str.Substring(str.IndexOf('=') + 1).Split('/');
                                    orderInfo.patAge = arrTxt[0];
                                    orderInfo.patSex = arrTxt[1];
                                }
                            }

                            isINI = true;
                        }
                        catch { }
                    }

                    //// DicomDir 없이 환자명을 가져온 경우에는 건너뛴다.
                    //// INI 파일에서 가져온 경우,
                    if (!isNoDicom)
                    {
                        switch (GlobalVar.configEntity.FolderPattern)
                        {
                        case "1":     //날짜_환자번호_환자명
                            orderInfo.patName = sdir.Name.Substring(sdir.Name.LastIndexOf("_") + 1);
                            //// 연구용 자료가 아닐 경우에만..
                            if (!orderInfo.patNo.Contains("UNKNOWN") && !string.IsNullOrWhiteSpace(orderInfo.patNo))
                            {
                                if (sdir.Name.Contains("_"))
                                {
                                    try
                                    {
                                        string[] arrStr = sdir.Name.Split('_');
                                        orderInfo.patNo = arrStr[1];
                                    }
                                    catch { }
                                }
                            }
                            break;

                        case "2":       //환자번호(환자명)
                            orderInfo.patName = sdir.Name.Substring(sdir.Name.IndexOf("(") + 1, sdir.Name.Length - sdir.Name.IndexOf("(") - 2);
                            orderInfo.patName = orderInfo.patName.Replace("(", "").Replace(")", "");
                            break;

                        case "3":
                            //YUHS - 세브란스에서 dll 제공
                            //신촌 세브란스 병원
                            orderInfo.patName = GetPatientInfoFromYUHS.GetName(orderInfo.patNo);
                            break;

                        case "4":
                            ////환자명을 영문에서 한글로 : 병원 DB에서 조회한다..
                            if (isDicom == true && isMdb == false)
                            {
                                ////Dicom정보를 가져왔을 때 - mdb에서 가져왔을 경우에는 제외
                                string name = GetPatientNameFromDB.GetName(orderInfo.patNo, DBConnInfo);
                                if (!string.IsNullOrWhiteSpace(name))
                                {
                                    orderInfo.patName = name;
                                }
                            }
                            break;

                        case "5":
                            //// 소켓연결로 환자명을 가져오게 설정된 경우 소켓연결정보 파일이 존재할 경우에만 실행.
                            if (File.Exists(Path.Combine(programPath, GlobalVar.SOCKET_CON_FILE)))
                            {
                                Dictionary <string, string> socketCon = GetPatientNameFromDB.GetDBConn(Path.Combine(programPath, GlobalVar.SOCKET_CON_FILE));

                                if (socketCon != null && socketCon["UsageSocket"] == "Y")
                                {
                                    //// 소켓통신으로 환자명을 가져온다.
                                    Dictionary <string, string> socketPatInfo = GetPatientNameFromSocket.GetName(orderInfo.patNo, socketCon);
                                    if (socketPatInfo["PRSG_RSLT_DVSN_CD"] == "1")
                                    {
                                        orderInfo.patName = socketPatInfo["PTNT_NM"].Trim();
                                    }
                                }
                            }
                            break;

                        case "6":
                        case "7":
                            //// Tomtech-아산병원초음파 : 7은 New버전
                            GetPatientInfoFromTomtech clsTT = new GetPatientInfoFromTomtech();
                            clsTT.GetInfo(sdir.FullName);

                            if (!string.IsNullOrWhiteSpace(clsTT.ID))
                            {
                                orderInfo.patNo = clsTT.ID;
                            }
                            if (string.IsNullOrWhiteSpace(orderInfo.patName))
                            {
                                orderInfo.patName = clsTT.Name;
                            }
                            break;

                        default:
                            break;
                        }
                    }

                    orderInfo.patName = Utils.ReplaceSpecialWord(orderInfo.patName);
                    orderInfo.patName = orderInfo.patName.Replace(",", ".");

                    //// 연구용 자료일 경우
                    if (orderInfo.patNo.Contains("UNKNOWN") || string.IsNullOrWhiteSpace(orderInfo.patNo))
                    {
                        orderInfo.patNo   = "NA" + DateTime.Now.ToString("ddhhmmss") + "RD";
                        orderInfo.patName = "연구용자료";
                    }

                    orderInfo.patNo      = Utils.ReplaceSpecialWord(orderInfo.patNo);
                    orderInfo.ImgFiles   = FileControl.GetFolderLength(sdir.FullName);
                    orderInfo.FolderSize = orderInfo.ImgFiles.FolderSize;

                    long fldLen = orderInfo.FolderSize / 1024 / 1024;
                    orderInfo.mediSize = fldLen.ToString() + " Mbyte";

                    //// 사이즈별 미디어 선택
                    if (orderInfo.FolderSize > Convert.ToInt64(GlobalVar.configEntity.DvdMaxSize))
                    {
                        orderInfo.mediType = "DVDR-DL";     //DVDR-DL
                    }
                    else if (orderInfo.FolderSize > Convert.ToInt64(GlobalVar.configEntity.CDMaxSize) &&
                             orderInfo.FolderSize <= Convert.ToInt64(GlobalVar.configEntity.DvdMaxSize))
                    {
                        orderInfo.mediType = "DVDR";     //DVDR
                    }
                    else
                    {
                        orderInfo.mediType = "CDR";     //CDR
                    }

                    //// BinCheck후에 미디어타입 다시 세팅
                    ////if (autoLoaderMediaType.Equals("CDR"))
                    ////{
                    ////    orderInfo.mediType = "CDR";
                    ////}
                    ////else if (autoLoaderMediaType.Equals("DVDR"))
                    ////{
                    ////    orderInfo.mediType = "DVDR";     //DVD

                    ////    if (orderInfo.FolderSize > Convert.ToInt64(GlobalVar.configEntity.DvdMaxSize))
                    ////    {
                    ////        orderInfo.mediType = "DVDR-DL";     //DVDR-DL
                    ////    }
                    ////    else
                    ////    {
                    ////        orderInfo.mediType = "DVDR";     //DVDR
                    ////    }
                    ////}

                    return(orderInfo);
                }
            }
            catch { }

            return(null);
        }
Пример #32
0
        public void LoadPatientList()
        {
            listPatients.Items.Clear(); //Blanks GUI list
            SubPatients.Clear(); //Clears internal list
            ReadData();
            int count = 0;
            foreach ( PatientDataRecords X in Patients )
            {
                PatientList append = new PatientList();
                append.Name = X.Name;
                append.PatientNumber = X.PatientNumber;
                append.index = count;
                SubPatients.Add(append);
                listPatients.Items.Add(append.Name);
                count++;
            }
            if ( tbSearchName.Text.Length != 0 )    //Search Function
            {
                string SearchTerm = tbSearchName.Text;  //RegEx Query

                if (SearchTerm.Contains("\\") | SearchTerm.Contains("[") | SearchTerm.Contains("]"))
                {
                    return;
                }
                listPatients.Items.Clear(); //Clears FormList
                SubPatients.Clear();
                int Count = 0;
                foreach ( PatientDataRecords P in Patients ) //Populates SubPatients with terms that match the Query
                {
                    if ( System.Text.RegularExpressions.Regex.IsMatch(P.Name, SearchTerm, System.Text.RegularExpressions.RegexOptions.IgnoreCase) )
                    {
                        PatientList append = new PatientList();
                        append.Name = P.Name;
                        append.PatientNumber = P.PatientNumber;
                        append.index = Count;
                        SubPatients.Add(append);
                        listPatients.Items.Add(append.Name);
                    }
                    Count++;
                }
            }
            if (listRegimes.SelectedIndex != -1)
            {
                listPatients.Items.Clear(); //Clears FormList
                SubPatients.Clear();
                int Count = 0;
                foreach (PatientDataRecords P in Patients)
                {
                    if (P.ActRegime == RegimeList[listRegimes.SelectedIndex].RegName)
                    {
                        PatientList append = new PatientList();
                        append.Name = P.Name;
                        append.PatientNumber = P.PatientNumber;
                        append.index = Count;
                        SubPatients.Add(append);
                        listPatients.Items.Add(append.Name);
                    }
                    Count++;
                }
            }
        }