Exemplo n.º 1
0
        public async Task <UpdateMedicalRecordRes> UpdatePhysicalExamination(PhysicalExamination result, string mRecordId)
        {
            try
            {
                var medicalRecordRaw = await _medicalRecordRepository.GetMedicalRecordById(mRecordId);

                if (medicalRecordRaw != null)
                {
                    var medicalRecord = Helper.AutoDTO <MedicalRecord, MedicalRecordModel>(medicalRecordRaw);
                    var user          = _userService.GetUserById(medicalRecord.Details.PhysicalExamination.DoctorId);
                    if (medicalRecord.Details.PhysicalExamination == null)
                    {
                        medicalRecord.Details.PhysicalExamination = result;
                    }
                    if (!medicalRecord.Details.PhysicalExamination.IsRegistered || user == null)
                    {
                        return(null);
                    }
                    if (user != null)
                    {
                        medicalRecordRaw.ServiceUsed++;
                    }
                    medicalRecord.Details.PhysicalExamination = result;
                    FinishExamination(medicalRecordRaw);
                    medicalRecordRaw.Details = Helper.AutoDTO <MedicalRecordDetails, string>(medicalRecord.Details);
                    return(await _medicalRecordRepository.UpdateMedicalRecord(medicalRecordRaw));
                }
                return(null);
            }
            catch (Exception)
            {
                return(null);
            }
        }
        public async Task <PhysicalExamination> UpdateAsync(PhysicalExamination physicalExamination)
        {
            var result = context.PhysicalExaminations.Update(physicalExamination);
            await context.SaveChangesAsync();

            return(result.Entity);
        }
Exemplo n.º 3
0
        private void detailsButton_Click(object sender, EventArgs e)
        {
            switch (tabControl.SelectedIndex)
            {
            case 0:
                Appointment appointment = GetAppointmentFromGrid();

                if (appointment != null)
                {
                    OpenForm(new DetailedAppointmentForm(appointment, false));
                }

                break;

            case 1:
                PhysicalExamination examination = GetExaminationFromGrid();

                if (examination != null)
                {
                    OpenForm(new ExaminationForm(examination));
                }

                break;

            case 2:
                LaboratoryExamination laboratory = GetLaboratoryExaminationFromGrid();

                if (laboratory != null)
                {
                    OpenForm(new DetailedLaboratoryForm(laboratory, false));
                }

                break;
            }
        }
Exemplo n.º 4
0
        public async Task <int> AddPatientPhysicalExamination(PhysicalExamination physicalExamination)
        {
            try
            {
                PhysicalExamination data = new PhysicalExamination()
                {
                    PatientId            = physicalExamination.PatientId,
                    PatientMasterVisitId = physicalExamination.PatientMasterVisitId,
                    ExamId            = physicalExamination.ExamId,
                    ExaminationTypeId = physicalExamination.ExaminationTypeId,
                    FindingId         = physicalExamination.FindingId,
                    FindingsNotes     = physicalExamination.FindingsNotes,
                    CreateDate        = DateTime.Now
                };
                await _unitOfWork.Repository <PhysicalExamination>().AddAsync(data);

                await _unitOfWork.SaveAsync();

                return(1);
            }
            catch (Exception e)
            {
                Log.Error(e.Message + " " + e.InnerException);
                throw;
            }
        }
