Ejemplo n.º 1
0
        public static PharmaceuticalPrescription Create(PrescriptionIdentifier identifier,
                                                        HealthcareProvider prescriber,
                                                        Patient patient,
                                                        HealthFacility healthFacility,
                                                        IEnumerable <PrescribedMedication> prescribedMedications,
                                                        DateTime createdOn,
                                                        Alpha2LanguageCode languageCode,
                                                        DateTime?delivrableAt = null)
        {
            var prescription = new PharmaceuticalPrescription
                               (
                identifier,
                prescriber,
                patient,
                healthFacility,
                prescribedMedications,
                languageCode,
                PrescriptionStatus.Created,
                createdOn,
                delivrableAt
                               );

            prescription.AddEvent(new PharmaceuticalPrescriptionCreated(identifier.Identifier, createdOn));
            return(prescription);
        }
Ejemplo n.º 2
0
        public static PharmaceuticalPrescription Create(PrescriptionIdentifier identifier,
                                                        HealthcarePractitioner prescriber,
                                                        Patient patient,
                                                        IEnumerable <PrescribedMedication> prescribedMedications,
                                                        DateTime createdOn,
                                                        Alpha2LanguageCode languageCode,
                                                        EncounterIdentifier encounterIdentifier = null,
                                                        DateTime?delivrableAt = null)
        {
            var prescription = new PharmaceuticalPrescription
                               (
                identifier,
                prescriber,
                patient,
                prescribedMedications,
                languageCode,
                PrescriptionStatus.Created,
                createdOn,
                encounterIdentifier,
                delivrableAt
                               );

            prescription.AddEvent(new PharmaceuticalPrescriptionCreated(identifier.Value, createdOn));
            return(prescription);
        }
Ejemplo n.º 3
0
        public void Create_CreationDateNotSpecified_MarksPrescriptionAsCreated()
        {
            // Act
            var prescription = PharmaceuticalPrescription.Create
                               (
                new PrescriptionIdentifier(1),
                new Physician(1, new FullName("Duck", "Donald"), new BelgianHealthcarePractitionerLicenseNumber("19006951001")),
                new Patient(1, new FullName("Fred", "Flintstone"), BelgianSex.Male),
                new PrescribedMedication[] { new PrescribedPharmaceuticalProduct("ADALAT OROS 30 COMP 28 X 30 MG", "appliquer 2 fois par jour") },
                new Alpha2LanguageCode("FR")
                               );

            // Assert
            prescription.Status.Should().Be(PrescriptionStatus.Created);
        }
Ejemplo n.º 4
0
        public void Create_CreationDateSpecified_AddsPrescriptionCreatedEvent()
        {
            // Act
            var prescription = PharmaceuticalPrescription.Create
                               (
                new PrescriptionIdentifier(1),
                new Physician(1, new FullName("Duck", "Donald"), new BelgianHealthcarePractitionerLicenseNumber("19006951001")),
                new Patient(1, new FullName("Fred", "Flintstone"), BelgianSex.Male),
                new PrescribedMedication[] { new PrescribedPharmaceuticalProduct("ADALAT OROS 30 COMP 28 X 30 MG", "appliquer 2 fois par jour") },
                new DateTime(2016, 2, 7),
                new Alpha2LanguageCode("FR")
                               );

            // Assert
            prescription.AllEvents().Should().ContainSingle(e => e is PharmaceuticalPrescriptionCreated);
        }