private async Task CustomMedicationMapAsync(PatientMedicationDetailDto dto) { var medication = await _patientMedicationRepository.GetAsync(p => p.Id == dto.Id); if (medication == null) { return; } IExtendable medicationExtended = medication; // Map all custom attributes dto.MedicationAttributes = _modelExtensionBuilder.BuildModelExtension(medicationExtended) .Select(h => new AttributeValueDto() { Id = h.Id, Key = h.AttributeKey, Value = h.TransformValueToString(), Category = h.Category, SelectionValue = GetSelectionValue(h.Type, h.AttributeKey, h.Value.ToString()) }).Where(s => (s.Value != "0" && !String.IsNullOrWhiteSpace(s.Value)) || !String.IsNullOrWhiteSpace(s.SelectionValue)).ToList(); dto.IndicationType = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Type of Indication", medicationExtended); dto.ReasonForStopping = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Reason For Stopping", medicationExtended); dto.ClinicianAction = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Clinician action taken with regard to medicine if related to AE", medicationExtended); dto.ChallengeEffect = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Effect OF Dechallenge (D) & Rechallenge (R)", medicationExtended); }
private async Task CustomMedicationMapAsync(PatientMedicationDetailDto dto) { var medication = await _patientMedicationRepository.GetAsync(p => p.Id == dto.Id); if (medication == null) { return; } IExtendable medicationExtended = medication; dto.IndicationType = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Type of Indication", medicationExtended); dto.ReasonForStopping = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Reason For Stopping", medicationExtended); dto.ClinicianAction = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Clinician action taken with regard to medicine if related to AE", medicationExtended); dto.ChallengeEffect = await _customAttributeService.GetCustomAttributeValueAsync("PatientMedication", "Effect OF Dechallenge (D) & Rechallenge (R)", medicationExtended); }