Exemplo n.º 5
0
        public ActionResult Edit(PhysicalExaminationViewModel[] physicalExaminations)
        {
            var formModel = physicalExaminations.Single();

            PhysicalExamination physicalExamination;

            if (formModel.Id == null)
            {
                Debug.Assert(formModel.PatientId != null, "formModel.PatientId != null");
                physicalExamination = new PhysicalExamination
                {
                    CreatedOn  = this.GetUtcNow(),
                    PatientId  = formModel.PatientId.Value,
                    PracticeId = this.DbUser.PracticeId,
                };
                this.db.PhysicalExaminations.AddObject(physicalExamination);
            }
            else
            {
                physicalExamination = this.db.PhysicalExaminations.FirstOrDefault(pe => pe.Id == formModel.Id);
            }

            if (this.ModelState.IsValid)
            {
                Debug.Assert(physicalExamination != null, "physicalExamination != null");
                physicalExamination.Patient.IsBackedUp = false;
                physicalExamination.Notes             = formModel.Notes;
                physicalExamination.MedicalRecordDate = this.ConvertToUtcDateTime(formModel.MedicalRecordDate.Value);
                this.db.SaveChanges();

                return(this.View("Details", GetViewModel(physicalExamination, this.GetToLocalDateTimeConverter())));
            }

            return(this.View("Edit", GetViewModel(physicalExamination, this.GetToLocalDateTimeConverter())));
        }
Exemplo n.º 6
0
        public async Task <Result <PatientExaminationResponse> > Handle(UpdatePatientExaminationCommand request, CancellationToken cancellationToken)
        {
            using (_maternityUnitOfWork)
            {
                try
                {
                    List <PhysicalExamination> postNatalExaminations = new List <PhysicalExamination>();

                    foreach (var postNatalExamResult in request.PostNatalExamResults)
                    {
                        var physicalExaminations = await _maternityUnitOfWork.Repository <PhysicalExamination>().Get(x =>
                                                                                                                     x.PatientId == request.PatientId &&
                                                                                                                     x.PatientMasterVisitId == request.PatientMasterVisitId &&
                                                                                                                     x.ExaminationTypeId == request.ExaminationTypeId &&
                                                                                                                     x.ExamId == postNatalExamResult.ExamId)
                                                   .ToListAsync();

                        if (physicalExaminations.Count > 0)
                        {
                            physicalExaminations[0].FindingId     = postNatalExamResult.FindingId;
                            physicalExaminations[0].FindingsNotes = postNatalExamResult.FindingsNotes;

                            _maternityUnitOfWork.Repository <PhysicalExamination>().Update(physicalExaminations[0]);
                            await _maternityUnitOfWork.SaveAsync();
                        }
                        else
                        {
                            PhysicalExamination postNatalExamination = new PhysicalExamination()
                            {
                                PatientId            = request.PatientId,
                                PatientMasterVisitId = request.PatientMasterVisitId,
                                ExaminationTypeId    = request.ExaminationTypeId,
                                DeleteFlag           = false,
                                CreateDate           = DateTime.Now,
                                CreateBy             = request.CreateBy,
                                ExamId        = postNatalExamResult.ExamId,
                                FindingId     = postNatalExamResult.FindingId,
                                FindingsNotes = postNatalExamResult.FindingsNotes,
                            };
                            postNatalExaminations.Add(postNatalExamination);
                        }
                    }

                    await _maternityUnitOfWork.Repository <PhysicalExamination>().AddRangeAsync(postNatalExaminations);

                    await _maternityUnitOfWork.SaveAsync();

                    return(Result <PatientExaminationResponse> .Valid(new PatientExaminationResponse()
                    {
                        Message = "Successfully updated patient examination"
                    }));
                }
                catch (Exception e)
                {
                    Log.Error("Error updating patient examination " + e.Message + " " + e.InnerException);
                    return(Result <PatientExaminationResponse> .Invalid("Error updating patient examination " + e.Message));
                }
            }
        }
Exemplo n.º 7
0
 public ExaminationListForm(ref PhysicalExamination examination)
 {
     InitializeComponent();
     this.physicalExamination = examination;
     this.physicalExamination.Examinations = new Examinations();
     ifPhysical = true;
     InitializeGrids();
 }
Exemplo n.º 8
0
 public ExaminationForm(ref Appointment appointment)
 {
     InitializeComponent();
     examination             = new PhysicalExamination();
     examination.Appointment = appointment;
     _appointment            = appointment;
     FillPatientDoctorLabels();
 }
Exemplo n.º 9
0
        private void examinationDetailsButton_Click(object sender, EventArgs e)
        {
            PhysicalExamination examination = GetSelectedPhysicalExamination();

            if (examination != null)
            {
                OpenForm(new ExaminationForm(examination));
            }
        }
