/// <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 AuditC. /// </summary> /// <param name="socialHistoryAuditC">The social history audit C.</param> public virtual void ReviseSocialHistoryAuditC( SocialHistoryAuditC socialHistoryAuditC ) { Check.IsNotNull ( socialHistoryAuditC, "socialHistoryAuditC is required." ); _socialHistoryAuditC = socialHistoryAuditC; if ( _socialHistoryAuditC.IsAuditCThresholdSatisfied) { ScheduleActivity(WellKnownNames.VisitModule.ActivityType.AuditC); } }