public Patient Translate(PatientState state) { Condition.Requires(state, nameof(state)).IsNotNull(); return(new Patient ( state.Identifier, FullName.FromState(state.FullName), Enumeration.FromCode <BelgianSex>(state.Sex), string.IsNullOrWhiteSpace(state.SocialSecurityNumber) ? null : new BelgianSocialSecurityNumber(state.SocialSecurityNumber), ContactInformation.FromState(state.ContactInformation), state.Birthdate )); }
public PharmaceuticalPrescription Translate(PharmaceuticalPrescriptionState state) { Condition.Requires(state, nameof(state)).IsNotNull(); return(new PharmaceuticalPrescription ( new PrescriptionIdentifier(state.Identifier), this.providerTranslator.Translate(state.Prescriber), this.patientTranslator.Translate(state.Patient), this.facilityTranslator.Translate(state.HealthFacility), state.PrescribedMedications.Select(m => this.medicationTranslator.Translate(m)), new Alpha2LanguageCode(state.LanguageCode), Enumeration.FromCode <PrescriptionStatus>(state.Status), state.CreatedOn, state.DelivrableAt, state.EntityState )); }