Exemplo n.º 10
0
        public static PhysicalExamination GetPhysicalExaminationByName(string name)
        {
            PhysicalExamination retVal = (from examination in db.Examinations
                                          join physEx in db.PhysicalExamination on examination.Code equals physEx.ExaminationCode
                                          where examination.Name == name
                                          select physEx).FirstOrDefault();

            return(retVal);
        }
Exemplo n.º 11
0
 public ExaminationForm(PhysicalExamination examination)
 {
     InitializeComponent();
     this.examination = examination;
     FillTextBoxes();
     searchButton.Visible   = false;
     saveButton.Visible     = false;
     resultTextBox.ReadOnly = true;
 }
Exemplo n.º 12
0
        /**************************************************************************************************/
        private void LoadOrGetPhysicalExam()
        {
            //  get active patinet object from session manager
            physicalExam = SessionManager.Instance.GetActivePatient().PhysicalExam;

            if (physicalExam != null)
            {
                physicalExam.AddHandlersWithLoad(PhysicalExamChanged, PhysicalExamLoaded, null);
            }
        }
Exemplo n.º 13
0
        public void Add(PhysicalExamination ObjToSave)
        {
            var Data = _context.PhysicalExaminations.FirstOrDefault(m => m.CompanyID == ObjToSave.CompanyID && m.OwnerID == ObjToSave.OwnerID && m.AnimalID == ObjToSave.AnimalID);

            if (Data != null)
            {
                _context.PhysicalExaminations.Remove(Data);
            }

            _context.PhysicalExaminations.Add(ObjToSave);
        }
Exemplo n.º 14
0
        private void assignPhysicalExamination(PhysicalExamination newExamination)
        {
            if (newExamination == null)
            {
                return;
            }

            physicalExamination.ExaminationCode   = newExamination.ExaminationCode;
            physicalExamination.Examinations.Name = newExamination.Examinations.Name;
            physicalExamination.Examinations.Type = newExamination.Examinations.Type;
            physicalExamination.Id = newExamination.Id;
        }
Exemplo n.º 15
0
 public static void InsertPhysicalExamination(PhysicalExamination examination)
 {
     examination.Examinations = null;
     db.PhysicalExamination.Add(examination);
     try {
         db.SaveChanges();
     }
     catch (System.Data.Entity.Infrastructure.DbUpdateException exc)
     {
         System.Console.WriteLine("Error: {1}", exc.Message);
     }
 }
        public async Task <IActionResult> CreatePhysicalExaminationAsync(PhysicalExaminationDTO physicalExaminationDto,
                                                                         HttpRequest request)
        {
            if (string.IsNullOrEmpty(physicalExaminationDto.Result))
            {
                return(new JsonResult(new ExceptionDto {
                    Message = "No examination result was passed"
                })
                {
                    StatusCode = 422
                });
            }

            var examinationCode =
                await examinationCodeRepository.GetAsync(physicalExaminationDto.ExaminationCodeId);

            if (examinationCode == null)
            {
                return(new JsonResult(new ExceptionDto {
                    Message = "No examination with given code was found"
                })
                {
                    StatusCode = 422
                });
            }

            var appointment = await appointmentRepository.GetAsync(physicalExaminationDto.AppointmentId);

            if (appointment == null)
            {
                return(new JsonResult(new ExceptionDto {
                    Message = "Could not find the appointment"
                })
                {
                    StatusCode = 422
                });
            }

            var physicalExamination = new PhysicalExamination
            {
                Result = physicalExaminationDto.Result, Appointment = appointment, ExaminationCode = examinationCode
            };

            await physicalExaminationRepository.AddAsync(physicalExamination);

            appointment.PhysicalExaminations.Add(physicalExamination);
            await appointmentRepository.UpdateAsync(appointment);

            return(new JsonResult(physicalExamination)
            {
                StatusCode = 200
            });
        }
        public async Task <IActionResult> UpdatePhysicalExamination([FromBody] PhysicalExamination result, string mRecordId)
        {
            if (ModelState.IsValid)
            {
                var response = await _medicalRecordService.UpdatePhysicalExamination(result, mRecordId);

                if (response != null)
                {
                    return(Ok(response));
                }
            }
            return(BadRequest());
        }
