コード例 #1
0
        private static void PrintPatient(IPatient patient)
        {
            Console.WriteLine("-------------");
            Console.WriteLine($"Id: {patient.Id}");
            Console.WriteLine($"Name: {patient.Name}");
            Console.WriteLine($"Surname: {patient.Surname}");
            Console.WriteLine($"Gender: {patient.Gender}");
            Console.WriteLine($"DateOfBirth: {patient.DateOfBirth?.ToString("dd/MM/yyyy")}");

            if (patient.Deceased)
            {
                Console.WriteLine($"Date of decease: {patient.DateOfDecease?.ToString("dd / MM / yyyy")}");
            }

            Console.WriteLine($"Age: {patient.Age}");

            if (patient.Smoker)
            {
                Console.WriteLine($"Smoker patient. Number of daily cigarrettes: {patient.CigarrettesDailyConsumption}");
            }
            else
            {
                Console.WriteLine($"Non smoker patient");
            }

            Console.WriteLine("-------------");
        }
コード例 #2
0
        /// <summary>
        /// Updates the <see cref="IPatient"/> with the given <paramref name="_patient"/>
        /// </summary>
        /// <param name="_patient"></param>
        /// <returns><see langword="True"/> if the <see cref="IPatient"/> could be updated; otherwise, if not, <see langword="false"/></returns>
        protected bool UpdatePatientData(IPatient _patient)
        {
            IPatient patient = null;

            try
            {
                patient = PatientRepo.Link.GetDataByIdentifier(_patient.ID);
            }
            catch (Exception _e)
            {
                Debug.LogWarning(_e.ToString());
            }

            if (patient != null)
            {
                return(PatientRepo.Link.UpdateData(_patient));
            }
            else
            {
                try
                {
                    throw new Exception("Couldn't Update Patient!");
                }
                catch (Exception _e)
                {
                    Debug.LogWarning(_e.ToString());
                }
            }

            return(false);
        }
コード例 #3
0
 public ConsumptionHistory(int Id, IPatient patient, DateTime?consumptionDate, int o2LitersConsumption)
 {
     this.Id                  = Id;
     this.Patient             = patient;
     this.ConsumptionDate     = consumptionDate;
     this.O2LitersConsumption = o2LitersConsumption;
 }
コード例 #4
0
 public PatientsController(IPatient patient, IOccupation occupation, IVillage village, IContact contact)
 {
     _patient    = patient;
     _occupation = occupation;
     _village    = village;
     _contact    = contact;
 }
コード例 #5
0
        public static void PatientAdded(int ammount, IPatient toTable)
        {
            string type = string.Empty;

            if (toTable.GetType() == typeof(InLine))
            {
                type = "Inline";
            }
            else if (toTable.GetType() == typeof(IVA))
            {
                type = "IVA";
            }
            else if (toTable.GetType() == typeof(Sanatorium))
            {
                type = "Sanatorium";
            }
            else if (toTable.GetType() == typeof(AfterLife))
            {
                type = "AfterLife";
            }
            else if (toTable.GetType() == typeof(Recovered))
            {
                type = "Recovered";
            }

            Console.WriteLine($"{ammount} Patients where added to " +
                              $"{type} Table");
        }
コード例 #6
0
        // static List<PatientProblem> currentPatientProblem = new List<PatientProblem>();

        public PatientController(IPatient p)
        {
            if (patientAddViewModel.allPatients is null)
            {
                patientAddViewModel.allPatients = new List <Patient>();
            }
        }
コード例 #7
0
ファイル: Context.cs プロジェクト: Carpenteri1/KrankenHause
        public static List <IPatient> SendToRecovery(IPatient whatType)
        {
            List <IPatient> recover = new List <IPatient>();

            using (Context db = new Context())
            {
                if (whatType.GetType() == typeof(IVA))
                {
                    var toRecover = db.IVA.Where(sym => sym.SymtomsLevel < 1).ToList();
                    foreach (var s in toRecover)
                    {
                        recover.Add(s);
                    }
                }
                if (whatType.GetType() == typeof(Sanatorium))
                {
                    var toRecover = db.Sanatorium.Where(sym => sym.SymtomsLevel < 1).ToList();
                    foreach (var s in toRecover)
                    {
                        recover.Add(s);
                    }
                }

                return(recover);
            }
        }
コード例 #8
0
ファイル: Context.cs プロジェクト: Carpenteri1/KrankenHause
        public static List <IPatient> SendToAfterLife(IPatient whatType)
        {
            List <IPatient> AfterLife = new List <IPatient>();

            using (Context db = new Context())
            {
                if (whatType.GetType() == typeof(IVA))
                {
                    var toAfterLife = db.IVA.Where(sym => sym.SymtomsLevel > 9).ToList();
                    foreach (var s in toAfterLife)
                    {
                        AfterLife.Add(s);
                    }
                }
                if (whatType.GetType() == typeof(Sanatorium))
                {
                    var toAfterLife = db.Sanatorium.Where(sym => sym.SymtomsLevel > 9).ToList();
                    foreach (var s in toAfterLife)
                    {
                        AfterLife.Add(s);
                    }
                }
            }

            return(AfterLife);
        }
