/**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   * self.entry->one(entry : cda::Entry | not entry.act.oclIsUndefined() and
   * entry.act.oclIsKindOf(tuberculosis::TuberculosisTherapeuticRegimenAct) and entry.typeCode =
   * vocab::x_ActRelationshipEntry::DRIV)
   *
   * @param tuberculosisPHCRTreatmentInformationSection The receiving '<em><b>PHCR Treatment
   *     Information Section</b></em>' model object.
   * @param diagnostics The chain of diagnostics to which problems are to be appended.
   * @param context The cache of context-specific information.
   *     <!-- end-model-doc -->
   * @generated
   */
  public static boolean
      validateTuberculosisPHCRTreatmentInformationSectionTuberculosisTherapeuticRegimenAct(
          TuberculosisPHCRTreatmentInformationSection tuberculosisPHCRTreatmentInformationSection,
          DiagnosticChain diagnostics,
          Map<Object, Object> context) {

    if (VALIDATE_TUBERCULOSIS_PHCR_TREATMENT_INFORMATION_SECTION_TUBERCULOSIS_THERAPEUTIC_REGIMEN_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
        == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(
          TuberculosisPackage.Literals.TUBERCULOSIS_PHCR_TREATMENT_INFORMATION_SECTION);
      try {
        VALIDATE_TUBERCULOSIS_PHCR_TREATMENT_INFORMATION_SECTION_TUBERCULOSIS_THERAPEUTIC_REGIMEN_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_TUBERCULOSIS_PHCR_TREATMENT_INFORMATION_SECTION_TUBERCULOSIS_THERAPEUTIC_REGIMEN_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(
            VALIDATE_TUBERCULOSIS_PHCR_TREATMENT_INFORMATION_SECTION_TUBERCULOSIS_THERAPEUTIC_REGIMEN_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(tuberculosisPHCRTreatmentInformationSection)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                TuberculosisValidator.DIAGNOSTIC_SOURCE,
                TuberculosisValidator
                    .TUBERCULOSIS_PHCR_TREATMENT_INFORMATION_SECTION__TUBERCULOSIS_PHCR_TREATMENT_INFORMATION_SECTION_TUBERCULOSIS_THERAPEUTIC_REGIMEN_ACT,
                TuberculosisPlugin.INSTANCE.getString(
                    "TuberculosisPHCRTreatmentInformationSectionTuberculosisTherapeuticRegimenAct"),
                new Object[] {tuberculosisPHCRTreatmentInformationSection}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   * self.entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and
   * entry.observation.oclIsKindOf(tuberculosis::TuberculosisResultObservation) and entry.typeCode =
   * vocab::x_ActRelationshipEntry::DRIV)
   *
   * @param tuberculosisPHCRRelevantDxTestsSection The receiving '<em><b>PHCR Relevant Dx Tests
   *     Section</b></em>' model object.
   * @param diagnostics The chain of diagnostics to which problems are to be appended.
   * @param context The cache of context-specific information.
   *     <!-- end-model-doc -->
   * @generated
   */
  public static boolean validateTuberculosisPHCRRelevantDxTestsSectionTuberculosisResultObservation(
      TuberculosisPHCRRelevantDxTestsSection tuberculosisPHCRRelevantDxTestsSection,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_TUBERCULOSIS_PHCR_RELEVANT_DX_TESTS_SECTION_TUBERCULOSIS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
        == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(TuberculosisPackage.Literals.TUBERCULOSIS_PHCR_RELEVANT_DX_TESTS_SECTION);
      try {
        VALIDATE_TUBERCULOSIS_PHCR_RELEVANT_DX_TESTS_SECTION_TUBERCULOSIS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_TUBERCULOSIS_PHCR_RELEVANT_DX_TESTS_SECTION_TUBERCULOSIS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(
            VALIDATE_TUBERCULOSIS_PHCR_RELEVANT_DX_TESTS_SECTION_TUBERCULOSIS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(tuberculosisPHCRRelevantDxTestsSection)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.WARNING,
                TuberculosisValidator.DIAGNOSTIC_SOURCE,
                TuberculosisValidator
                    .TUBERCULOSIS_PHCR_RELEVANT_DX_TESTS_SECTION__TUBERCULOSIS_PHCR_RELEVANT_DX_TESTS_SECTION_TUBERCULOSIS_RESULT_OBSERVATION,
                TuberculosisPlugin.INSTANCE.getString(
                    "TuberculosisPHCRRelevantDxTestsSectionTuberculosisResultObservation"),
                new Object[] {tuberculosisPHCRRelevantDxTestsSection}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   * (self.statusCode.oclIsUndefined() or self.statusCode.isNullFlavorUndefined()) implies (not
   * self.statusCode.oclIsUndefined() and self.statusCode.oclIsKindOf(datatypes::CS) and let value :
   * datatypes::CS = self.statusCode.oclAsType(datatypes::CS) in value.code = 'completed')
   *
   * @param tuberculosisPossibleExposureLocationAct The receiving '<em><b>Possible Exposure Location
   *     Act</b></em>' model object.
   * @param diagnostics The chain of diagnostics to which problems are to be appended.
   * @param context The cache of context-specific information.
   *     <!-- end-model-doc -->
   * @generated
   */
  public static boolean validateTuberculosisPossibleExposureLocationActStatusCode(
      TuberculosisPossibleExposureLocationAct tuberculosisPossibleExposureLocationAct,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_TUBERCULOSIS_POSSIBLE_EXPOSURE_LOCATION_ACT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
        == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(TuberculosisPackage.Literals.TUBERCULOSIS_POSSIBLE_EXPOSURE_LOCATION_ACT);
      try {
        VALIDATE_TUBERCULOSIS_POSSIBLE_EXPOSURE_LOCATION_ACT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_TUBERCULOSIS_POSSIBLE_EXPOSURE_LOCATION_ACT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(
            VALIDATE_TUBERCULOSIS_POSSIBLE_EXPOSURE_LOCATION_ACT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(tuberculosisPossibleExposureLocationAct)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                TuberculosisValidator.DIAGNOSTIC_SOURCE,
                TuberculosisValidator
                    .TUBERCULOSIS_POSSIBLE_EXPOSURE_LOCATION_ACT__TUBERCULOSIS_POSSIBLE_EXPOSURE_LOCATION_ACT_STATUS_CODE,
                TuberculosisPlugin.INSTANCE.getString(
                    "TuberculosisPossibleExposureLocationActStatusCode"),
                new Object[] {tuberculosisPossibleExposureLocationAct}));
      }

      return false;
    }
    return true;
  }