/// <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 PHQ2. /// </summary> /// <param name="socialHistoryPhq2">The social history PHQ2.</param> public virtual void ReviseSocialHistoryPhq2( SocialHistoryPhq2 socialHistoryPhq2 ) { Check.IsNotNull ( socialHistoryPhq2, "socialHistoryPhq2 is required." ); _socialHistoryPhq2 = socialHistoryPhq2; if (_socialHistoryPhq2.IsPhq9ThresholdSatisfied) { ScheduleActivity ( WellKnownNames.VisitModule.ActivityType.Phq9 ); } }