コード例 #9
0
ファイル: Context.cs プロジェクト: Carpenteri1/KrankenHause
        /// <summary
        /// Checks if any of the tables is empty, depending on what type patient is.
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public static bool TableEmpty(IPatient whatType)//just wanned to try generic
        {
            using (Context db = new Context())
            {
                if (whatType.GetType() == typeof(InLine))
                {
                    var grab = from patient in db.InLine
                               select patient;
                    if (grab.Count() > 0)
                    {
                        return(false);
                    }
                }
                else if (whatType.GetType() == typeof(IVA))
                {
                    var grab = from patient in db.IVA
                               select patient;
                    if (grab.Count() > 0)
                    {
                        return(false);
                    }
                }
                else if (whatType.GetType() == typeof(Sanatorium))
                {
                    var grab = from patient in db.Sanatorium
                               select patient;
                    if (grab.Count() > 0)
                    {
                        return(false);
                    }
                }

                return(true);
            }
        }
コード例 #10
0
ファイル: Context.cs プロジェクト: Carpenteri1/KrankenHause
        /// <summary>
        /// Grab the sickest patient and add it to a list
        /// </summary>
        /// <param name="fromTable"></param>
        /// <param name="ammount"></param>
        /// <returns></returns>
        public static List <IPatient> GetSickestPatients(IPatient fromTable, int ammount, int allowedValue)
        {
            List <IPatient> listOfPatient = new List <IPatient>();

            using (Context db = new Context())
            {
                if (fromTable.GetType() == typeof(InLine))
                {
                    var maxSymtom = db.InLine.DefaultIfEmpty().Max(max => max.SymtomsLevel);

                    var getSickes = from patiant in db.InLine
                                    where patiant.SymtomsLevel == maxSymtom
                                    select patiant;
                    foreach (var getPatient in getSickes.ToList())
                    {
                        if (ammount < allowedValue)
                        {
                            listOfPatient.Add(getPatient);
                            ammount++;
                        }
                    }
                }
                else if (fromTable.GetType() == typeof(Sanatorium))
                {
                    var maxSymtom = db.Sanatorium.DefaultIfEmpty().Max(max => max.SymtomsLevel);

                    var getSickes = from patiant in db.Sanatorium
                                    where patiant.SymtomsLevel == maxSymtom
                                    select patiant;

                    foreach (var getPatient in getSickes.ToList())
                    {
                        //checks how meny we can grab, if its bellow 1 we cant grab anymore patients
                        if (ammount < allowedValue)
                        {
                            listOfPatient.Add(getPatient);
                            ammount++;
                        }
                    }
                }
                else if (fromTable.GetType() == typeof(IVA))
                {
                    var maxSymtom = db.IVA.DefaultIfEmpty().Max(max => max.SymtomsLevel);

                    var getSickes = from patiant in db.IVA
                                    where patiant.SymtomsLevel == maxSymtom
                                    select patiant;

                    foreach (var getPatient in getSickes.ToList())
                    {
                        if (ammount < allowedValue)
                        {
                            listOfPatient.Add(getPatient);
                            ammount++;
                        }
                    }
                }
                return(listOfPatient);
            }
        }
コード例 #11
0
ファイル: Clinic.cs プロジェクト: vbre/CS_2015_Winter
 public void Cure(IPatient patient, Diagnosis diagnosis, Treatment appoitment)
 {
     if (patient.PatientBill.IsPayed)
     {
         // magic
     }
 }
コード例 #12
0
ファイル: Hospital.cs プロジェクト: vbre/CS_2015_Winter
 public void PatientReception(IPatient patient)
 {
     this.patient = patient;
     this.insurances = patient.Insurance;
     insurances.Report += insurances_Report;
     PrimaryExamination();
 }
コード例 #13
0
        public IList<IPatient> GetAll(IPatient patient)
        {
            Assertion.NotNull(patient, "Paticiente não informado.").Validate();

            if (patient.Hospital != null)
            {
                var patients = GetPatientsService.GetPatients(patient.Hospital, patient);
                return patients;
            }

            var repository = new Hospitals();
            var hospitals = repository.All<Hospital>();

            foreach (var item in hospitals)
            {
                var hospital = item;
                if (item.Key.Equals("Sumario"))
                    continue;

                //TODO Acessar query com filtro de 6 dias de Range.
                var patients = GetPatientsService.GetPatients(hospital, patient);

                if (patients != null)
                    Patients.ToList().AddRange(patients);
            }

            return Patients;
        }
コード例 #14
0
ファイル: Clinic.cs プロジェクト: SyrnikovEK/CS_2015_Winter
 public void Cure(IPatient patient, Diagnosis diagnosis, Treatment appoitment)
 {
     if (patient.PatientBill.IsPayed)
     {
         // magic
     }
 }
コード例 #15
0
ファイル: FearOfNumbers.cs プロジェクト: SoftwareDojo/Katas
        public void AddPatient(IPatient patient)
        {
            if (m_Patients.ContainsKey(patient.Name))
                throw new ArgumentException(m_Languages[m_CurrentLanguage].GetText(TextKey.DuplicatePatient));

            m_Patients.Add(patient.Name, patient);
        }
