/// <summary>
        /// Initializes a new instance of the <see cref="TedsInterviewCoreKeyFields"/> class.
        /// </summary>
        /// <param name="systemDataSet">The system data set.</param>
        /// <param name="providerIdentifier">The provider identifier.</param>
        /// <param name="clientIdentifier">The client identifier.</param>
        /// <param name="coDependentIndicator">If set to <c>true</c> [co dependent indicator].</param>
        /// <param name="tedsServiceType">Type of the teds service.</param>
        protected internal TedsInterviewCoreKeyFields(
            SystemDataSet systemDataSet,
            TedsIdentifier providerIdentifier,
            TedsIdentifier clientIdentifier,
            bool coDependentIndicator,
            TedsAnswer <TedsServiceType> tedsServiceType)
        {
            Check.IsNotNull(systemDataSet, () => SystemDataSet);
            Check.IsNotNull(providerIdentifier, () => ProviderIdentifier);
            Check.IsNotNull(clientIdentifier, () => ClientIdentifier);
            Check.IsNotNull(tedsServiceType, () => TedsServiceType);

            CheckIfTedsAnswerHasInvalidNonResponse(tedsServiceType, () => this.TedsServiceType, "type of services");

            if (!coDependentIndicator && !tedsServiceType.HasResponse &&
                tedsServiceType.TedsNonResponse.WellKnownName == WellKnownNames.TedsModule.TedsNonResponse.NotApplicable)
            {
                throw new ArgumentException("Use not applicable for type of services only for co-dependents/collateral clients.");
            }

            SystemDataSet        = systemDataSet;
            ProviderIdentifier   = providerIdentifier;
            ClientIdentifier     = clientIdentifier;
            CoDependentIndicator = coDependentIndicator;
            TedsServiceType      = tedsServiceType;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SubstanceUsageAtAdmission"/> class.
        /// </summary>
        /// <param name="substanceProblemAndFrequency">The substance problem and frequency.</param>
        /// <param name="usualAdministrationRouteType">Type of the usual route of administration.</param>
        /// <param name="firstUseAge">The first use age.</param>
        /// <param name="detailedDrugCode">The detailed drug code.</param>
        public SubstanceUsageAtAdmission(SubstanceProblemAndFrequency substanceProblemAndFrequency,
                                         TedsAnswer <UsualAdministrationRouteType> usualAdministrationRouteType,
                                         TedsAnswer <int?> firstUseAge,
                                         TedsAnswer <DetailedDrugCode> detailedDrugCode)
        {
            Check.IsNotNull(substanceProblemAndFrequency, () => SubstanceProblemAndFrequency);
            SubstanceProblemAndFrequency = substanceProblemAndFrequency;

            CheckIfTedsAnswerHasInvalidNonResponse(usualAdministrationRouteType, () => this.UsualAdministrationRouteType, "usual route of administration");
            UsualAdministrationRouteType = usualAdministrationRouteType;

            CheckIfTedsAnswerHasInvalidNonResponse(firstUseAge, () => this.FirstUseAge, "age of first use");
            FirstUseAge = firstUseAge;

            CheckIfTedsAnswerHasInvalidNonResponse(detailedDrugCode, () => this.DetailedDrugCode, "detailed drug code");
            DetailedDrugCode = detailedDrugCode;

            // Note: two-digit substance problem code forms the first two digits of its associated detailed drug code
            if (substanceProblemAndFrequency.SubstanceProblemType.HasResponse && detailedDrugCode != null && detailedDrugCode.HasResponse)
            {
                if (detailedDrugCode.Response.SubstanceProblemType.Key != substanceProblemAndFrequency.SubstanceProblemType.Response.Key)
                {
                    throw new ArgumentException("The detailed drug code is not associated with the substance problem code.");
                }
            }
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SubstanceProblemAndFrequency"/> class.
        /// </summary>
        /// <param name="substanceProblemType">Type of the substance problem.</param>
        /// <param name="frequencyOfUseType">Type of the frequency of use.</param>
        public SubstanceProblemAndFrequency(TedsAnswer <SubstanceProblemType> substanceProblemType, TedsAnswer <UseFrequencyType> frequencyOfUseType)
        {
            Check.IsNotNull(substanceProblemType, () => SubstanceProblemType);

            CheckIfTedsAnswerHasInvalidNonResponse(substanceProblemType, () => this.SubstanceProblemType, "substance problem code");
            SubstanceProblemType = substanceProblemType;

            CheckIfTedsAnswerHasInvalidNonResponse(frequencyOfUseType, () => this.UseFrequencyType, "frequency of use");
            UseFrequencyType = frequencyOfUseType;
        }
 private void CheckIfTedsAnswerHasInvalidNonResponse <T>(TedsAnswer <T> tedsAnswer, Expression <Func <TedsAnswer <T> > > propertyExpression, string tedsQuestion)
 {
     if (tedsAnswer != null &&
         !tedsAnswer.HasResponse &&
         !GetNonResponseLookupWellKnownNames(propertyExpression).ToList().Contains(tedsAnswer.TedsNonResponse.WellKnownName)
         )
     {
         throw new ArgumentException(
                   string.Format("{0} has invalid non-reponse.", tedsQuestion.Substring(0, 1).ToUpper() + tedsQuestion.Substring(1)));
     }
 }
Example #5
0
        bool IEquatable <TedsAnswer <T> > .Equals(TedsAnswer <T> other)
        {
            if (GetType() != other.GetType())
            {
                return(false);
            }

            if (Equals(Response, other.Response) && Equals(TedsNonResponse, other.TedsNonResponse))
            {
                return(true);
            }

            return(false);
        }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TedsDischargeKeyFields"/> class.
 /// </summary>
 /// <param name="systemDataSet">The system data set.</param>
 /// <param name="providerIdentifier">The provider identifier.</param>
 /// <param name="clientIdentifier">The client identifier.</param>
 /// <param name="coDependentIndicator">If set to <c>true</c> [co dependent indicator].</param>
 /// <param name="clientTransactionType">Type of the client transaction.</param>
 /// <param name="admissionDate">The admission date.</param>
 /// <param name="tedsServiceType">Type of the teds service.</param>
 public TedsDischargeKeyFields(
     SystemDataSet systemDataSet,
     TedsIdentifier providerIdentifier,
     TedsIdentifier clientIdentifier,
     bool coDependentIndicator,
     ClientTransactionType clientTransactionType,
     DateTime admissionDate,
     TedsAnswer <TedsServiceType> tedsServiceType)
     :
     base(systemDataSet,
          providerIdentifier,
          clientIdentifier,
          coDependentIndicator,
          tedsServiceType)
 {
     DischargeDate = admissionDate;
 }
Example #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TedsGenderInformation"/> class.
        /// </summary>
        /// <param name="tedsGender">The teds gender.</param>
        /// <param name="pregnantIndicator">The pregnant indicator.</param>
        public TedsGenderInformation(TedsAnswer <TedsGender> tedsGender, TedsAnswer <bool?> pregnantIndicator)
        {
            Check.IsNotNull(tedsGender, () => TedsGender);

            CheckIfTedsAnswerHasInvalidNonResponse(tedsGender, () => this.TedsGender, "Gender");
            TedsGender = tedsGender;

            CheckIfTedsAnswerHasInvalidNonResponse(pregnantIndicator, () => this.PregnantIndicator, "pregnant at time of admission");
            PregnantIndicator = pregnantIndicator;

            // If the value the value in MDS 9 is not "2" (Female), this field is set to 6 (Not applicable).
            if (!(tedsGender.HasResponse && tedsGender.Response.WellKnownName == WellKnownNames.TedsModule.TedsGender.Female))
            {
                if (pregnantIndicator != null && (pregnantIndicator.HasResponse || (!pregnantIndicator.HasResponse && pregnantIndicator.TedsNonResponse.WellKnownName != WellKnownNames.TedsModule.TedsNonResponse.NotApplicable)))
                {
                    throw new ArgumentException("For non-female client, pregnant information should be coded as Not Applicable.");
                }
            }
        }
Example #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TedsAdmissionKeyFields"/> class.
        /// </summary>
        /// <param name="systemDataSet">The system data set.</param>
        /// <param name="providerIdentifier">The provider identifier.</param>
        /// <param name="clientIdentifier">The client identifier.</param>
        /// <param name="coDependentIndicator">If set to <c>true</c> [co dependent indicator].</param>
        /// <param name="tedsServiceType">Type of the teds service.</param>
        /// <param name="clientTransactionType">Type of the client transaction.</param>
        /// <param name="admissionDate">The admission date.</param>
        public TedsAdmissionKeyFields(
            SystemDataSet systemDataSet,
            TedsIdentifier providerIdentifier,
            TedsIdentifier clientIdentifier,
            bool coDependentIndicator,
            TedsAnswer <TedsServiceType> tedsServiceType,
            ClientTransactionType clientTransactionType,
            DateTime admissionDate)
            :
            base(systemDataSet,
                 providerIdentifier,
                 clientIdentifier,
                 coDependentIndicator,
                 tedsServiceType)
        {
            Check.IsNotNull(clientTransactionType, () => ClientTransactionType);

            ClientTransactionType = clientTransactionType;
            AdmissionDate         = admissionDate;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TedsEmploymentStatusInformation"/> class.
        /// </summary>
        /// <param name="tedsEmploymentStatus">The teds employment status.</param>
        /// <param name="detailedNotInLaborForce">The detailed not in labor force.</param>
        public TedsEmploymentStatusInformation(TedsAnswer <TedsEmploymentStatus> tedsEmploymentStatus, TedsAnswer <DetailedNotInLaborForce> detailedNotInLaborForce)
        {
            Check.IsNotNull(tedsEmploymentStatus, () => TedsEmploymentStatus);

            CheckIfTedsAnswerHasInvalidNonResponse(tedsEmploymentStatus, () => this.TedsEmploymentStatus, "employment status");
            TedsEmploymentStatus = tedsEmploymentStatus;

            CheckIfTedsAnswerHasInvalidNonResponse(detailedNotInLaborForce, () => this.DetailedNotInLaborForce, "detailed not in labor force");
            DetailedNotInLaborForce = detailedNotInLaborForce;

            // MDS 13 - EMPLOYMENT STATUS
            // SuDs12 - DETAILED NOT IN LABOR FORCE
            // SuDs12 - Not Applicable (96) Use this code if Employment Status (MDS 13) is coded 01, 02, 03, or 97.
            if (!(tedsEmploymentStatus.HasResponse && tedsEmploymentStatus.Response.WellKnownName == WellKnownNames.TedsModule.TedsEmploymentStatus.NotInLaborForce))
            {
                if (detailedNotInLaborForce != null && (detailedNotInLaborForce.HasResponse || (!detailedNotInLaborForce.HasResponse && detailedNotInLaborForce.TedsNonResponse.WellKnownName != WellKnownNames.TedsModule.TedsNonResponse.NotApplicable)))
                {
                    throw new ArgumentException("Detailed not in labor force information should be coded as not applicable if employment status information is coded as full time, part time, unemployed, or unknown.");
                }
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PrincipalReferralSourceInformation"/> class.
        /// </summary>
        /// <param name="principalReferralSourceType">Type of the principal source of referral.</param>
        /// <param name="detailedCriminalJusticeReferral">The detailed criminal justice referral.</param>
        public PrincipalReferralSourceInformation(TedsAnswer <PrincipalReferralSourceType> principalReferralSourceType, TedsAnswer <DetailedCriminalJusticeReferral> detailedCriminalJusticeReferral)
        {
            Check.IsNotNull(principalReferralSourceType, () => PrincipalReferralSourceType);

            CheckIfTedsAnswerHasInvalidNonResponse(principalReferralSourceType, () => this.PrincipalReferralSourceType, "Principal source of referral");
            PrincipalReferralSourceType = principalReferralSourceType;

            CheckIfTedsAnswerHasInvalidNonResponse(detailedCriminalJusticeReferral, () => this.DetailedCriminalJusticeReferral, "detailed criminal justice referral");
            DetailedCriminalJusticeReferral = detailedCriminalJusticeReferral;

            // MDS 7 - PRINCIPAL SOURCE OF REFERRAL
            // SuDs 13 - DETAILED CRIMINAL JUSTICE REFERRAL
            // SuDs 13 - This field is to be used only when Principal Source of Referral (MDS 7) is coded
            // 07 “Criminal Justice Referral." For all other Principal Source of Referral codes
            // (01 through 06 and 97), this field should be coded 96 (Not Applicable).
            if (!(principalReferralSourceType.HasResponse && principalReferralSourceType.Response.WellKnownName == WellKnownNames.TedsModule.PrincipalReferralSourceType.CriminalJusticeReferral))
            {
                if (detailedCriminalJusticeReferral.HasResponse || (!detailedCriminalJusticeReferral.HasResponse && detailedCriminalJusticeReferral.TedsNonResponse.WellKnownName != WellKnownNames.TedsModule.TedsNonResponse.NotApplicable))
                {
                    throw new ArgumentException("For all Principal Source of Referral codes other than Court/Criminal Justice Referral/DUI/DWI, Detailed criminal justice referral should be coded as Not Applicable.");
                }
            }
        }
Example #11
0
 /// <summary>
 /// Revises the arrests in thirty days number.
 /// </summary>
 /// <param name="arrestsInThirtyDaysNumber">The arrests in thirty days number.</param>
 public virtual void ReviseArrestsInThirtyDaysNumber(TedsAnswer <int?> arrestsInThirtyDaysNumber)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(arrestsInThirtyDaysNumber, () => ArrestsInPastThirtyDaysCount, "Number of Arrests in Past Thirty Days");
     ArrestsInPastThirtyDaysCount = arrestsInThirtyDaysNumber;
 }
Example #12
0
 /// <summary>
 /// Revises the teds discharge reason.
 /// </summary>
 /// <param name="tedsDischargeReason">The teds discharge reason.</param>
 public virtual void ReviseTedsDischargeReason(TedsAnswer <TedsDischargeReason> tedsDischargeReason)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(tedsDischargeReason, () => TedsDischargeReason, "Discharge reason");
     TedsDischargeReason = tedsDischargeReason;
 }
Example #13
0
 /// <summary>
 /// Revises the type of the living arrangements.
 /// </summary>
 /// <param name="livingArrangementsType">Type of the living arrangements.</param>
 public virtual void ReviseLivingArrangementsType(TedsAnswer <LivingArrangementsType> livingArrangementsType)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(livingArrangementsType, () => LivingArrangementsType, "Living arrangement type");
     LivingArrangementsType = livingArrangementsType;
 }
Example #14
0
        /// <summary>
        /// Revises the teds ethnicity.
        /// </summary>
        /// <param name="tedsEthnicity">The teds ethnicity.</param>
        public virtual void ReviseTedsEthnicity(TedsAnswer <TedsEthnicity> tedsEthnicity)
        {
            CheckIfTedsAnswerHasInvalidNonResponse(tedsEthnicity, () => this.TedsEthnicity, "Ethnicity");

            TedsEthnicity = tedsEthnicity;
        }
Example #15
0
        /// <summary>
        /// Revises the teds race.
        /// </summary>
        /// <param name="tedsRace">The teds race.</param>
        public virtual void ReviseTedsRace(TedsAnswer <TedsRace> tedsRace)
        {
            CheckIfTedsAnswerHasInvalidNonResponse(tedsRace, () => this.TedsRace, "race");

            TedsRace = tedsRace;
        }
Example #16
0
 /// <summary>
 /// Revises the type of the participated self help group in past thirty days.
 /// </summary>
 /// <param name="participatedSelfHelpGroupInPastThirtyDaysType">Type of the participated self help group in past thirty days.</param>
 public virtual void ReviseParticipatedSelfHelpGroupInPastThirtyDaysType(TedsAnswer <ParticipatedSelfHelpGroupInPastThirtyDaysType> participatedSelfHelpGroupInPastThirtyDaysType)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(participatedSelfHelpGroupInPastThirtyDaysType, () => this.ParticipatedSelfHelpGroupInPastThirtyDaysType, "frequency of attendance at self-help programs (e.g., AA, NA, etc.) in 30 days prior to admission");
     ParticipatedSelfHelpGroupInPastThirtyDaysType = participatedSelfHelpGroupInPastThirtyDaysType;
 }
Example #17
0
 /// <summary>
 /// Revises the teds education year count.
 /// </summary>
 /// <param name="tedsEducationYearCount">The teds education year count.</param>
 public virtual void ReviseTedsEducationYearCount(TedsAnswer <int?> tedsEducationYearCount)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(tedsEducationYearCount, () => this.TedsEducationYearCount, "Education");
     TedsEducationYearCount = tedsEducationYearCount;
 }