Exemplo n.º 18
0
        private static void SaveCancerRiskFactors()
        {
            Breast bcancer = new Breast();

            CancerRiskFactors breast = new Breast()
            {
                MensturationHistory = new MensturationHistory()
                {
                    AgeOfFirstPeriod = "",
                    AgePeriodStopped = "",
                    Confident        = "",
                    LMP = "",
                    StillHavingPeriods = ""
                },
                PhysicalData = new PhysicalData()
                {
                    Weight = "",
                    Feet   = "",
                    Inches = ""
                },
            };


            CancerRiskFactors colorectal = new Colorectal()
            {
                MensturationHistory = new MensturationFactors()
                {
                    AgePeriodStopped   = "",
                    StillHavingPeriods = ""
                },
                PhysicalData = new PhysicalData()
                {
                    Weight = "",
                    Feet   = "",
                    Inches = ""
                },
            };

            SessionManager.Instance.SetActivePatient("99911041507", 7);
            PhysicalExamination physical = new PhysicalExamination(SessionManager.Instance.GetActivePatient());

            // physical.weightPounds = "75";
            //HraModelChangedEventArgs args = new HraModelChangedEventArgs(null);
            //args.updatedMembers.Add(physical.GetMemberByName("weightPounds")); // Edit And save

            //physical.BackgroundPersistWork(args);


            physical.weightPounds = "80";
            physical.BackgroundPersistWork(new HraModelChangedEventArgs(null));
        }
