Пример #1
0
 public PharmaceuticalPrescription Translate(CreatePharmaceuticalPrescription command,
                                             IDictionary <string, object> options = null)
 {
     Condition.Requires(command, nameof(command)).IsNotNull();
     return(PharmaceuticalPrescription.Create
            (
                new PrescriptionIdentifier(command.PrescriptionIdentifier),
                ToPrescriber(command),
                ToPatient(command),
                command.Medications.Select(m => ToPrescribedMedication(m)),
                command.CreatedOn,
                new Alpha2LanguageCode(command.LanguageCode),
                EncounterIdentifier.CreateIfNotEmpty(command.EncounterIdentifier),
                command.DeliverableAt
            ));
 }
Пример #2
0
 public PharmaceuticalPrescription Translate(PharmaceuticalPrescriptionState state,
                                             IDictionary <string, object> options = null)
 {
     Condition.Requires(state, nameof(state)).IsNotNull();
     return(new PharmaceuticalPrescription
            (
                new PrescriptionIdentifier(state.Identifier),
                this.practitionerTranslator.Translate(state.Prescriber),
                this.patientTranslator.Translate(state.Patient),
                state.PrescribedMedications.Select(m => this.medicationTranslator.Translate(m)),
                new Alpha2LanguageCode(state.LanguageCode),
                Enumeration.ParseCode <PrescriptionStatus>(state.Status),
                state.CreatedOn,
                EncounterIdentifier.CreateIfNotEmpty(state.EncounterIdentifier),
                state.DeliverableAt,
                state.EntityState
            ));
 }