コード例 #16
0
        public IPatient GetHighestPrioityCall()
        {
            IPatient patient = null;

            lock (priorityPatientsInQueueLock)
            {
                if (0 < priorityPatientsInQueue.Count)
                {
                    patient = priorityPatientsInQueue[0];
                    priorityPatientsInQueue.RemoveAt(0);
                }
            }
            if (patient == null)
            {
                lock (patientsInQueueLock)
                {
                    if (0 < patientsInQueue.Count)
                    {
                        patient = patientsInQueue[0];
                        patientsInQueue.RemoveAt(0);
                    }
                }
            }
            return(patient);
        }
コード例 #17
0
 private void app_eOnNewTest()
 {
     Utility.Log("BP => new_test");
     currentTest = app.CurrentTest;
     patient     = currentTest.Patient;
     PatientPreliminaryCheck();
 }
コード例 #18
0
 private async Task SendCovidNotificion(IPatient patient)
 {
     if (!string.IsNullOrWhiteSpace(patient?.EmailAddress) && patient.TestCovid.HasValue)
     {
         await _busSender.SendMessage(MessagePayloadFactory.Create(MessageType.CovidNotification, patient.EmailAddress));
     }
 }
コード例 #19
0
        /// <summary>
        /// Sets the patient to status handled.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <exception cref="QNomy.SQL.Exceptions.GeneralDbException">
        /// </exception>
        public async Task SetPatientHandled(IPatient patient)
        {
            try
            {
                var currentPatient = await this.dbContext.Patients.FindAsync(patient.TicketNumber);

                if (currentPatient == null)
                {
                    throw new GeneralDbException(ApplicationMessages.PatientIsNotFound(patient));
                }

                currentPatient.Handled = true;

                this.dbContext.Patients.Update(currentPatient);

                await this.dbContext.SaveChangesAsync();
            }
            catch (GeneralDbException expDb)
            {
                // It was thrown above in 'not found scenario'
                throw;
            }
            catch (Exception exp)
            {
                throw new GeneralDbException(ApplicationMessages.GeneralDbExceptionMessage(), exp);
            }
        }
コード例 #20
0
 public PatientController(IPatient objIPatient, IAdminOperations objIAdminOperations,
                          IHospitalMaster objIHospitalMaster, IInvoice objIInvoice)
 {
     _objIPatient         = objIPatient;
     _objIAdminOperations = objIAdminOperations;
     _objIHospitalMaster  = objIHospitalMaster;
     _objIInvoice         = objIInvoice;
 }
コード例 #21
0
        //static List<Patient> patients = new List<Patient>();
        //static PatientAddViewModel patientAddViewModel = new PatientAddViewModel();
        // static ProblemAddViewModel problemAddViewModel = new ProblemAddViewModel();

        public PatientController(IPatient p, HospitalDbContext _hosdb)
        {
            _hospitalDbContext = _hosdb;

            //if(patientAddViewModel.allPatients is null) {
            //patientAddViewModel.allPatients = new List<Patient>();
            //    }
        }
コード例 #22
0
ファイル: PatientMapper.cs プロジェクト: Workker/EHR
        public static PatientModel MapPatientModelFrom(IPatient patient)
        {
            Mapper.CreateMap<IPatient, PatientModel>().ForMember(dest => dest.Treatments, source => source.Ignore());

            var patientModel = Mapper.Map<IPatient, PatientModel>(patient);

            return patientModel;
        }
コード例 #23
0
        public IList<PatientDTO> GetPatientsBy(IPatient patient)
        {
            var patientCriteria = Session.CreateCriteria<PatientDTO>("p");

            FactoryPatientSpecification.CreateCriteria(patient, patientCriteria);

            return patientCriteria.List<PatientDTO>().ToList();
        }
コード例 #24
0
ファイル: Policy.cs プロジェクト: vbre/CS_2015_Winter
 public Policy(string series, string number, IInsurance insurance,
     List<IServiceType> serviceList, IPatient patient)
 {
     _series = series;
     _number = number;
     _insurance = insurance;
     _serviceList = serviceList;
     _patient = patient;
 }
コード例 #25
0
ファイル: Policy.cs プロジェクト: archermarc085/Clinic
 public Policy(string series, string number, IInsurance insurance,
               List <IServiceType> serviceList, IPatient patient)
 {
     _series      = series;
     _number      = number;
     _insurance   = insurance;
     _serviceList = serviceList;
     _patient     = patient;
 }
コード例 #26
0
 public PainController(OneDirectContext context, ILogger <PainController> plogger)
 {
     logger                          = plogger;
     this.context                    = context;
     IPatient                        = new PatientRepository(context);
     lISessionRepository             = new SessionRepository(context);
     lIPainRepository                = new PainRepository(context);
     lIEquipmentAssignmentRepository = new AssignmentRepository(context);
 }
コード例 #27
0
 public bool UpdatePatient(IPatient patient)
 {
     if (!PatientExists(patient.Id))
     {
         return(false);
     }
     _patients[patient.Id] = patient;
     return(true);
 }
コード例 #28
0
        public InstallerApiController(OneDirectContext context, ILogger <PatientApiController> plogger)
        {
            logger           = plogger;
            this.context     = context;
            IPatient         = new PatientRepository(context);
            lIUserRepository = new UserRepository(context);

            lISessionAuditTrailRepository = new SessionAuditTrailRepository(context);
        }
