예제 #1
0
 protected Prescription(PrescriptionIdentifier identifier,
                        HealthcarePractitioner prescriber,
                        Patient patient,
                        HealthFacility healthFacility,
                        Alpha2LanguageCode languageCode,
                        PrescriptionStatus status,
                        DateTime createdOn,
                        DateTime?delivrableAt             = null,
                        EntityState entityState           = EntityState.Added,
                        IEnumerable <IDomainEvent> events = null)
     : base(entityState, events)
 {
     Condition.Requires(identifier, nameof(identifier)).IsNotNull();
     Condition.Requires(prescriber, nameof(prescriber)).IsNotNull();
     Condition.Requires(patient, nameof(patient)).IsNotNull();
     Condition.Requires(healthFacility, nameof(healthFacility)).IsNotNull();
     Condition.Requires(status, nameof(status)).IsNotNull();
     Condition.Requires(languageCode, nameof(languageCode)).IsNotNull();
     this.Identifier     = identifier;
     this.Prescriber     = prescriber;
     this.Patient        = patient;
     this.HealthFacility = healthFacility;
     this.Status         = status;
     this.CreatedOn      = createdOn;
     this.DelivrableAt   = delivrableAt;
     this.LanguageCode   = languageCode;
 }
예제 #2
0
 public void Revoke(string reason)
 {
     Condition.Requires(reason, nameof(reason)).IsNotNullOrWhiteSpace();
     if (this.IsRevocable())
     {
         this.Status = PrescriptionStatus.Revoked;
         this.MarkAsModified();
         this.AddPrescriptionRevokedEvent(reason);
     }
 }
 private static PharmaceuticalPrescription CreatePrescription(PrescriptionStatus status)
 {
     return(new PharmaceuticalPrescription
            (
                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"),
                status,
                new DateTime(2016, 2, 7)
            ));
 }
예제 #4
0
 public PharmaceuticalPrescription(PrescriptionIdentifier identifier,
                                   HealthcareProvider prescriber,
                                   Patient patient,
                                   HealthFacility healthFacility,
                                   IEnumerable <PrescribedMedication> prescribedMedications,
                                   Alpha2LanguageCode languageCode,
                                   PrescriptionStatus status,
                                   DateTime createdOn,
                                   DateTime?delivrableAt             = null,
                                   EntityState entityState           = EntityState.Added,
                                   IEnumerable <IDomainEvent> events = null)
     : base(identifier, prescriber, patient, healthFacility, languageCode, status, createdOn, delivrableAt, entityState, events)
 {
     Condition.Requires(prescribedMedications, nameof(prescribedMedications))
     .IsNotNull()
     .IsNotEmpty()
     .DoesNotContain(null);
     this.PrescribedMedications.AddRange(prescribedMedications);
 }