/// <summary> /// Processes the single aggregate. /// </summary> /// <param name="socialHistoryDto">The social history dto.</param> /// <param name="socialHistory">The social history.</param> /// <returns>A <see cref="System.Boolean"/></returns> protected override bool ProcessSingleAggregate(SocialHistoryDto socialHistoryDto, SocialHistory socialHistory) { // register for various 'created' events DomainEvent.Register <Phq9CreatedEvent> (e => _isPhq9Created = true); DomainEvent.Register <AuditCCreatedEvent> (e => _isAuditCCreated = true); DomainEvent.Register <Dast10CreatedEvent> (e => _isDast10Created = true); var socialHistoryPhq2 = new SocialHistoryPhq2( socialHistoryDto.Phq2LittleInterestInDoingThingsAnswerNumber, socialHistoryDto.Phq2FeelingDownAnswerNumber, socialHistoryDto.Phq2Score); socialHistory.ReviseSocialHistoryPhq2(socialHistoryPhq2); var socialHistoryAuditC = new SocialHistoryAuditC( socialHistoryDto.AuditCDrinkBeerWineOrOtherAlcoholicBeveragesIndicator); socialHistory.ReviseSocialHistoryAuditC(socialHistoryAuditC); var socialHistoryDast10 = new SocialHistoryDast10( socialHistoryDto.Dast10TimesPastYearUsedIllegalDrugOrPrescriptionMedicationForNonMedicalReasonsNumber); socialHistory.ReviseSocialHistoryDast10(socialHistoryDast10); var smokingStatus = _mappingHelper.MapLookupField <SmokingStatus> (socialHistoryDto.SmokingStatus); var socialHistorySmoking = new SocialHistorySmoking( smokingStatus, socialHistoryDto.SmokingStatusAreYouWillingToQuitIndicator, socialHistoryDto.SmokingStatusAreYouWillingToQuitDate); socialHistory.ReviseSocialHistorySmoking(socialHistorySmoking); return(true); }
/// <summary> /// Revises the social history dast10. /// </summary> /// <param name="socialHistoryDast10">The social history dast10.</param> public virtual void ReviseSocialHistoryDast10( SocialHistoryDast10 socialHistoryDast10 ) { Check.IsNotNull ( socialHistoryDast10, "socialHistoryDast10 is required." ); _socialHistoryDast10 = socialHistoryDast10; if ( _socialHistoryDast10.IsDast10ThresholdSatisfied ) { ScheduleActivity(WellKnownNames.VisitModule.ActivityType.Dast10); } }