コード例 #29
0
ファイル: Mapper.cs プロジェクト: BlackSkyNight/HospitalApi
 public static PatientViewModel CreatePatientViewModelFrom(IPatient patient)
 => new PatientViewModel()
 {
     Id           = patient.Id,
     Age          = patient.Age,
     FirstName    = patient.FirstName,
     LastName     = patient.LastName,
     TestCovid    = patient.TestCovid,
     EmailAddress = patient.EmailAddress,
 };
        public virtual void DoSearch(Hospital hospital, IPatient patientDTO)
        {
            Assertion.NotNull(hospital, "Banco não informado.").Validate();
            Assertion.NotNull(patientDTO, "Paciente não informado.").Validate();

            ClearPatient();
            Patients = GetPatientsService.GetPatients(hospital, patientDTO);
            ValidateCPFPatient();
            ValidadeBirthday();
        }
コード例 #31
0
 public DeviceCalibrationController(OneDirectContext context, ILogger <DeviceCalibrationController> plogger)
 {
     logger                          = plogger;
     this.context                    = context;
     lIUserRepository                = new UserRepository(context);
     IPatient                        = new PatientRepository(context);
     lISessionRepository             = new SessionRepository(context);
     lIDeviceCalibrationRepository   = new DeviceCalibrationRepository(context);
     lIEquipmentAssignmentRepository = new AssignmentRepository(context);
 }
コード例 #32
0
        public AppointmentsController(OneDirectContext context, ILogger <AppointmentsController> plogger, INewPatient lINewPatient)
        {
            logger           = plogger;
            this.context     = context;
            IPatient         = new PatientRepository(context);
            INewPatient      = lINewPatient;
            lIUserRepository = new UserRepository(context);

            lIAppointmentScheduleRepository = new AppointmentScheduleRepository(context);
        }
コード例 #33
0
 public UserActivityLogController(OneDirectContext context, ILogger <UserActivityLogController> plogger)
 {
     logger                          = plogger;
     this.context                    = context;
     lIUserRepository                = new UserRepository(context);
     IPatient                        = new PatientRepository(context);
     lISessionRepository             = new SessionRepository(context);
     lIUserActivityLogRepository     = new UserActivityLogRepository(context);
     lIEquipmentAssignmentRepository = new AssignmentRepository(context);
 }
コード例 #34
0
        internal void Run()
        {
            _newPatient = _newSignUp.GetPatient(GetPatientName(), GetPatientAge(), GetPatientGender(), GetPatientDiabetesInfo());

            _newPatient.TakeMeds();
            _newPatient.TakeInsulin();
            _newPatient.VisitDoctor();

            Console.ReadLine();
        }
コード例 #35
0
 public MessageViewController(OneDirectContext context, ILogger <PainViewController> plogger)
 {
     logger                          = plogger;
     lIUserRepository                = new UserRepository(context);
     this.context                    = context;
     IPatient                        = new PatientRepository(context);
     lIMessageRepository             = new MessageRepository(context);
     lISessionRepository             = new SessionRepository(context);
     lIPainRepository                = new PainRepository(context);
     lIEquipmentAssignmentRepository = new AssignmentRepository(context);
 }
コード例 #36
0
        /// <summary>
        /// Create a new instance of type <see cref="PatientDataTab"/> and add it to the <see cref="TabCollection"/>
        /// </summary>
        /// <param name="_headerText">The text to display as header</param>
        /// <param name="_showContent">Whether or not to display the tab after creation</param>
        /// <returns>The newly created <see cref="ITabItem"/></returns>
        public ITabItem CreatePatientDataTab(string _headerText, IPatient _context, bool _showContent = true)
        {
            TabItem tab = new PatientDataTab(_headerText, _showContent)
            {
                Context = _context
            };

            ConfigurateTab(tab, _showContent);

            return(tab);
        }
コード例 #37
0
        public PatientApiController(OneDirectContext context, ILogger <PatientApiController> plogger, IPatientRxInterface IPatientRxRepository)
        {
            logger           = plogger;
            this.context     = context;
            IPatient         = new PatientRepository(context);
            lIUserRepository = new UserRepository(context);

            lIPatientRxRepository           = IPatientRxRepository;
            lISessionAuditTrailRepository   = new SessionAuditTrailRepository(context);
            lIAppointmentScheduleRepository = new AppointmentScheduleRepository(context);
        }
コード例 #38
0
        public VideoCallController(OneDirectContext context, ILogger <PatientApiController> plogger, IPatientRxInterface IPatientRxRepository, VTransactInterface IVTransactInterface)
        {
            logger           = plogger;
            this.context     = context;
            IPatient         = new PatientRepository(context);
            lIUserRepository = new UserRepository(context);

            lIPatientRxRepository         = IPatientRxRepository;
            lISessionAuditTrailRepository = new SessionAuditTrailRepository(context);
            lVTransactRepository          = IVTransactInterface;
        }
コード例 #39
0
        public static void CreateCriteria(IPatient patient, ICriteria criteria)
        {
            var nameEqualsSpecification = new PatientNameEqualsSpecification();
            var dateBirthayEqualsSpecification = new PatientDateBirthdayEqualsSpecification();
            var identityEquals = new PatientIdentityEqualsSpecification();

            nameEqualsSpecification
                .And(dateBirthayEqualsSpecification)
                .And(identityEquals)
                .AddCriteria(patient, criteria);
        }
