Esempio n. 1
0
 /// <summary>
 /// Revises the enrollment date.
 /// </summary>
 /// <param name="enrollmentDate">The enrollment date.</param>
 public virtual void ReviseEnrollmentDate(DateTime enrollmentDate)
 {
     DomainRuleEngine.CreateRuleEngine <ProgramEnrollment, DateTime> (this, () => ReviseEnrollmentDate)
     .WithContext(enrollmentDate)
     .WithContext(EnrollingStaff)
     .Execute(() => EnrollmentDate = enrollmentDate);
 }
Esempio n. 2
0
        /// <summary>
        /// Destroys the program.
        /// </summary>
        /// <param name="program">The program.</param>
        public void DestroyProgram(Program program)
        {
            Check.IsNotNull(program, "Program is required");

            DomainRuleEngine.CreateRuleEngine(program, () => DestroyProgram)
            .Execute(() => _programRepository.MakeTransient(program));
        }
Esempio n. 3
0
        /// <summary>
        /// Destroys the program offering.
        /// </summary>
        /// <param name="programOffering">The program offering.</param>
        public void DestroyProgramOffering(ProgramOffering programOffering)
        {
            Check.IsNotNull(programOffering, "Program is required");

            DomainRuleEngine.CreateRuleEngine(programOffering, () => DestroyProgramOffering)
            .Execute(() => _programOfferingRepository.MakeTransient(programOffering));
        }
Esempio n. 4
0
        /// <summary>
        /// Renames the program.
        /// </summary>
        /// <param name="name">The name.</param>
        public virtual void RenameProgram(string name)
        {
            Check.IsNotNullOrWhitespace(name, "name is required.");

            DomainRuleEngine.CreateRuleEngine <Program, string> (this, () => RenameProgram)
            .WithContext(name)
            .Execute(() => Name = name);
        }
Esempio n. 5
0
        /// <summary>
        /// Revises the enrolling staff.
        /// </summary>
        /// <param name="enrollingStaff">The enrolling staff.</param>
        public virtual void ReviseEnrollingStaff(Staff enrollingStaff)
        {
            Check.IsNotNull(enrollingStaff, "Enrolling Staff is required.");

            DomainRuleEngine.CreateRuleEngine <ProgramEnrollment, Staff> (this, () => ReviseEnrollingStaff)
            .WithContext(enrollingStaff)
            .Execute(() => EnrollingStaff = enrollingStaff);
        }
Esempio n. 6
0
        /// <summary>
        /// Sets the primary photo.
        /// </summary>
        /// <param name="patientPhoto">The patient photo.</param>
        public virtual void SetPrimaryPhoto(PatientPhoto patientPhoto)
        {
            Check.IsNotNull(patientPhoto, "patientPhoto is required.");

            DomainRuleEngine.CreateRuleEngine <Patient, PatientPhoto> (this, () => SetPrimaryPhoto)
            .WithContext(patientPhoto)
            .Execute(() => PrimaryPatientPhoto = patientPhoto);
        }
Esempio n. 7
0
        /// <summary>
        /// The revise location address.
        /// </summary>
        /// <param name="locationAddress">
        /// The location address.
        /// </param>
        public virtual void ReviseLocationAddress(LocationAddress locationAddress)
        {
            Check.IsNotNull(locationAddress, () => LocationAddress);

            DomainRuleEngine.CreateRuleEngine <Location, LocationAddress> (Location, () => ReviseLocationAddress)
            .WithContext(locationAddress)
            .WithContext(this)
            .Execute(() => { LocationAddress = locationAddress; });
        }
Esempio n. 8
0
        /// <summary>
        /// The revise name.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        public virtual void ReviseName(string name)
        {
            Check.IsNotNullOrWhitespace(name, () => Name);

            DomainRuleEngine.CreateRuleEngine <Location, string> (Location, () => ReviseName)
            .WithContext(name)
            .WithContext(this)
            .Execute(() => { Name = name; });
        }
Esempio n. 9
0
        /// <summary>
        /// Revises the activity date time range.
        /// </summary>
        /// <param name="dateTimeRange">The date time range.</param>
        public virtual void ReviseActivityDateTimeRange(DateTimeRange dateTimeRange)
        {
            Check.IsNotNull(dateTimeRange, "Activity date time range is required.");
            ActivityDateTimeRange = dateTimeRange;

            DomainRuleEngine.CreateRuleEngine <Activity, DateTimeRange>(this, () => ReviseActivityDateTimeRange)
            .WithContext(dateTimeRange)
            .Execute(() => ActivityDateTimeRange = dateTimeRange);
        }
