Пример #1
0
        private void AdmittanceCommand_Complete(AdmittanceCollection hospitalAdmittants)
        {
            this.hospitalAdmittants = hospitalAdmittants;

            this.patientList = new PatientViewModelCollection();
            foreach (Admittance a in this.hospitalAdmittants)
            {
                PatientViewModel pvm = new PatientViewModel(a);
                this.patientList.Add(pvm);
            }


            if (this.patientList.Count > 0)
            {
                this.SelectedPatient = this.patientList[0];
            }
            this.OnPropertyChanged("EDPatientsList");
            this.OnPropertyChanged("HospitalAdmittants");
            this.OnPropertyChanged("PatientList");
        }
Пример #2
0
        /// <summary>
        /// Retrieve the test data for the patient's admittance history
        /// </summary>
        /// <param name="admittances">Patient Admittance history</param>
        /// <param name="patientId">Patient ID</param>
        /// <returns>Admittance History with test results data</returns>
        private AdmittanceCollection GetAdmittanceHistoryTests(IRepositoryProvider factory, AdmittanceCollection admittances, string patientId)
        {
            AdmittanceCollection admittanceHistory = admittances;

            // factory.Get<IRepository<Test>>("TestRepository");
            IRepository <Test>         testRepository         = factory.GetRepository <Test>("TestRepository");
            IRepository <ClinicalNote> clinicalNoteRepository = factory.GetRepository <ClinicalNote>("ClinicalNoteRepository");


            foreach (Admittance admittance in admittanceHistory)
            {
                CommandCriteria criteria = new CommandCriteria();
                criteria.Add("PatientId", patientId);
                criteria.Add("AdmittanceId", admittance.ID.ToString());
                admittance.Tests =
                    new TestCollection(testRepository.SelectCollection(criteria));
                admittance.ClinicalNotes =
                    new ClinicalNotesCollection(clinicalNoteRepository.SelectCollection(criteria));
            }

            return(admittanceHistory);
        }