Exemplo n.º 1
0
        private LookupValueDto GetMedicationStatus(StatusCodedConceptDataTransferObject status)
        {
            LookupValueDto result = null;

            MedicationStatus lookup = null;

            if (status != null)
            {
                if (!string.IsNullOrEmpty(status.Status))
                {
                    lookup = _mappingHelper.MapLookupFieldByName <MedicationStatus> (status.Status);
                }
                else if (!string.IsNullOrEmpty(status.DisplayName))
                {
                    lookup = _mappingHelper.MapLookupFieldByName <MedicationStatus> (status.DisplayName);
                }
            }

            if (lookup != null)
            {
                result = AutoMapper.Mapper.Map <LookupBase, LookupValueDto> (lookup);
            }

            return(result);
        }
Exemplo n.º 2
0
        public void StatusTest()
        {
            MedicationLine   target = new MedicationLine();
            MedicationStatus val    = MedicationStatus.Active;

            target.Status = val;
            Assert.AreEqual(val, target.Status, "NhsCui.Toolkit.Web.MedicationLine.Status was not set correctly.");
        }
Exemplo n.º 3
0
        public void StatusTest()
        {
            Medication       target = new Medication();
            MedicationStatus val    = MedicationStatus.Suspended;

            target.Status = val;
            Assert.AreEqual(val, target.Status, "NhsCui.Toolkit.Web.Medication.Status was not set correctly.");
        }
Exemplo n.º 4
0
        public override Task <MedicationMissedReply> MedicationMissed(MedicationMissedRequest request, ServerCallContext context)
        {
            _logger.LogInformation($"Medication with ID " + request.MedicationId + " missed on " + DateTime.Today);

            var status = new MedicationStatus {
                MedicationId = request.MedicationId, Date = request.DateTime, PatientId = request.PatientId, Status = "Missed"
            };

            _medicationStatusService.AddMedicationStatus(status);

            return(Task.FromResult(new MedicationMissedReply {
                Message = "Medication marked as missed"
            }));
        }
Exemplo n.º 5
0
 public void AddMedicationStatus(MedicationStatus status)
 {
     _unitOfWork.MedicationStatusRepository.Insert(status);
     _unitOfWork.Save();
 }