/// <summary> /// Destroys the Teds interview. /// </summary> /// <param name="tedsDischargeInterview">The Teds interview.</param> public void DestroyTedsDischargeInterview(TedsDischargeInterview tedsDischargeInterview) { Check.IsNotNull(tedsDischargeInterview, "TedsDischargeInterview is required."); _tedsDischargeInterviewRepository.MakeTransient(tedsDischargeInterview); }
/// <summary> /// Creates the Teds interview. /// </summary> /// <param name="visit">The visit.</param> /// <returns>A TedsDischargeInterview.</returns> public TedsDischargeInterview CreateTedsDischargeInterview(Visit visit) { var activityType = _lookupValueRepository.GetLookupByWellKnownName<ActivityType> ( WellKnownNames.VisitModule.ActivityType.TedsDischargeInterview ); var tedsDischargeInterview = new TedsDischargeInterview ( visit, activityType ); tedsDischargeInterview.ReviseTedsAdmissionInterview ( GetTedsAdmissionInterview ( visit.Key ) ); _tedsDischargeInterviewRepository.MakePersistent ( tedsDischargeInterview ); return tedsDischargeInterview; }
/// <summary> /// Processes the single aggregate. /// </summary> /// <param name="dto">The teds discharge interview dto.</param> /// <param name="tedsDischargeInterview">The teds discharge interview.</param> /// <returns>A <see cref="System.Boolean"/></returns> protected override bool ProcessSingleAggregate(TedsDischargeInterviewDto dto, TedsDischargeInterview tedsDischargeInterview) { tedsDischargeInterview.ReviseLastFaceToFaceContactDate(dto.LastFaceToFaceContactDate); tedsDischargeInterview.ReviseTedsDischargeReason( TedsAnswerMapper.MapToTedsAnswer <TedsDischargeReason, TedsLookupBaseDto>(dto.TedsDischargeReason, _mappingHelper)); var primarySubstance = CreateSubstanceUsage(dto.PrimarySubstanceProblemType, dto.PrimaryUseFrequencyType); var secondarySubstance = CreateSubstanceUsage(dto.SecondarySubstanceProblemType, dto.SecondaryUseFrequencyType); var tertiarySubstance = CreateSubstanceUsage(dto.TertiarySubstanceProblemType, dto.TertiaryUseFrequencyType); tedsDischargeInterview.ReviseTedsDischargeInterviewSubstanceUsages(primarySubstance, secondarySubstance, tertiarySubstance); tedsDischargeInterview.ReviseLivingArrangementsType( TedsAnswerMapper.MapToTedsAnswer <LivingArrangementsType, TedsLookupBaseDto>(dto.LivingArrangementsType, _mappingHelper)); var employmentStatusInformation = CreateTedsEmploymentStatusInformation(dto); tedsDischargeInterview.ReviseTedsEmploymentStatusInformation(employmentStatusInformation); tedsDischargeInterview.ReviseArrestsInThirtyDaysNumber( TedsAnswerMapper.MapToTedsAnswer <int?>(dto.ArrestsInPastThirtyDaysCount, _mappingHelper)); tedsDischargeInterview.ReviseFrequencyOfAttendanceAtSelfHelpProgramsType( TedsAnswerMapper.MapToTedsAnswer <ParticipatedSelfHelpGroupInPastThirtyDaysType, TedsLookupBaseDto>(dto.ParticipatedSelfHelpGroupInPastThirtyDaysType, _mappingHelper)); return(true); }