Example #18
0
        /// <summary>
        /// Revises the prior treatment episodes count.
        /// </summary>
        /// <param name="priorTreatmentEpisodesCount">The prior treatment episodes count.</param>
        public virtual void RevisePriorTreatmentEpisodesCount(TedsAnswer <int?> priorTreatmentEpisodesCount)
        {
            CheckIfTedsAnswerHasInvalidNonResponse(priorTreatmentEpisodesCount, () => this.PriorTreatmentEpisodesCount, "Number of prior treatment episodes");

            PriorTreatmentEpisodesCount = priorTreatmentEpisodesCount;
        }
Example #19
0
 /// <summary>
 /// Revises the arrests in past thirty days count.
 /// </summary>
 /// <param name="arrestsInThirtyDaysCount">The arrests in thirty days count.</param>
 public virtual void ReviseArrestsInPastThirtyDaysCount(TedsAnswer <int?> arrestsInThirtyDaysCount)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(arrestsInThirtyDaysCount, () => this.ArrestsInPastThirtyDaysCount, "number of arrests in 30 days prior to admission");
     ArrestsInPastThirtyDaysCount = arrestsInThirtyDaysCount;
 }
Example #20
0
 /// <summary>
 /// Revises the type of the frequency of attendance at self help programs.
 /// </summary>
 /// <param name="frequencyOfAttendanceAtSelfHelpProgramsType">Type of the frequency of attendance at self help programs.</param>
 public virtual void ReviseFrequencyOfAttendanceAtSelfHelpProgramsType(TedsAnswer <ParticipatedSelfHelpGroupInPastThirtyDaysType> frequencyOfAttendanceAtSelfHelpProgramsType)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(frequencyOfAttendanceAtSelfHelpProgramsType, () => ParticipatedSelfHelpGroupInPastThirtyDaysType, "Frequency of attendance at self help programs");
     ParticipatedSelfHelpGroupInPastThirtyDaysType = frequencyOfAttendanceAtSelfHelpProgramsType;
 }