Esempio n. 10
0
        /// <summary>
        /// Revises the clinical case profile.
        /// </summary>
        /// <param name="clinicalCaseProfile">The clinical case profile.</param>
        public virtual void ReviseClinicalCaseProfile(ClinicalCaseProfile clinicalCaseProfile)
        {
            Check.IsNotNull(clinicalCaseProfile, "Clinical Case Profile is required.");

            DomainRuleEngine.CreateRuleEngine <ClinicalCase, ClinicalCaseProfile>(this, () => ReviseClinicalCaseProfile)
            .WithContext(clinicalCaseProfile)
            .WithContext(ClinicalCaseCloseInfo)
            .Execute(() => ClinicalCaseProfile = clinicalCaseProfile);
        }
Esempio n. 11
0
        /// <summary>
        /// Revises the agency address.
        /// </summary>
        /// <param name="agencyAddress">
        /// The agency address.
        /// </param>
        public virtual void ReviseAgencyAddress(AgencyAddress agencyAddress)
        {
            Check.IsNotNull(agencyAddress, () => AgencyAddress);

            DomainRuleEngine.CreateRuleEngine <Agency, AgencyAddress> (Agency, () => ReviseAgencyAddress)
            .WithContext(agencyAddress)
            .WithContext(this)
            .Execute(() => AgencyAddress = agencyAddress);
        }
Esempio n. 12
0
 /// <summary>
 /// Revises the teds discharge key fields.
 /// </summary>
 /// <param name="tedsDischargeKeyFields">The teds discharge key fields.</param>
 public virtual void ReviseTedsDischargeKeyFields(TedsDischargeKeyFields tedsDischargeKeyFields)
 {
     Check.IsNotNull(tedsDischargeKeyFields, () => TedsDischargeKeyFields);
     DomainRuleEngine.CreateRuleEngine(tedsDischargeKeyFields)
     .WithContext(tedsDischargeKeyFields)
     .Execute(
         () =>
     {
         TedsDischargeKeyFields = tedsDischargeKeyFields;
     });
 }
Esempio n. 13
0
 /// <summary>
 /// Revises the observation info.
 /// </summary>
 /// <param name="observedBy">The observed by.</param>
 /// <param name="observedDate">The observed date.</param>
 public virtual void ReviseObservationInfo(Staff observedBy, DateTime?observedDate)
 {
     DomainRuleEngine.CreateRuleEngine(this, "ReviseObservationInfoRuleSet")
     .WithContext(observedBy)
     .WithContext(observedDate)
     .Execute(() =>
     {
         ObservedByStaff = observedBy;
         ObservedDate    = observedDate;
     });
 }
Esempio n. 14
0
        /// <summary>
        /// Revises the veteran information.
        /// </summary>
        /// <param name="veteranInformation">The veteran information.</param>
        public virtual void ReviseVeteranInformation(PatientVeteranInformation veteranInformation)
        {
            Check.IsNotNull(veteranInformation, "Patient Veteran Information is required.");

            DomainRuleEngine.CreateRuleEngine <Patient, PatientVeteranInformation>(this, () => ReviseVeteranInformation)
            .WithContext(veteranInformation)
            .Execute(() =>
            {
                VeteranInformation = veteranInformation;
            });
        }
Esempio n. 15
0
        /// <summary>
        /// Revises the last contact date.
        /// </summary>
        /// <param name="lastContactDate">The last contact date.</param>
        public virtual void ReviseLastFaceToFaceContactDate(DateTime?lastContactDate)
        {
            Check.IsNotNull(lastContactDate, () => LastFaceToFaceContactDate);

            DomainRuleEngine.CreateRuleEngine(this, "ReviseLastFaceToFaceContactDate")
            .WithContext(lastContactDate)
            .Execute(
                () =>
            {
                LastFaceToFaceContactDate = lastContactDate;
            });
        }
Esempio n. 16
0
        /// <summary>
        /// Admits the specified clinical case admission.
        /// </summary>
        /// <param name="clinicalCaseAdmission">The clinical case admission.</param>
        public virtual void Admit(ClinicalCaseAdmission clinicalCaseAdmission)
        {
            Check.IsNotNull(clinicalCaseAdmission, "Clinical Case Admission is required.");

            DomainRuleEngine.CreateRuleEngine <ClinicalCase, ClinicalCaseAdmission>(this, () => Admit)
            .WithContext(clinicalCaseAdmission)
            .Execute(() =>
            {
                //TODO: Update the ClinicalCaseStatus
                ClinicalCaseAdmission = clinicalCaseAdmission;
            });
        }
