예제 #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);
        }
예제 #2
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;
 }
예제 #3
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);
        }
예제 #4
0
 public static PharmaceuticalPrescription Create(PrescriptionIdentifier identifier,
                                                 HealthcareProvider prescriber,
                                                 Patient patient,
                                                 HealthFacility healthFacility,
                                                 IEnumerable <PrescribedMedication> prescribedMedications,
                                                 Alpha2LanguageCode languageCode,
                                                 DateTime?delivrableAt = null)
 {
     return(Create(identifier, prescriber, patient, healthFacility, prescribedMedications, DateTime.Now, languageCode, delivrableAt));
 }
예제 #5
0
 public static PharmaceuticalPrescription Create(PrescriptionIdentifier identifier,
                                                 HealthcarePractitioner prescriber,
                                                 Patient patient,
                                                 IEnumerable <PrescribedMedication> prescribedMedications,
                                                 Alpha2LanguageCode languageCode,
                                                 EncounterIdentifier encounterIdentifier = null,
                                                 DateTime?delivrableAt = null)
 {
     return(Create(identifier, prescriber, patient, prescribedMedications, SystemTime.Local(), languageCode, encounterIdentifier, delivrableAt));
 }
예제 #6
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);
 }