Example #21
0
 /// <summary>
 /// Revises the medication assisted opioid therapy indicator.
 /// </summary>
 /// <param name="medicationAssistedOpioidTherapyIndicator">The medication assisted opioid therapy indicator.</param>
 public virtual void ReviseMedicationAssistedOpioidTherapyIndicator(TedsAnswer <bool?> medicationAssistedOpioidTherapyIndicator)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(medicationAssistedOpioidTherapyIndicator, () => this.MedicationAssistedOpioidTherapyIndicator, "medication-assisted opioid therapy");
     MedicationAssistedOpioidTherapyIndicator = medicationAssistedOpioidTherapyIndicator;
 }
Example #22
0
 /// <summary>
 /// Revises the veteran status indicator.
 /// </summary>
 /// <param name="veteranStatusIndicator">The veteran status indicator.</param>
 public virtual void ReviseVeteranStatusIndicator(TedsAnswer <bool?> veteranStatusIndicator)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(veteranStatusIndicator, () => this.VeteranStatusIndicator, "veteran status");
     VeteranStatusIndicator = veteranStatusIndicator;
 }
Example #23
0
 /// <summary>
 /// Revises the other psychiatric problem indicator.
 /// </summary>
 /// <param name="otherPsychiatricProblemIndicator">The other psychiatric problem indicator.</param>
 public virtual void ReviseOtherPsychiatricProblemIndicator(TedsAnswer <bool?> otherPsychiatricProblemIndicator)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(otherPsychiatricProblemIndicator, () => this.OtherPsychiatricProblemIndicator, "psychiatric problem in addition to alcohol or drug problem");
     OtherPsychiatricProblemIndicator = otherPsychiatricProblemIndicator;
 }