Esempio n. 17
0
        /// <summary>
        /// Discharges the specified clinical case discharge.
        /// </summary>
        /// <param name="clinicalCaseDischarge">The clinical case discharge.</param>
        public virtual void Discharge(ClinicalCaseDischarge clinicalCaseDischarge)
        {
            Check.IsNotNull(clinicalCaseDischarge, "Clinical Case Discharge is required.");

            DomainRuleEngine.CreateRuleEngine <ClinicalCase, ClinicalCaseDischarge>(this, () => Discharge)
            .WithContext(clinicalCaseDischarge)
            .Execute(() =>
            {
                //TODO: Update the ClinicalCaseStatus
                ClinicalCaseDischarge = clinicalCaseDischarge;
            });
        }
Esempio n. 18
0
        /// <summary>
        /// Closes the specified clinical case close info.
        /// </summary>
        /// <param name="clinicalCaseCloseInfo">The clinical case close info.</param>
        public virtual void Close(ClinicalCaseCloseInfo clinicalCaseCloseInfo)
        {
            Check.IsNotNull(clinicalCaseCloseInfo, "Clinical Case Close Info is required.");

            DomainRuleEngine.CreateRuleEngine <ClinicalCase, ClinicalCaseCloseInfo>(this, () => Close)
            .WithContext(clinicalCaseCloseInfo)
            .WithContext(ClinicalCaseProfile)
            .Execute(() =>
            {
                //TODO: Update the ClinicalCaseStatus
                ClinicalCaseCloseInfo = clinicalCaseCloseInfo;
            });
        }
