コード例 #1
0
 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
            ));
 }
コード例 #2
0
 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
            ));
 }