Example #24
0
 /// <summary>
 /// Revises the DSM diagnosis.
 /// </summary>
 /// <param name="dsmDiagnosis">The DSM diagnosis.</param>
 public virtual void ReviseDsmDiagnosis(TedsAnswer <DsmDiagnosisResponse> dsmDiagnosis)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(dsmDiagnosis, () => this.DsmDiagnosis, "DSM diagnosis");
     DsmDiagnosis = dsmDiagnosis;
 }
Example #25
0
 /// <summary>
 /// Revises the type of the income source.
 /// </summary>
 /// <param name="incomeSourceType">Type of the income source.</param>
 public virtual void ReviseIncomeSourceType(TedsAnswer <IncomeSourceType> incomeSourceType)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(incomeSourceType, () => this.IncomeSourceType, "source of income/support");
     IncomeSourceType = incomeSourceType;
 }
Example #26
0
 /// <summary>
 /// Revises the teds martial status.
 /// </summary>
 /// <param name="maritalStatus">The teds martial status.</param>
 public virtual void ReviseTedsMartialStatus(TedsAnswer <MaritalStatus> maritalStatus)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(maritalStatus, () => this.MaritalStatus, "marital status");
     MaritalStatus = maritalStatus;
 }
Example #27
0
 /// <summary>
 /// Revises the type of the primary source of payment.
 /// </summary>
 /// <param name="primaryPaymentSourceType">Type of the primary source of payment.</param>
 public virtual void RevisePrimaryPaymentSourceType(TedsAnswer <PrimaryPaymentSourceType> primaryPaymentSourceType)
 {
     CheckIfTedsAnswerHasInvalidNonResponse(primaryPaymentSourceType, () => this.PrimaryPaymentSourceType, "expected/actual primary source of payment");
     PrimaryPaymentSourceType = primaryPaymentSourceType;
 }
Example #28
0
 /// <summary>
 /// Revises the arrests in past thirty days count.
 /// </summary>
 /// <param name="arrestsInPastThirtyDaysCount">The arrests in past thirty days count.</param>
 public virtual void ReviseArrestsInPastThirtyDaysCount(TedsAnswer <int?> arrestsInPastThirtyDaysCount)
 {
     ArrestsInPastThirtyDaysCount = arrestsInPastThirtyDaysCount;
 }