コード例 #40
0
        public virtual IList<IPatient> GetPatients(Hospital hospital, IPatient patient)
        {
            ClearPatient();

            using (var repository = new PatientDTORepository(FactorryNhibernate.GetSession(hospital.Database)))
            {
                var patients = repository.GetPatientsBy(patient);
                PatientConverter(patients, hospital);
            }

            return PatientsDTO;
        }
コード例 #41
0
 public virtual IList<IPatient> Todos(IPatient patient, Hospital hospital)
 {
     IList<IPatient> patients = new List<IPatient>();
     using (IObjectServer server = Db4oClientServer.OpenServer("E://Projetos//EHR//PatientsHospital", 0))
     {
         using (IObjectContainer db = server.OpenClient())
         {
             var iobject = db.Query<IPatient>(p => p.Name.Contains(patient.Name) && p.Hospital == hospital);
             patients = iobject.Cast<IPatient>().ToList();
         }
     }
     return patients;
 }
コード例 #42
0
ファイル: Dentist.cs プロジェクト: vbre/CS_2015_Winter
 public string MedicalExamination(IPatient patient)
 {
     string prescription;
     if (dentistPrescriptionsBook.TryGetValue(patient.Symptom, out prescription))
     {
         Console.WriteLine("The Dentist wrote out a prescription");
         return prescription;
     }
     else
     {
         Console.WriteLine("We can not cure you");
         return string.Empty;
     }
 }
コード例 #43
0
ファイル: PatientMapper.cs プロジェクト: Workker/EHR
        public static PatientModel MapPatientModelFrom(IPatient patient, string treatmentStr)
        {
            Mapper.CreateMap<IPatient, PatientModel>().ForMember(dest => dest.Treatments, source => source.Ignore());

            var patientModel = Mapper.Map<IPatient, PatientModel>(patient);
            var treatmentModels = new List<TreatmentModel>();

            patientModel.Hospital = HospitalMapper.MapHospitalModelFrom(patient.Hospital);

            //AddHospital(patient, treatmentStr, patientModel);

            foreach (var treatment in patient.Treatments)
            {
                var treatmentModel = TreatmentMapper.MapTreatmentModelFrom(treatment);
                treatmentModels.Add(treatmentModel);
            }

            patientModel.Treatments = treatmentModels;

            return patientModel;
        }
コード例 #44
0
ファイル: DoctorDentist.cs プロジェクト: vbre/CS_2015_Winter
 public override void Cure(IPatient patient)
 {
     patient.Diagnosis = "Healthful";
 }
コード例 #45
0
        private void CheckNumber(IPatient patient, ILanguage language, string displayName, string dayOfWeek, int number, TextKey key)
        {
            // arrange
            var fears = new Katas.FearOfNumbers.FearOfNumbers(displayName);
            fears.AddPatient(patient);

            // act
            var actual = fears.CheckNumber(patient.Name, dayOfWeek, number);

            // assert
            Assert.Equal(language.GetText(key), actual);
        }
コード例 #46
0
        private void UploadExaminationCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled == true || e.Error != null)
            {// если действие было отменено находим загружаемый объект и удаляем его из базы

                isImportCompleted = false;
                Application.MainWindow.View.ObjectSpace.Delete(Application.MainWindow.View.ObjectSpace.GetObject<IExamination>(importExamination));
                Application.MainWindow.View.ObjectSpace.CommitChanges();

                if (e.Cancelled == true)
                {
                    importWizard.CompletionPage.FinishText = CaptionHelper.GetLocalizedText("CustomFomrsMessages", "ImportProcessCanceled");
                }
                else
                {
                    importWizard.CompletionPage.FinishText = CaptionHelper.GetLocalizedText("CustomFomrsMessages", "ImportProcessError");
                }
            }

            else
            { // если файл успешно обработан
                isImportCompleted = true;
                //Guid guid = importExamination.ExaminationFile.Oid;
                //Application.MainWindow.View.ObjectSpace.GetObjectByKey<FileSystemStoreObject>(guid).Save(); //сохраняем объект

                if (isNewPatientRequired == true)
                {
                    importPatient = Application.MainWindow.View.ObjectSpace.CreateObject<IPatient>();
                    importPatient.LastName = importData.LastName;
                    importPatient.FirstName = importData.FirstName;
                    importPatient.MiddleName = importData.MiddleName;

                    importPatient.Gender = importData.Gender;

                    importPatient.Birthday = importData.BirthDate;

                    IExamination examination = Application.MainWindow.View.ObjectSpace.GetObject(importExamination);
                    examination.Patient = importPatient;

                    var items = (Application.MainWindow.View as DashboardView).Items;
                    patientListView = (from DashboardViewItem item in items
                                       where item.InnerView.ObjectTypeInfo.Type == typeof(IPatient)
                                       select item.InnerView).FirstOrDefault() as DevExpress.ExpressApp.ListView;

                    //patientListView.CollectionSource.CollectionChanged += new EventHandler(CollectionSource_CollectionChanged);

                    Application.MainWindow.View.ObjectSpace.CommitChanges();

                    // Заполняем созданный файл заключения
                    PopulateConclusionFile(examination);

                    importWizard.CompletionPage.FinishText = string.Format(CaptionHelper.GetLocalizedText("CustomFomrsMessages", "ImportPatientSuccsess"),
                        importExamination.ExaminationSoftType, importExamination.TimeStart);

                    UpdatePatientListView();

                    SetFocusOnNewPatient();
                }
                else
                {
                    importWizard.CompletionPage.FinishText = string.Format(CaptionHelper.GetLocalizedText("CustomFomrsMessages", "PatientImportUpdateSuccess"),
                        importExamination.ExaminationSoftType, importExamination.TimeStart);

                    UpdateExaminationView();
                    SetFocusOnPatientAndExamination();

                }
                //CaptionHelper.GetLocalizedText("CustomFomrsMessages", "PatientImportUpdateSuccess");
            }

            progress.Close();
        }