Exemplo n.º 19
0
        public JsonResult Save(PhysicalExamination ObjToSave)
        {
            MsgUnit Msg = new MsgUnit();

            try
            {
                var userId   = User.Identity.GetUserId();
                var UserInfo = _unitOfWork.UserAccount.GetUserByID(userId);
                if (UserInfo == null)
                {
                    Msg.Msg  = Resources.Resource.PleaseCreateYourCompanyProfileFisrt;
                    Msg.Code = 0;
                    return(Json(Msg, JsonRequestBehavior.AllowGet));
                }
                ObjToSave.CompanyID = UserInfo.fCompanyId;

                if (UserInfo.fCompanyId == 0)
                {
                    Msg.Msg  = Resources.Resource.PleaseCreateYourCompanyProfileFisrt;
                    Msg.Code = 0;
                    return(Json(Msg, JsonRequestBehavior.AllowGet));
                }
                if (!ModelState.IsValid)
                {
                    string Err    = " ";
                    var    errors = ModelState.Values.SelectMany(v => v.Errors);
                    foreach (ModelError error in errors)
                    {
                        Err = Err + error.ErrorMessage + "  ";
                    }

                    Msg.Msg  = Resources.Resource.SomthingWentWrong + " " + Err;
                    Msg.Code = 0;
                    return(Json(Msg, JsonRequestBehavior.AllowGet));
                }

                _unitOfWork.PhysicalExamination.Add(ObjToSave);
                _unitOfWork.Complete();
                Msg.Msg  = Resources.Resource.AddedSuccessfully;
                Msg.Code = 1;
            }
            catch (Exception ex)
            {
                Msg.Msg  = Resources.Resource.SomthingWentWrong + " " + ex.Message.ToString();
                Msg.Code = 0;
            }



            return(Json(Msg, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 20
0
 public static PhysicalExamination GetPhysicalExaminationByCode(int code)
 {
     try
     {
         PhysicalExamination retVal = (from examination in db.Examinations
                                       join physEx in db.PhysicalExamination on examination.Code equals physEx.ExaminationCode
                                       where physEx.ExaminationCode == code.ToString()
                                       select physEx).FirstOrDefault();
         return(retVal);
     }
     catch (InvalidOperationException)
     {
         return(null);
     }
 }
Exemplo n.º 21
0
        public static PhysicalExaminationViewModel GetViewModel(PhysicalExamination physicalExamination, Func <DateTime, DateTime> toLocal)
        {
            if (physicalExamination == null)
            {
                return(new PhysicalExaminationViewModel());
            }

            return(new PhysicalExaminationViewModel
            {
                Id = physicalExamination.Id,
                PatientId = physicalExamination.PatientId,
                Notes = physicalExamination.Notes,
                MedicalRecordDate = toLocal(physicalExamination.MedicalRecordDate),
            });
        }
Exemplo n.º 22
0
        public async Task <Result <PostnatalExamResultsResponse> > Handle(AddPostNatalExaminationCommand request, CancellationToken cancellationToken)
        {
            using (_maternityUnitOfWork)
            {
                try
                {
                    List <PhysicalExamination> postNatalExaminations = new List <PhysicalExamination>();

                    foreach (var results in request.PostNatalExamResults)
                    {
                        PhysicalExamination postNatalExamination = new PhysicalExamination()
                        {
                            PatientId            = request.PatientId,
                            PatientMasterVisitId = request.PatientMasterVisitId,
                            ExaminationTypeId    = request.ExaminationTypeId,
                            DeleteFlag           = false,
                            CreateDate           = DateTime.Now,
                            CreateBy             = request.CreateBy,
                            ExamId        = results.ExamId,
                            FindingId     = results.FindingId,
                            FindingsNotes = results.FindingsNotes,
                        };
                        postNatalExaminations.Add(postNatalExamination);
                    }
                    await _maternityUnitOfWork.Repository <PhysicalExamination>().AddRangeAsync(postNatalExaminations);

                    await _maternityUnitOfWork.SaveAsync();

                    _maternityUnitOfWork.Dispose();
                    return(Result <PostnatalExamResultsResponse> .Valid(new PostnatalExamResultsResponse
                    {
                        PatientId = request.PatientId
                    }));
                }
                catch (Exception e)
                {
                    Log.Error(e.Message);
                    return(Result <PostnatalExamResultsResponse> .Invalid(e.Message));
                }
            }
        }
Exemplo n.º 23
0
        private void selectButton_Click(object sender, EventArgs e)
        {
            string name = "";
            string code = "";

            if (ifPhysical)
            {
                PhysicalExamination ex = GetPhysicalExaminationFromGrid();

                if (ex == null)
                {
                    return;
                }

                assignPhysicalExamination(ex);

                name = ex.Examinations.Name;
                code = ex.ExaminationCode;
            }
            else
            {
                LaboratoryExamination ex = GetLaboratoryExaminationFromGrid();

                if (ex == null)
                {
                    return;
                }

                assignLaboratoryExamination(ex);

                name = ex.Examinations.Name;
                code = ex.ExaminationCode;
            }

            codeTextBox.Text = code;
            nameTextBox.Text = name;

            Return();
        }
Exemplo n.º 24
0
        public JsonResult GetPhysicalExamination(int id, string id2)
        {
            try
            {
                var userId   = User.Identity.GetUserId();
                var UserInfo = _unitOfWork.UserAccount.GetUserByID(userId);
                if (UserInfo == null)
                {
                    return(Json(new List <PhysicalExamination>(), JsonRequestBehavior.AllowGet));
                }


                var R = _unitOfWork.PhysicalExamination.GetPhysicalExamination(UserInfo.fCompanyId, id2, id);
                if (R == null)
                {
                    R = new PhysicalExamination();
                }
                return(Json(R, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json(new List <PhysicalExamination>(), JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 25
0
        private void SeedData()
        {
            _fakeIdentityUsers = IdentityHelper.GetIdentityUsers();
            var userInformation = new UserInformation
            {
                Name        = "name",
                City        = "hank",
                Street      = "lepelaarstraat20",
                HouseNumber = "20",
                PostalCode  = "23",
                Country     = "qwe",
                UserId      = Guid.Parse(_fakeIdentityUsers[0].Id)
            };

            _fakeUsersInformation = new List <UserInformation>();
            _fakeUsersInformation.AddRange(new List <UserInformation>
            {
                userInformation
            });

            var patient = new Patient
            {
                Name             = "jim",
                Bsn              = "bsn",
                Email            = "*****@*****.**",
                Dob              = DateTime.Now,
                Gender           = Gender.Male,
                PhoneNumber      = "124124",
                City             = "hank",
                Street           = "lepelaarstraat",
                HouseNumber      = "20",
                HouseNumberAddon = "",
                PostalCode       = "4273cv",
                Country          = "Netherlands"
            };

            var type = new AdditionalExaminationType
            {
                Name = "typename",
                Unit = "GPS"
            };
            var additional = new AdditionalExaminationResult
            {
                Value = "value",
                Date  = DateTime.Now,
                AdditionalExaminationType = type
            };
            var ipCode = new IcpcCode
            {
                Name = "Name",
                Code = "code"
            };
            var episode = new Episode
            {
                Description = "Description",
                Priority    = 10,
                Patient     = patient,
                IcpcCode    = ipCode
            };
            var intolerance = new Intolerance
            {
                Description = "descrption",
                EndDate     = DateTime.Now,
                StartDate   = DateTime.Now,
                Patient     = patient
            };
            var physical = new PhysicalExamination
            {
                Value   = "physical",
                Date    = DateTime.Now,
                Patient = patient
            };
            var consultation = new Consultation
            {
                Id       = 1,
                Date     = DateTime.Now,
                Comments = "comments",
                DoctorId = Guid.Parse(_fakeIdentityUsers[0].Id),
                Doctor   = _fakeIdentityUsers[0],
                Patient  = patient,
                AdditionalExaminationResults = new List <AdditionalExaminationResult>
                {
                    additional
                },
                Episodes = new List <Episode>
                {
                    episode
                },
                Intolerances = new List <Intolerance>
                {
                    intolerance
                },
                PhysicalExaminations = new List <PhysicalExamination>
                {
                    physical
                }
            };

            var activity = new Prescription
            {
                Id           = 1,
                Description  = "description",
                StartDate    = DateTime.Now,
                EndDate      = DateTime.MaxValue,
                Patient      = patient,
                Consultation = consultation
            };
            var activity02 = new Prescription
            {
                Id           = 2,
                Description  = "description",
                StartDate    = DateTime.Now,
                EndDate      = DateTime.MaxValue,
                Patient      = patient,
                Consultation = consultation
            };

            _fakeEntities = new List <Prescription>
            {
                activity, activity02
            };

            _constulatations = new List <Consultation>
            {
                consultation
            };
            _patients = new List <Patient>
            {
                patient
            };
        }
Exemplo n.º 26
0
 public void Update(PhysicalExamination ObjToSave)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 27
0
        public async Task <IEnumerable <PhysicalExamAntiAgingViewModel> > GetExamAntiAgingByEpiRowIdAsync(long epiRowId)
        {
            var physicalExam = await _questionnaireRepository.GetPhysicalExamAntiAgingAsync(epiRowId);

            var results = new List <PhysicalExamAntiAgingViewModel>();

            foreach (var item in physicalExam)
            {
                var history = new History()
                {
                    QCC                   = item.QCC,
                    QCCText               = item.QCCText,
                    QCCOtherText          = item.QCCOtherText,
                    QUnderlying           = item.QUnderlying,
                    QCurrentMed           = item.QCurrentMed,
                    QSupplementation      = item.QSupplementation,
                    QHistoryInvestigation = item.QHistoryInvestigation,
                    QGI                   = item.QGI,
                    QGOText               = item.QGOText,
                    QSleep                = item.QSleep,
                    QSleepHours           = item.QSleepHours,
                    QSleepText            = item.QSleepText,
                    QSkin                 = item.QSkin,
                    QSkinText             = item.QSkinText,
                    QMemory               = item.QMemory,
                    QMemoryText           = item.QMemoryText,
                    QImmune               = item.QImmune,
                    QImmuneText           = item.QImmuneText,
                    QSexual               = item.QSexual,
                    QSexualText           = item.QSexualText,
                    QExercise             = item.QExercise,
                };

                var isHistory = history.GetType().GetProperties()
                                .Where(h => h.GetValue(history) is string)
                                .Select(h => (string)h.GetValue(history))
                                .Any(value => !String.IsNullOrEmpty(value));

                var genetic = new Genetic()
                {
                    QGenetic = item.QGenetic
                };

                var isGenetic = genetic.GetType().GetProperties()
                                .Where(g => g.GetValue(genetic) is string)
                                .Select(g => (string)g.GetValue(genetic))
                                .Any(value => !String.IsNullOrEmpty(value));

                var familyHistory = new FamilyHistory()
                {
                    QFamilyFather = item.QFamilyFather,
                    QFamilyMother = item.QFamilyMother
                };

                var isFamilyHistory = familyHistory.GetType().GetProperties()
                                      .Where(f => f.GetValue(familyHistory) is string)
                                      .Select(f => (string)f.GetValue(familyHistory))
                                      .Any(value => !String.IsNullOrEmpty(value));

                var physicalExamination = new PhysicalExamination()
                {
                    QENTPE                = item.QENTPE,
                    QAbdomenPE            = item.QAbdomenPE,
                    QAbdomenPEText        = item.QAbdomenPEText,
                    QCardiovascularPE     = item.QCardiovascularPE,
                    QCardiovascularPEText = item.QCardiovascularPEText,
                    QENTNeckNode          = item.QENTNeckNode,
                    QENTPEText            = item.QENTPEText,
                    QENTPharynx           = item.QENTPharynx,
                    QENTTonsils           = item.QENTTonsils,
                    QGeneralPE            = item.QGeneralPE,
                    QGeneralPEText        = item.QGeneralPEText,
                    QPEText               = item.QPEText,
                    QRespiratoryPE        = item.QRespiratoryPE,
                    QRespiratoryPEText    = item.QRespiratoryPEText
                };

                var isPhysicalExamination = physicalExamination.GetType().GetProperties()
                                            .Where(p => p.GetValue(physicalExamination) is string)
                                            .Select(p => (string)p.GetValue(physicalExamination))
                                            .Any(value => !String.IsNullOrEmpty(value));

                var specialNote = new SpecialNote()
                {
                    QSpecialNote = item.QSpecialNote
                };

                var model = new PhysicalExamAntiAgingViewModel()
                {
                    ID                    = item.ID,
                    QUESPAAdmDR           = item.QUESPAAdmDR,
                    QUESPAPatMasDR        = item.QUESPAPatMasDR,
                    QUESDate              = item.QUESDate,
                    QUESTime              = item.QUESTime,
                    History               = history,
                    IsHistory             = isHistory,
                    Genetic               = genetic,
                    IsGenetic             = isGenetic,
                    FamilyHistory         = familyHistory,
                    IsFamilyHistory       = isFamilyHistory,
                    PhysicalExamination   = physicalExamination,
                    IsPhysicalExamination = isFamilyHistory,
                    SpecialNote           = specialNote,
                    QDoctor               = item.QDoctor,
                    QUESUserDR            = item.QUESUserDR
                };


                results.Add(model);
            }

            return(results);
        }
        private void SeedData()
        {
            _fakeUsersPatient = new List <Patient>();

            _fakeIdentityUsers = IdentityHelper.GetIdentityUsers();
            var patient = new Patient
            {
                Name        = "Name",
                Bsn         = "Bsn",
                Email       = "test",
                Dob         = DateTime.Now,
                Gender      = Gender.Male,
                PhoneNumber = "1321",
                City        = "hank",
                Street      = "lepelaarstraat20",
                HouseNumber = "20",
                PostalCode  = "23",
                Country     = "qwe"
            };
            var patient02 = new Patient
            {
                Name        = "Name",
                Bsn         = "Bsn",
                Email       = "test",
                Dob         = DateTime.Now,
                Gender      = Gender.Male,
                PhoneNumber = "1321",
                City        = "hank",
                Street      = "lepelaarstraat20",
                HouseNumber = "20",
                PostalCode  = "23",
                Country     = "qwe"
            };

            _fakeUsersPatient.AddRange(new List <Patient>
            {
                patient, patient02
            });

            var activity = new AdditionalExaminationResult
            {
                Id = 1, Value = "value", Date = DateTime.Now
            };


            var type = new AdditionalExaminationType
            {
                Name = "typename", Unit = "GPS"
            };
            var additional = new AdditionalExaminationResult
            {
                Value = "value", Date = DateTime.Now, AdditionalExaminationType = type
            };
            var ipCode = new IcpcCode
            {
                Name = "Name", Code = "code"
            };
            var episode = new Episode
            {
                Description = "Description", Priority = 10, Patient = patient02, IcpcCode = ipCode
            };
            var intolerance = new Intolerance
            {
                Description = "descrption", EndDate = DateTime.Now, StartDate = DateTime.Now, Patient = patient02
            };
            var physical = new PhysicalExamination
            {
                Value = "physical", Date = DateTime.Now, Patient = patient02
            };
            var consultation = new Consultation
            {
                Id       = 1,
                Date     = DateTime.Now,
                Comments = "comments",
                DoctorId = Guid.Parse(_fakeIdentityUsers[0].Id),
                Doctor   = _fakeIdentityUsers[0],
                Patient  = patient02,
                AdditionalExaminationResults = new List <AdditionalExaminationResult>
                {
                    additional
                },
                Episodes = new List <Episode>
                {
                    episode
                },
                Intolerances = new List <Intolerance>
                {
                    intolerance
                },
                PhysicalExaminations = new List <PhysicalExamination>
                {
                    physical
                }
            };


            var activity02 = new AdditionalExaminationResult
            {
                Id                          = 2,
                Value                       = "value",
                Date                        = DateTime.Now,
                Patient                     = patient02,
                PatientId                   = patient02.Id,
                Consultation                = consultation,
                ConsultationId              = consultation.Id,
                AdditionalExaminationType   = type,
                AdditionalExaminationTypeId = type.Id
            };

            _fakeEntities = new List <AdditionalExaminationResult>
            {
                activity, activity02
            };
            _consultations = new List <Consultation>
            {
                consultation
            };
            _types = new List <AdditionalExaminationType>
            {
                type
            };
        }
Exemplo n.º 29
0
        private List <Consultation> GetConsultations(AdditionalExaminationResult additional, Episode ep)
        {
            var p = new Patient
            {
                Id               = 5,
                Name             = "jim",
                Bsn              = "bsn",
                Email            = "*****@*****.**",
                Dob              = DateTime.Now,
                Gender           = Gender.Male,
                PhoneNumber      = "124124",
                City             = "hank",
                Street           = "lepelaarstraat",
                HouseNumber      = "20",
                HouseNumberAddon = "",
                PostalCode       = "4273cv",
                Country          = "Netherlands"
            };

            var intolerances = new Intolerance
            {
                Description = "descrption",
                EndDate     = DateTime.Now,
                StartDate   = DateTime.Now,
                Patient     = p
            };
            var physical = new PhysicalExamination
            {
                Value   = "physical",
                Date    = DateTime.Now,
                Patient = p
            };
            var c = new Consultation
            {
                Id        = 1,
                Date      = DateTime.Now,
                Comments  = "comments",
                DoctorId  = Guid.Parse(_users[0].Id),
                Doctor    = _users[0],
                PatientId = p.Id,
                Patient   = p,
                AdditionalExaminationResults = new List <AdditionalExaminationResult>
                {
                    additional
                },
                Episodes = new List <Episode>
                {
                    ep
                },
                Intolerances = new List <Intolerance>
                {
                    intolerances
                },
                PhysicalExaminations = new List <PhysicalExamination>
                {
                    physical
                }
            };

            return(new List <Consultation> {
                c
            });
        }