Esempio n. 19
0
        /// <summary>
        /// Add address.
        /// </summary>
        /// <param name="address">
        /// The address.
        /// </param>
        public virtual void AddAddress(StaffAddress address)
        {
            Check.IsNotNull(address, "Address is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffAddress> (this, () => AddAddress)
            .WithContext(address)
            .Execute(() =>
            {
                address.Staff = this;
                _addresses.Add(address);
                NotifyItemAdded(() => Addresses, address);
            });
        }
Esempio n. 20
0
        /// <summary>
        /// Add phone.
        /// </summary>
        /// <param name="phone">
        /// The phone.
        /// </param>
        public virtual void AddPhone(StaffPhone phone)
        {
            Check.IsNotNull(phone, "Phone is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffPhone> (this, () => AddPhone)
            .WithContext(phone)
            .Execute(() =>
            {
                phone.Staff = this;
                _phoneNumbers.Add(phone);
                NotifyItemAdded(() => PhoneNumbers, phone);
            });
        }
Esempio n. 21
0
        /// <summary>
        /// The add email address.
        /// </summary>
        /// <param name="locationEmailAddress">
        /// The location email address.
        /// </param>
        public virtual void AddEmailAddress(LocationEmailAddress locationEmailAddress)
        {
            Check.IsNotNull(locationEmailAddress, "locationEmailAddress is required.");

            DomainRuleEngine.CreateRuleEngine <Location, LocationEmailAddress> (this, () => AddEmailAddress)
            .WithContext(locationEmailAddress)
            .Execute(() =>
            {
                locationEmailAddress.Location = this;
                _emailAddresses.Add(locationEmailAddress);
                NotifyItemAdded(() => EmailAddresses, locationEmailAddress);
            });
        }
Esempio n. 22
0
        /// <summary>
        /// The add contact.
        /// </summary>
        /// <param name="locationContact">
        /// The location contact.
        /// </param>
        public virtual void AddContact(LocationContact locationContact)
        {
            Check.IsNotNull(locationContact, "locationContact is required.");

            DomainRuleEngine.CreateRuleEngine <Location, LocationContact> (this, () => AddContact)
            .WithContext(locationContact)
            .Execute(() =>
            {
                locationContact.Location = this;
                _locationContacts.Add(locationContact);
                NotifyItemAdded(() => LocationContacts, locationContact);
            });
        }
Esempio n. 23
0
        /// <summary>
        /// The add identifier.
        /// </summary>
        /// <param name="locationIdentifier">
        /// The location identifier.
        /// </param>
        public virtual void AddIdentifier(LocationIdentifier locationIdentifier)
        {
            Check.IsNotNull(locationIdentifier, "locationIdentifier is required.");

            DomainRuleEngine.CreateRuleEngine <Location, LocationIdentifier> (this, () => AddIdentifier)
            .WithContext(locationIdentifier)
            .Execute(() =>
            {
                locationIdentifier.Location = this;
                _locationIdentifiers.Add(locationIdentifier);
                NotifyItemAdded(() => LocationIdentifiers, locationIdentifier);
            });
        }
Esempio n. 24
0
        /// <summary>
        /// The add work hour.
        /// </summary>
        /// <param name="locationWorkHour">
        /// The location work hour.
        /// </param>
        public virtual void AddWorkHour(LocationWorkHour locationWorkHour)
        {
            Check.IsNotNull(locationWorkHour, "locationWorkHour is required.");

            DomainRuleEngine.CreateRuleEngine <LocationOperationSchedule, LocationWorkHour> (this, () => AddWorkHour)
            .WithContext(locationWorkHour)
            .Execute(() =>
            {
                locationWorkHour.LocationOperationSchedule = this;
                _locationWorkHours.Add(locationWorkHour);
                NotifyItemAdded(() => LocationWorkHours, locationWorkHour);
            });
        }
Esempio n. 25
0
        /// <summary>
        /// Add college degree.
        /// </summary>
        /// <param name="collegeDegree">
        /// The college degree.
        /// </param>
        public virtual void AddCollegeDegree(StaffCollegeDegree collegeDegree)
        {
            Check.IsNotNull(collegeDegree, "CollegeDegree is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffCollegeDegree> (this, () => AddCollegeDegree)
            .WithContext(collegeDegree)
            .Execute(() =>
            {
                collegeDegree.Staff = this;
                _collegeDegrees.Add(collegeDegree);
                NotifyItemAdded(() => CollegeDegrees, collegeDegree);
            });
        }
Esempio n. 26
0
        /// <summary>
        /// The add license.
        /// </summary>
        /// <param name="license">
        /// The license.
        /// </param>
        public virtual void AddLicense(StaffLicense license)
        {
            Check.IsNotNull(license, "License is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffLicense> (this, () => AddLicense)
            .WithContext(license)
            .Execute(() =>
            {
                license.Staff = this;
                _licenses.Add(license);
                NotifyItemAdded(() => Licenses, license);
            });
        }
Esempio n. 27
0
        /// <summary>
        /// Adds the certification.
        /// </summary>
        /// <param name="certification">
        /// The certification.
        /// </param>
        public virtual void AddCertification(StaffCertification certification)
        {
            Check.IsNotNull(certification, "Certification is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffCertification> (this, () => AddCertification)
            .WithContext(certification)
            .Execute(() =>
            {
                certification.Staff = this;
                _certifications.Add(certification);
                NotifyItemAdded(() => Certifications, certification);
            });
        }
Esempio n. 28
0
        /// <summary>
        /// Adds the training course.
        /// </summary>
        /// <param name="trainingCourse">
        /// The training course.
        /// </param>
        public virtual void AddTrainingCourse(StaffTrainingCourse trainingCourse)
        {
            Check.IsNotNull(trainingCourse, "Training course is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffTrainingCourse> (this, () => AddTrainingCourse)
            .WithContext(trainingCourse)
            .Execute(() =>
            {
                trainingCourse.Staff = this;
                _trainingCourses.Add(trainingCourse);
                NotifyItemAdded(() => TrainingCourses, trainingCourse);
            });
        }
Esempio n. 29
0
        /// <summary>
        /// Add identifier.
        /// </summary>
        /// <param name="identifier">
        /// The identifier.
        /// </param>
        public virtual void AddIdentifier(StaffIdentifier identifier)
        {
            Check.IsNotNull(identifier, "Identifier is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffIdentifier> (this, () => AddIdentifier)
            .WithContext(identifier)
            .Execute(() =>
            {
                identifier.Staff = this;
                _identifiers.Add(identifier);
                NotifyItemAdded(() => Identifiers, identifier);
            });
        }
Esempio n. 30
0
        /// <summary>
        /// Adds the language.
        /// </summary>
        /// <param name="language">
        /// The language.
        /// </param>
        public virtual void AddLanguage(StaffLanguage language)
        {
            Check.IsNotNull(language, "Language is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffLanguage> (this, () => AddLanguage)
            .WithContext(language)
            .Execute(() =>
            {
                language.Staff = this;
                _languages.Add(language);
                NotifyItemAdded(() => Languages, language);
            });
        }