コード例 #47
0
 public List<IPatient> GetPatientsAdvancedSearch(IPatient patient, List<string> hospitals)
 {
     var lucene = new LuceneClient(_luceneIndexPath);
     return lucene.AdvancedSearch(patient, hospitals).ToList();
 }
コード例 #48
0
        private void CreateNewPatient(ActionBaseEventArgs e)
        {
            importPatient = Application.MainWindow.View.ObjectSpace.CreateObject<IPatient>();
            importPatient.LastName = importData.LastName;
            importPatient.FirstName = importData.FirstName;
            importPatient.MiddleName = importData.MiddleName;

            importPatient.Gender = importData.Gender;

            importPatient.Birthday = importData.BirthDate;
            //importPatient.MainPhoneNumber = importData.Phone;

            // Если одно из обязательных полей не заполнено
            if (importPatient.FirstName == string.Empty || importPatient.LastName == string.Empty ||
               importPatient.Gender == (Gender.Male & Gender.Female) || importPatient.Birthday < DateTime.Now.AddYears(-150) || importPatient.Birthday > DateTime.Now)
            {
                PopulateRequiredFields(e);
            }
            else
            {// если необходимые поля заполнены
                IExamination examination = Application.MainWindow.View.ObjectSpace.GetObject(importExamination);
                examination.Patient = importPatient;

                var items = (Application.MainWindow.View as DashboardView).Items;
                patientListView = (from DashboardViewItem item in items
                                   where item.InnerView.ObjectTypeInfo.Type == typeof(IPatient)
                                   select item.InnerView).FirstOrDefault() as DevExpress.ExpressApp.ListView;

                patientListView.CollectionSource.CollectionChanged += new EventHandler(CollectionSource_CollectionChanged);
                Application.MainWindow.View.ObjectSpace.CommitChanges();

                // Заполняем созданный файл заключения
                PopulateConclusionFile(examination);

                RefreshController refresh = Application.MainWindow.GetController<RefreshController>();
                refresh.RefreshAction.DoExecute();
            }//isNewPatientRequired
        }
コード例 #49
0
        /// <summary>
        /// Импортируем обследование в выбранного пациента
        /// </summary>
        private void ExistPatientImportExamination(IPatient patient)
        {
            importExamination = Application.MainWindow.View.ObjectSpace.CreateObject<IExamination>();
            importExamination.Patient = patient;//Application.MainWindow.View.ObjectSpace.GetObject<IPatient>(patient);
            importExamination.Status = ExaminationStatus.Registered;

            //DateTime examDateTime = ConcatenateDateAndTime(GetValueByID(importFileHeader, "ExamDate"), GetValueByID(importFileHeader, "ExamTime"));

            importExamination.TimeStart = importData.StartExaminationDateTime;
            importExamination.TimeStop = importData.EndExaminationDateTime;

            Guid examinationSoftTypeId = (from ModuleAssociationAttribute attribute in dynamicModule.GetType().Assembly.GetCustomAttributes(typeof(ModuleAssociationAttribute), true)
                                          where (attribute as ModuleAssociationAttribute).FileExtension == System.IO.Path.GetExtension(importFileFullName).ToLower()
                                          select attribute.OID).FirstOrDefault();

            importExamination.ExaminationSoftType = Application.MainWindow.View.ObjectSpace.FindObject<ExaminationSoftType>(CriteriaOperator.Parse("ExaminationSoftTypeId = ?", examinationSoftTypeId));

            var items = (Application.MainWindow.View as DashboardView).Items;
            patientListView = (from DashboardViewItem edt in items
                               where edt.InnerView.ObjectTypeInfo.Type == typeof(IPatient)
                               select edt.InnerView).FirstOrDefault() as DevExpress.ExpressApp.ListView;

            examinationsListView = (from DashboardViewItem edt in items
                                    where edt.InnerView.ObjectTypeInfo.Type == typeof(IExamination)
                                    select edt.InnerView).FirstOrDefault() as DevExpress.ExpressApp.ListView;

            //objectspaceCommitted += (object send, EventArgs args) =>
            //{
            //    Application.MainWindow.View.ObjectSpace.Committed -= objectspaceCommitted;
            //    GridListEditor editor = patientListView.Editor as GridListEditor;
            //    editor.Grid.BeginInvoke(new System.Windows.Forms.MethodInvoker(delegate() { SetCurrentPatient(patient, patientListView); }));

            //    GridListEditor examEditor = examinationsListView.Editor as GridListEditor;
            //    examEditor.Grid.BeginInvoke(new System.Windows.Forms.MethodInvoker(delegate() { SetCurrentExamination(importExamination, examinationsListView); }));
            //};

            //Application.MainWindow.View.ObjectSpace.Committed += objectspaceCommitted;

            if(Application.MainWindow.View.ObjectSpace.IsModified==true)
                Application.MainWindow.View.ObjectSpace.CommitChanges();

            //importExamination.ExaminationFile = Application.MainWindow.View.ObjectSpace.CreateObject<FileSystemStoreObject>();
            importExamination.ExaminationFile = Application.MainWindow.View.ObjectSpace.CreateObject<ExaminationFile>();
            importExamination.ExaminationFile.FileName = importExamination.ObjectCode.Replace('/', '.') + importExamination.ExaminationSoftType.ExaminationFileExtension;
            importExamination.ExaminationFile.OwnerId = ((DevExpress.ExpressApp.DC.DCBaseObject)importExamination).Oid;

            Application.MainWindow.View.ObjectSpace.CommitChanges();

            //TransferExaminationFile(fileFullName, examination.ExaminationFile);

            UploadExaminationFile();
        }
