예제 #1
0
 private static PrescribedPharmaceuticalCompounding ToCompounding(PrescribedMedicationDescriptor medication)
 {
     return(new PrescribedPharmaceuticalCompounding
            (
                medication.NameOrDescription,
                medication.Posology,
                medication.Quantity
            ));
 }
예제 #2
0
 private static PrescribedPharmaceuticalSubstance ToSubstance(PrescribedMedicationDescriptor medication)
 {
     return(new PrescribedPharmaceuticalSubstance
            (
                medication.NameOrDescription,
                medication.Posology,
                medication.Quantity,
                BelgianMedicationCode.CreateIfNotEmpty(medication.Code)
            ));
 }
예제 #3
0
 private static PrescribedPharmaceuticalProduct ToProduct(PrescribedMedicationDescriptor medication)
 {
     return(new PrescribedPharmaceuticalProduct
            (
                medication.NameOrDescription,
                medication.Posology,
                medication.Quantity,
                medication.Duration,
                BelgianMedicationCode.CreateIfNotEmpty(medication.Code)
            ));
 }
예제 #4
0
 private static PrescribedPharmaceuticalSubstance ToSubstance(PrescribedMedicationDescriptor medication)
 {
     return(new PrescribedPharmaceuticalSubstance
            (
                medication.NameOrDescription,
                medication.Posology,
                medication.Quantity,
                medication.Duration,
                string.IsNullOrWhiteSpace(medication.Code) ? null : new BelgianMedicationCode(medication.Code)
            ));
 }
예제 #5
0
        private static PrescribedMedication ToPrescribedMedication(PrescribedMedicationDescriptor medication)
        {
            switch (medication.MedicationType)
            {
            case PrescribedMedicationType.Product:
                return(ToProduct(medication));

            case PrescribedMedicationType.Substance:
                return(ToSubstance(medication));

            case PrescribedMedicationType.Compounding:
                return(ToCompounding(medication));

            default:
                throw new ArgumentException($"Medication type '{medication.MedicationType}' not expected.", nameof(medication));
            }
        }