Example #1
0
        public async Task <MedicalHistoryModel> Handle(GetPatientHistoryQuery request, CancellationToken cancellationToken)
        {
            var history = new PatientHistory(_context);
            var data    = await history.GetPatientHistory <PatientHistoryItem>(request.Id);

            var patient = _context.People.SingleOrDefault(p => p.Id == request.Id);

            return(new MedicalHistoryModel
            {
                PatientId = patient.Id,
                FirstName = patient.FirstName,
                BirthDate = patient.BirthDate,
                Gender = patient.BiologicGender,
                DriverLicenseNumber = patient.DriverLicenseNumber,
                LastName = patient.LastName,
                SSID = patient.SocialSecurityNumber,
                MedicalHistoryItems = new List <IMedicalHistoryItem>(data)
            });
        }