コード例 #50
0
 public override bool IsSatisfiedBy(IPatient candidate)
 {
     return true;
 }
 private bool IsGreater(IPatient patient)
 {
     var specification = new PatientSpecificationIsGreater();
     return specification.IsSatisfiedBy(patient);
 }
コード例 #52
0
 public override void AddCriteria(IPatient candidate, ICriteria criteria)
 {
     One.AddCriteria(candidate, criteria);
     Other.AddCriteria(candidate, criteria);
 }
コード例 #53
0
ファイル: IPatient.cs プロジェクト: Rukhlov/DataStudio
 public static IList<IExamination> Get_Examinations(IPatient patient, IObjectSpace objectSpace)
 {
     var criteria = CriteriaOperator.Parse("[Patient] = ?", patient);
     return objectSpace.GetObjects<IExamination>(criteria);
 }
コード例 #54
0
ファイル: IPatient.cs プロジェクト: Rukhlov/DataStudio
 public static DateTime Get_LastVisit(IPatient patient)
 {
     var date = new DateTime();
     if (patient.Examinations.Count != 0)
     {
         date = patient.Examinations.Max(p => p.TimeStop).Date;
     }
     return date;
 }
コード例 #55
0
ファイル: DoctorDentist.cs プロジェクト: vbre/CS_2015_Winter
 public override void Diagnostics(IPatient patient)
 {
     patient.Diagnosis = "Caries";
 }
コード例 #56
0
        /// <summary>
        /// !!! ВСЕ ЭТО НАДО ПЕРЕДЕЛАТЬ КАК ЗДЕСЬ --> http://www.devexpress.com/Support/Center/Example/Details/E1487
        /// </summary>
        private void ImportExamination_Execute(object sender, EventArgs e)
        {
            importPatient = null;
            importExamination = null;
            isImportCompleted = false;
            importWizard = null;
            showWelcomePage = true;

               OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                CheckFileExists = true,
                Multiselect = true, //false,
                CheckPathExists = true,
                Filter = GetDialogFilter(), //CaptionHelper.GetLocalizedText("CustomFomrsMessages", "importFileDialogFileter"),
                Title = CaptionHelper.GetLocalizedText("CustomFomrsMessages", "importFiledialogTitle")
            };

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                //importFileFullName = openFileDialog.FileName;

                var importFiles= openFileDialog.FileNames;

                int totalFiles = importFiles.Count();
                int currentNumber = 0;

                foreach (string file in importFiles)
                {
                    if (importWizard != null)
                    {
                        if (importWizard.Canceled == true)  return;
                    }
                    currentNumber++;
                    importFileFullName = file;
                    // находим модуль по расширению файла
                    string extension = Path.GetExtension(importFileFullName);
                    dynamicModule = GetModuleByAssociationAttributeFileExtension(extension);

                    if (dynamicModule == null)
                    {
                        string error = String.Format(CaptionHelper.GetLocalizedText("CustomFomrsMessages", "FileImportError"), importFileFullName);
                        string desctiption = CaptionHelper.GetLocalizedText("CustomFomrsMessages", "ImportModuleError");

                        XtraMessageBox.Show(String.Format("{0}\n{1}",error, desctiption),"",MessageBoxButtons.OK, MessageBoxIcon.Error);
                        continue;
                        //return;
                    }

                    XElement header = null;
                    // получаем данные пациента из файла
                    try { header = dynamicModule.DoVerb(VerboseCommand.ExtractData, importFileFullName) as XElement; }
                    catch (Exception ex)
                    {
                        if (ex.Message == "ExaminationImportNoPatientDataFound")
                        {
                            header = null;
                            //XtraMessageBox.Show(CaptionHelper.GetLocalizedText("Exceptions", "ExaminationImportNoPatientDataFound"));
                        }
                        else
                        {
                            string error = String.Format(CaptionHelper.GetLocalizedText("CustomFomrsMessages", "FileImportError"), importFileFullName);
                            string desctiption = CaptionHelper.GetLocalizedText("Exceptions", "ExaminationImportWrongFileType");

                            XtraMessageBox.Show(String.Format("{0}\n{1}", error, desctiption),"",MessageBoxButtons.OK, MessageBoxIcon.Error);

                            isImportCompleted = false;
                            continue;
                            //return;
                        }
                    }

                    importData = CreateImportData(header);

                    //проверяем дату
                    if (importData.StartExaminationDateTime == DateTime.MinValue)
                    {// если дату из файла извлеч не удалось то ставим дату создания файла
                        FileInfo info = new FileInfo(importFileFullName);
                        importData.StartExaminationDateTime = info.CreationTime;
                    }

                    // Запускаем мастер импорта обследования в БД
                    importWizard = new ImportWizardForm();
                    string fullName = String.Format("{0} {1} {2}", importData.LastName, importData.FirstName, importData.MiddleName);

                    string title = String.Format("{0} ({1}/{2})", importFileFullName, currentNumber, totalFiles);

                    importWizard.SetTitle(title);

                    importWizard.SetMessage(string.Format(CaptionHelper.GetLocalizedText("CustomFomrsMessages", "ImportPatientCaptionSearch"), fullName), 1);
                    importWizard.SetMessage(CaptionHelper.GetLocalizedText("CustomFomrsMessages", "ImportPatientClosiestMatch"), 2);
                    importWizard.isLocalized = true;

                    // Коллекция пациентов для мастера импорта
                    XPCollection patientsCollection = (XPCollection)Application.MainWindow.View.ObjectSpace.CreateCollection(typeof(IPatient));

                    importWizard.WelcomePage.Visible = (showWelcomePage == true);// скрываем страницу приветствия если она уже показывалась

                    importWizard.DisplayPatientCollection(patientsCollection, fullName);
                    importWizard.WizardControl.NextClick += new WizardCommandButtonClickEventHandler(importWizardControl_NextClick);
                    importWizard.WizardControl.SelectedPageChanging += new WizardPageChangingEventHandler(importWizardControl_SelectedPageChanging);

                    importWizard.WizardControl.CustomizeCommandButtons += (o,a) =>
                    {
                        if (currentNumber != totalFiles)
                        {// если файл не последний
                            CompletionWizardPage page = a.Page as CompletionWizardPage;
                            if (page != null)
                            {// см. Предложение #4587
                                page.AllowCancel = true;
                                page.ProceedText = CaptionHelper.GetLocalizedText("CustomFomrsMessages", "DataImportMasterProceed");
                                a.FinishButton.Text = a.NextButton.Text; //"Далее >";
                            }
                        }
                    };

                    importWizard.WizardControl.CancelClick += (o, a) =>
                    {

                    };
                    importWizard.WizardCompleted += (args) =>
                    {
                        isImportCompleted = args;
                    };
                    importWizard.ShowDialog();
                }
            }
        }
コード例 #57
0
ファイル: DoctorDentist.cs プロジェクト: vbre/CS_2015_Winter
 public override void GiveRecipe(IPatient patient)
 {
     patient.Recipe = "Wash with holy water";
 }
コード例 #58
0
 // Переводим фокус на нового пациента
 private void SetCurrentPatient(IPatient currentPatient, DevExpress.ExpressApp.ListView currentView)
 {
     if (currentPatient != null)
     {
         currentView.CurrentObject = currentView.ObjectSpace.FindObject<IPatient>(CriteriaOperator.Parse(string.Format("[ObjectCode] = '{0}'", currentPatient.ObjectCode)));
         importPatient = null;
     }
 }
コード例 #59
0
 public override bool IsSatisfiedBy(IPatient candidate)
 {
     return (candidate.DateBirthday.HasValue && (DateTime.Today.Year - candidate.DateBirthday.Value.Year) >= 18);
 }
コード例 #60
0
ファイル: IPatient.cs プロジェクト: Rukhlov/DataStudio
 public static void OnSaving(IPatient patient, IObjectSpace os)
 {
     patient.FieldsAreFilled = ((String.IsNullOrEmpty(patient.FirstName) == false) &
         (String.IsNullOrEmpty(patient.LastName) == false) &
         (String.IsNullOrEmpty(patient.MiddleName) == false) &
         (patient.Birthday != DateTime.MinValue) &
         (patient.Gender != (Gender.Male & Gender.Female)) &
         (patient.MartialStatus != MartialStatus.None) &
         (String.IsNullOrEmpty(patient.SSN) == false) &
         (patient.Insurance != null) &
         (String.IsNullOrEmpty(patient.MainPhone) == false) &
         (patient.IdentityCardType != null) &
         (String.IsNullOrEmpty(patient.IdentifyCardInfo) == false) &
         (String.IsNullOrEmpty(patient.RegistrationAddress.Country) == false) &
         (String.IsNullOrEmpty(patient.RegistrationAddress.State) == false) &
         (String.IsNullOrEmpty(patient.RegistrationAddress.City) == false) &
         (String.IsNullOrEmpty(patient.RegistrationAddress.Street) == false) &
         (String.IsNullOrEmpty(patient.RegistrationAddress.Zip) == false));
 }