/**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param infantTransfer The receiving '<em><b>Infant Transfer</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 validateInfantTransferParticipant(
      InfantTransfer infantTransfer, DiagnosticChain diagnostics, Map<Object, Object> context) {

    if (VALIDATE_INFANT_TRANSFER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(VsbrPackage.Literals.INFANT_TRANSFER);
      try {
        VALIDATE_INFANT_TRANSFER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_INFANT_TRANSFER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_INFANT_TRANSFER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(infantTransfer)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.INFO,
                VsbrValidator.DIAGNOSTIC_SOURCE,
                VsbrValidator.INFANT_TRANSFER__INFANT_TRANSFER_PARTICIPANT,
                VsbrPlugin.INSTANCE.getString("InfantTransferParticipant"),
                new Object[] {infantTransfer}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param reasonForVisitSection The receiving '<em><b>Reason For Visit 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 validateReasonForVisitSectionTitle(
      ReasonForVisitSection reasonForVisitSection,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_REASON_FOR_VISIT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(ConsolPackage.Literals.REASON_FOR_VISIT_SECTION);
      try {
        VALIDATE_REASON_FOR_VISIT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_REASON_FOR_VISIT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_REASON_FOR_VISIT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(reasonForVisitSection)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                ConsolValidator.DIAGNOSTIC_SOURCE,
                ConsolValidator.REASON_FOR_VISIT_SECTION__REASON_FOR_VISIT_SECTION_TITLE,
                ConsolPlugin.INSTANCE.getString("ReasonForVisitSectionTitle"),
                new Object[] {reasonForVisitSection}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param patientOnAnticoagulants The receiving '<em><b>Patient On Anticoagulants</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 validatePatientOnAnticoagulantsValue(
      PatientOnAnticoagulants patientOnAnticoagulants,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_PATIENT_ON_ANTICOAGULANTS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(EmspcrPackage.Literals.PATIENT_ON_ANTICOAGULANTS);
      try {
        VALIDATE_PATIENT_ON_ANTICOAGULANTS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_PATIENT_ON_ANTICOAGULANTS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_PATIENT_ON_ANTICOAGULANTS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(patientOnAnticoagulants)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                EmspcrValidator.DIAGNOSTIC_SOURCE,
                EmspcrValidator.PATIENT_ON_ANTICOAGULANTS__PATIENT_ON_ANTICOAGULANTS_VALUE,
                EmspcrPlugin.INSTANCE.getString("PatientOnAnticoagulantsValue"),
                new Object[] {patientOnAnticoagulants}));
      }

      return false;
    }
    return true;
  }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  * self.value->size() = 1 and self.value->forAll(element | not element.oclIsUndefined() and
  * element.oclIsKindOf(datatypes::CD) and let value : datatypes::CD =
  * element.oclAsType(datatypes::CD) in value.codeSystem = '2.16.840.1.113883.5.1063' and
  * (value.code = 'H' or value.code = 'M' or value.code = 'L'))
  *
  * @param severity The receiving '<em><b>Severity</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 validateSeverityObservationValue(
     Severity severity, DiagnosticChain diagnostics, Map<Object, Object> context) {
   if (VALIDATE_SEVERITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setContext(IHEPackage.Literals.SEVERITY);
     try {
       VALIDATE_SEVERITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
           helper.createInvariant(
               VALIDATE_SEVERITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   if (!EOCL_ENV
       .createQuery(VALIDATE_SEVERITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
       .check(severity)) {
     if (diagnostics != null) {
       diagnostics.add(
           new BasicDiagnostic(
               Diagnostic.ERROR,
               IHEValidator.DIAGNOSTIC_SOURCE,
               IHEValidator.SEVERITY__SEVERITY_OBSERVATION_VALUE,
               IHEPlugin.INSTANCE.getString("SeverityObservationValue"),
               new Object[] {severity}));
     }
     return false;
   }
   return true;
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  * self.getObservations()->select(observation : cda::Observation | not
  * observation.oclIsUndefined() and
  * observation.oclIsKindOf(cocci::CoccidioidesImmunosuppressedMedicalConditionHistoryObservation)).oclAsType(cocci::CoccidioidesImmunosuppressedMedicalConditionHistoryObservation)
  *
  * @param coccidioidesPHCRClinicalInformationSection The receiving '<em><b>Coccidioides PHCR
  *     Clinical Information Section</b></em>' model object.
  *     <!-- end-model-doc -->
  * @generated
  */
 public static EList<CoccidioidesImmunosuppressedMedicalConditionHistoryObservation>
     getCoccidioidesImmunosuppressedMedicalConditionHistoryObservations(
         CoccidioidesPHCRClinicalInformationSection coccidioidesPHCRClinicalInformationSection) {
   if (GET_COCCIDIOIDES_IMMUNOSUPPRESSED_MEDICAL_CONDITION_HISTORY_OBSERVATIONS__EOCL_QRY
       == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setOperationContext(
         CocciPackage.Literals.COCCIDIOIDES_PHCR_CLINICAL_INFORMATION_SECTION,
         CocciPackage.Literals.COCCIDIOIDES_PHCR_CLINICAL_INFORMATION_SECTION
             .getEAllOperations()
             .get(72));
     try {
       GET_COCCIDIOIDES_IMMUNOSUPPRESSED_MEDICAL_CONDITION_HISTORY_OBSERVATIONS__EOCL_QRY =
           helper.createQuery(
               GET_COCCIDIOIDES_IMMUNOSUPPRESSED_MEDICAL_CONDITION_HISTORY_OBSERVATIONS__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   OCL.Query query =
       EOCL_ENV.createQuery(
           GET_COCCIDIOIDES_IMMUNOSUPPRESSED_MEDICAL_CONDITION_HISTORY_OBSERVATIONS__EOCL_QRY);
   @SuppressWarnings("unchecked")
   Collection<CoccidioidesImmunosuppressedMedicalConditionHistoryObservation> result =
       (Collection<CoccidioidesImmunosuppressedMedicalConditionHistoryObservation>)
           query.evaluate(coccidioidesPHCRClinicalInformationSection);
   return new BasicEList.UnmodifiableEList<
       CoccidioidesImmunosuppressedMedicalConditionHistoryObservation>(
       result.size(), result.toArray());
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  * not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and let value :
  * datatypes::CE = self.code.oclAsType(datatypes::CE) in ( value.code = '10154-3' and
  * value.codeSystem = '2.16.840.1.113883.6.1')
  *
  * @param chiefComplaintSection The receiving '<em><b>Chief Complaint 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 validateChiefComplaintSectionCode(
     ChiefComplaintSection chiefComplaintSection,
     DiagnosticChain diagnostics,
     Map<Object, Object> context) {
   if (VALIDATE_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setContext(CDTPackage.Literals.CHIEF_COMPLAINT_SECTION);
     try {
       VALIDATE_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
           helper.createInvariant(
               VALIDATE_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   if (!EOCL_ENV
       .createQuery(VALIDATE_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
       .check(chiefComplaintSection)) {
     if (diagnostics != null) {
       diagnostics.add(
           new BasicDiagnostic(
               Diagnostic.ERROR,
               CDTValidator.DIAGNOSTIC_SOURCE,
               CDTValidator.CHIEF_COMPLAINT_SECTION__CHIEF_COMPLAINT_SECTION_CODE,
               CDTPlugin.INSTANCE.getString("ChiefComplaintSectionCode"),
               new Object[] {chiefComplaintSection}));
     }
     return false;
   }
   return true;
 }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param encounterEntry The receiving '<em><b>Encounter Entry</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 validateEncounterEntryText(
      EncounterEntry encounterEntry, DiagnosticChain diagnostics, Map<Object, Object> context) {

    if (VALIDATE_ENCOUNTER_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(IHEPackage.Literals.ENCOUNTER_ENTRY);
      try {
        VALIDATE_ENCOUNTER_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(VALIDATE_ENCOUNTER_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_ENCOUNTER_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(encounterEntry)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                IHEValidator.DIAGNOSTIC_SOURCE,
                IHEValidator.ENCOUNTER_ENTRY__ENCOUNTER_ENTRY_TEXT,
                IHEPlugin.INSTANCE.getString("EncounterEntryText"),
                new Object[] {encounterEntry}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param glasgowComaScoreOrganizer The receiving '<em><b>Glasgow Coma Score Organizer</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 validateGlasgowComaScoreOrganizerTemplateId(
      GlasgowComaScoreOrganizer glasgowComaScoreOrganizer,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_GLASGOW_COMA_SCORE_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(EmspcrPackage.Literals.GLASGOW_COMA_SCORE_ORGANIZER);
      try {
        VALIDATE_GLASGOW_COMA_SCORE_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_GLASGOW_COMA_SCORE_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(
            VALIDATE_GLASGOW_COMA_SCORE_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(glasgowComaScoreOrganizer)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                EmspcrValidator.DIAGNOSTIC_SOURCE,
                EmspcrValidator
                    .GLASGOW_COMA_SCORE_ORGANIZER__GLASGOW_COMA_SCORE_ORGANIZER_TEMPLATE_ID,
                EmspcrPlugin.INSTANCE.getString("GlasgowComaScoreOrganizerTemplateId"),
                new Object[] {glasgowComaScoreOrganizer}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param smokingStatusMeaningfulUse2 The receiving '<em><b>Smoking Status Meaningful
   *     Use2</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 validateTobaccoUseTemplateId(
      SmokingStatusMeaningfulUse2 smokingStatusMeaningfulUse2,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_TOBACCO_USE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(ConsolPackage.Literals.SMOKING_STATUS_MEANINGFUL_USE2);
      try {
        VALIDATE_TOBACCO_USE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_TOBACCO_USE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_TOBACCO_USE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(smokingStatusMeaningfulUse2)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                ConsolValidator.DIAGNOSTIC_SOURCE,
                ConsolValidator.SMOKING_STATUS_MEANINGFUL_USE2__TOBACCO_USE_TEMPLATE_ID,
                ConsolPlugin.INSTANCE.getString("TobaccoUseTemplateId"),
                new Object[] {smokingStatusMeaningfulUse2}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param nutritionRecommendations The receiving '<em><b>Nutrition Recommendations</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 validateNutritionRecommendationsEffectiveTime(
      NutritionRecommendations nutritionRecommendations,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_NUTRITION_RECOMMENDATIONS_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(ConsolPackage.Literals.NUTRITION_RECOMMENDATIONS);
      try {
        VALIDATE_NUTRITION_RECOMMENDATIONS_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_NUTRITION_RECOMMENDATIONS_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(
            VALIDATE_NUTRITION_RECOMMENDATIONS_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(nutritionRecommendations)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.WARNING,
                ConsolValidator.DIAGNOSTIC_SOURCE,
                ConsolValidator.NUTRITION_RECOMMENDATIONS__NUTRITION_RECOMMENDATIONS_EFFECTIVE_TIME,
                ConsolPlugin.INSTANCE.getString("NutritionRecommendationsEffectiveTime"),
                new Object[] {nutritionRecommendations}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param selfCareActivities The receiving '<em><b>Self Care Activities</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 validateSelfCareActivitiesValueP(
      SelfCareActivities selfCareActivities,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_SELF_CARE_ACTIVITIES_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(ConsolPackage.Literals.SELF_CARE_ACTIVITIES);
      try {
        VALIDATE_SELF_CARE_ACTIVITIES_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_SELF_CARE_ACTIVITIES_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_SELF_CARE_ACTIVITIES_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(selfCareActivities)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                ConsolValidator.DIAGNOSTIC_SOURCE,
                ConsolValidator.SELF_CARE_ACTIVITIES__SELF_CARE_ACTIVITIES_VALUE_P,
                ConsolPlugin.INSTANCE.getString("SelfCareActivitiesValueP"),
                new Object[] {selfCareActivities}));
      }

      return false;
    }
    return true;
  }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  * self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.3.35')
  *
  * @param codedAdvanceDirectivesSection The receiving '<em><b>Coded Advance Directives
  *     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 validateCodedAdvanceDirectivesSectionTemplateId(
     CodedAdvanceDirectivesSection codedAdvanceDirectivesSection,
     DiagnosticChain diagnostics,
     Map<Object, Object> context) {
   if (VALIDATE_CODED_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
       == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setContext(IHEPackage.Literals.CODED_ADVANCE_DIRECTIVES_SECTION);
     try {
       VALIDATE_CODED_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
           helper.createInvariant(
               VALIDATE_CODED_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   if (!EOCL_ENV
       .createQuery(
           VALIDATE_CODED_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
       .check(codedAdvanceDirectivesSection)) {
     if (diagnostics != null) {
       diagnostics.add(
           new BasicDiagnostic(
               Diagnostic.ERROR,
               IHEValidator.DIAGNOSTIC_SOURCE,
               IHEValidator
                   .CODED_ADVANCE_DIRECTIVES_SECTION__CODED_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID,
               IHEPlugin.INSTANCE.getString("CodedAdvanceDirectivesSectionTemplateId"),
               new Object[] {codedAdvanceDirectivesSection}));
     }
     return false;
   }
   return true;
 }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param emsProtocolSection The receiving '<em><b>EMS Protocol 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 validateEMSProtocolSectionProtocolObservation(
      EMSProtocolSection emsProtocolSection,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_EMS_PROTOCOL_SECTION_PROTOCOL_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
        == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(EmspcrPackage.Literals.EMS_PROTOCOL_SECTION);
      try {
        VALIDATE_EMS_PROTOCOL_SECTION_PROTOCOL_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_EMS_PROTOCOL_SECTION_PROTOCOL_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(
            VALIDATE_EMS_PROTOCOL_SECTION_PROTOCOL_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(emsProtocolSection)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                EmspcrValidator.DIAGNOSTIC_SOURCE,
                EmspcrValidator.EMS_PROTOCOL_SECTION__EMS_PROTOCOL_SECTION_PROTOCOL_OBSERVATION,
                EmspcrPlugin.INSTANCE.getString("EMSProtocolSectionProtocolObservation"),
                new Object[] {emsProtocolSection}));
      }

      return false;
    }
    return true;
  }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  * self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.5.2')
  *
  * @param problemConcernEntry The receiving '<em><b>Problem Concern Entry</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 validateProblemConcernEntryTemplateId(
     ProblemConcernEntry problemConcernEntry,
     DiagnosticChain diagnostics,
     Map<Object, Object> context) {
   if (VALIDATE_PROBLEM_CONCERN_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setContext(IHEPackage.Literals.PROBLEM_CONCERN_ENTRY);
     try {
       VALIDATE_PROBLEM_CONCERN_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
           helper.createInvariant(
               VALIDATE_PROBLEM_CONCERN_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   if (!EOCL_ENV
       .createQuery(VALIDATE_PROBLEM_CONCERN_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
       .check(problemConcernEntry)) {
     if (diagnostics != null) {
       diagnostics.add(
           new BasicDiagnostic(
               Diagnostic.ERROR,
               IHEValidator.DIAGNOSTIC_SOURCE,
               IHEValidator.PROBLEM_CONCERN_ENTRY__PROBLEM_CONCERN_ENTRY_TEMPLATE_ID,
               IHEPlugin.INSTANCE.getString("ProblemConcernEntryTemplateId"),
               new Object[] {problemConcernEntry}));
     }
     return false;
   }
   return true;
 }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param languageSpoken The receiving '<em><b>Language Spoken</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 validateLanguageSpokenModeCode(
      LanguageSpoken languageSpoken, DiagnosticChain diagnostics, Map<Object, Object> context) {

    if (VALIDATE_LANGUAGE_SPOKEN_MODE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(HITSPPackage.Literals.LANGUAGE_SPOKEN);
      try {
        VALIDATE_LANGUAGE_SPOKEN_MODE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_LANGUAGE_SPOKEN_MODE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_LANGUAGE_SPOKEN_MODE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(languageSpoken)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                HITSPValidator.DIAGNOSTIC_SOURCE,
                HITSPValidator.LANGUAGE_SPOKEN__LANGUAGE_SPOKEN_MODE_CODE,
                HITSPPlugin.INSTANCE.getString("LanguageSpokenModeCode"),
                new Object[] {languageSpoken}));
      }

      return false;
    }
    return true;
  }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  * self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.3.88.11.83.107')
  *
  * @param historyOfPresentIllness The receiving '<em><b>History Of Present Illness</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 validateHITSPHistoryOfPresentIllnessTemplateId(
     HistoryOfPresentIllness historyOfPresentIllness,
     DiagnosticChain diagnostics,
     Map<Object, Object> context) {
   if (VALIDATE_HITSP_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
       == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setContext(HITSPPackage.Literals.HISTORY_OF_PRESENT_ILLNESS);
     try {
       VALIDATE_HITSP_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
           helper.createInvariant(
               VALIDATE_HITSP_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   if (!EOCL_ENV
       .createQuery(
           VALIDATE_HITSP_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
       .check(historyOfPresentIllness)) {
     if (diagnostics != null) {
       diagnostics.add(
           new BasicDiagnostic(
               Diagnostic.ERROR,
               HITSPValidator.DIAGNOSTIC_SOURCE,
               HITSPValidator
                   .HISTORY_OF_PRESENT_ILLNESS__HITSP_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID,
               HITSPPlugin.INSTANCE.getString("HITSPHistoryOfPresentIllnessTemplateId"),
               new Object[] {historyOfPresentIllness}));
     }
     return false;
   }
   return true;
 }
Exemple #17
0
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  *
  * @param cr The receiving '<em><b>CR</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 validateCR(
     CR cr, DiagnosticChain diagnostics, Map<Object, Object> context) {
   if (VALIDATE_CR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setContext(DatatypesPackage.Literals.CR);
     try {
       VALIDATE_CR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
           helper.createInvariant(VALIDATE_CR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   if (!EOCL_ENV.createQuery(VALIDATE_CR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(cr)) {
     if (diagnostics != null) {
       diagnostics.add(
           new BasicDiagnostic(
               Diagnostic.ERROR,
               DatatypesValidator.DIAGNOSTIC_SOURCE,
               DatatypesValidator.CR__CR,
               org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE.getString(
                   "_UI_GenericInvariant_diagnostic",
                   new Object[] {
                     "validateCR",
                     org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(cr, context)
                   }),
               new Object[] {cr}));
     }
     return false;
   }
   return true;
 }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param socialHistorySection The receiving '<em><b>Social History 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 validateSocialHistorySectionText(
      SocialHistorySection socialHistorySection,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_SOCIAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(CCDPackage.Literals.SOCIAL_HISTORY_SECTION);
      try {
        VALIDATE_SOCIAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_SOCIAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_SOCIAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(socialHistorySection)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                CCDValidator.DIAGNOSTIC_SOURCE,
                CCDValidator.SOCIAL_HISTORY_SECTION__SOCIAL_HISTORY_SECTION_TEXT,
                CCDPlugin.INSTANCE.getString("SocialHistorySectionText"),
                new Object[] {socialHistorySection}));
      }

      return false;
    }
    return true;
  }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * <!-- begin-model-doc -->
  * 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 familyHistoryObservation The receiving '<em><b>Family History Observation</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 validateFamilyHistoryObservationStatusCode(
     FamilyHistoryObservation familyHistoryObservation,
     DiagnosticChain diagnostics,
     Map<Object, Object> context) {
   if (VALIDATE_FAMILY_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setContext(CCDPackage.Literals.FAMILY_HISTORY_OBSERVATION);
     try {
       VALIDATE_FAMILY_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
           helper.createInvariant(
               VALIDATE_FAMILY_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   if (!EOCL_ENV
       .createQuery(
           VALIDATE_FAMILY_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
       .check(familyHistoryObservation)) {
     if (diagnostics != null) {
       diagnostics.add(
           new BasicDiagnostic(
               Diagnostic.ERROR,
               CCDValidator.DIAGNOSTIC_SOURCE,
               CCDValidator.FAMILY_HISTORY_OBSERVATION__FAMILY_HISTORY_OBSERVATION_STATUS_CODE,
               CCDPlugin.INSTANCE.getString("FamilyHistoryObservationStatusCode"),
               new Object[] {familyHistoryObservation}));
     }
     return false;
   }
   return true;
 }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param healthStatusObservation2 The receiving '<em><b>Health Status Observation2</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 validateHealthStatusObservationTemplateId(
      HealthStatusObservation2 healthStatusObservation2,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_HEALTH_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(ConsolPackage.Literals.HEALTH_STATUS_OBSERVATION2);
      try {
        VALIDATE_HEALTH_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_HEALTH_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_HEALTH_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(healthStatusObservation2)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                ConsolValidator.DIAGNOSTIC_SOURCE,
                ConsolValidator.HEALTH_STATUS_OBSERVATION2__HEALTH_STATUS_OBSERVATION_TEMPLATE_ID,
                ConsolPlugin.INSTANCE.getString("HealthStatusObservationTemplateId"),
                new Object[] {healthStatusObservation2}));
      }

      return false;
    }
    return true;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param eyesSection The receiving '<em><b>Eyes 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 validateEyesSectionProblemEntry(
      EyesSection eyesSection, DiagnosticChain diagnostics, Map<Object, Object> context) {

    if (VALIDATE_EYES_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(IHEPackage.Literals.EYES_SECTION);
      try {
        VALIDATE_EYES_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_EYES_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_EYES_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(eyesSection)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.INFO,
                IHEValidator.DIAGNOSTIC_SOURCE,
                IHEValidator.EYES_SECTION__EYES_SECTION_PROBLEM_ENTRY,
                IHEPlugin.INSTANCE.getString("EyesSectionProblemEntry"),
                new Object[] {eyesSection}));
      }

      return false;
    }
    return true;
  }
Exemple #22
0
  /** Tests the definition of additional attributes on an OCL pre-defined type. */
  public void test_defOperationOnPredefinedType_172782() {
    // context is the predefined OCL String type
    helper.setContext(ocl.getEnvironment().getOCLStandardLibrary().getString());

    try {
      Operation feature =
          helper.defineOperation(
              "reversed() : String = "
                  + "Sequence{1..size()}->sortedBy(i | -i)->iterate(i; s : String = '' |"
                  + " s.concat(self.substring(i, i)))");

      // the other representation of 'String'
      helper.setContext(getUMLString());

      Collection<Choice> choices = helper.getSyntaxHelp(ConstraintKind.INVARIANT, "self.");

      assertChoice(choices, ChoiceKind.OPERATION, "reversed");

      OCLExpression<Classifier> expr = helper.createQuery("self.reversed()");

      assertEquals("ablE was i ere I saw elbA", ocl.evaluate("Able was I ere i saw Elba", expr));

      // verify that TypeUtil produces the correct result
      assertTrue(
          TypeUtil.getOperations(
                  ocl.getEnvironment(), ocl.getEnvironment().getOCLStandardLibrary().getString())
              .contains(feature));
      assertTrue(TypeUtil.getOperations(ocl.getEnvironment(), getUMLString()).contains(feature));
    } catch (Exception e) {
      fail("Failed to parse or evaluate: " + e.getLocalizedMessage());
    }

    // now, make sure that this definition was local to the OCL that
    //   parsed it (that it is not shared via the standard library package)
    OCL localOCL = OCL.newInstance();
    OCL.Helper localHelper = localOCL.createOCLHelper();
    localHelper.setContext(ocl.getEnvironment().getOCLStandardLibrary().getString());

    try {
      Collection<Choice> choices = localHelper.getSyntaxHelp(ConstraintKind.INVARIANT, "self.");

      assertNotChoice(choices, ChoiceKind.OPERATION, "reversed");

      localHelper.createQuery("self.reversed()");

      fail("Should have failed to parse the undefined operation");
    } catch (ParserException e) {
      // success!
      System.out.println("Got the expected exception: " + e.getLocalizedMessage());
    }
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param nutritionRecommendations The receiving '<em><b>Nutrition Recommendations</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 validateNutritionRecommendationsMoodCodeP(
      NutritionRecommendations nutritionRecommendations,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_NUTRITION_RECOMMENDATIONS_MOOD_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(ConsolPackage.Literals.NUTRITION_RECOMMENDATIONS);
      try {
        VALIDATE_NUTRITION_RECOMMENDATIONS_MOOD_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_NUTRITION_RECOMMENDATIONS_MOOD_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_NUTRITION_RECOMMENDATIONS_MOOD_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(nutritionRecommendations)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                ConsolValidator.DIAGNOSTIC_SOURCE,
                ConsolValidator.NUTRITION_RECOMMENDATIONS__NUTRITION_RECOMMENDATIONS_MOOD_CODE_P,
                ConsolPlugin.INSTANCE.getString("NutritionRecommendationsMoodCodeP"),
                new Object[] {nutritionRecommendations}));
      }

      if (context != null) {
        // generate a pass token for my dependent constraints to short-circuit or filter results
        @SuppressWarnings("unchecked")
        Collection<Object> passToken =
            (Collection<Object>)
                context.get(
                    "org.openhealthtools.mdht.uml.cda.consol.NutritionRecommendationsMoodCodeP");
        if (passToken == null) {
          // anticipate a reasonably healthy model
          passToken = new java.util.ArrayList<Object>(3);
          context.put(
              "org.openhealthtools.mdht.uml.cda.consol.NutritionRecommendationsMoodCodeP",
              passToken);
        }
        passToken.add(nutritionRecommendations);
      }

      return false;
    }
    return true;
  }
  private static OCLExpression parse(String expression) {
    if (expression == null) return null;

    OCLExpression oclExpression = null;
    Helper helper = OCL_ENV.createOCLHelper();
    helper.setContext(FragmentPackage.Literals.FRAGMENT);

    try {
      oclExpression = helper.createQuery(expression);
    } catch (ParserException e) {
      System.err.println(e.getLocalizedMessage());
    }
    return oclExpression;
  }
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * <!-- begin-model-doc -->
   *
   * @param smokingStatusMeaningfulUse2 The receiving '<em><b>Smoking Status Meaningful
   *     Use2</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 validateSmokingStatusObservationValueP(
      SmokingStatusMeaningfulUse2 smokingStatusMeaningfulUse2,
      DiagnosticChain diagnostics,
      Map<Object, Object> context) {

    if (VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
      OCL.Helper helper = EOCL_ENV.createOCLHelper();
      helper.setContext(ConsolPackage.Literals.SMOKING_STATUS_MEANINGFUL_USE2);
      try {
        VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
            helper.createInvariant(
                VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
      } catch (ParserException pe) {
        throw new UnsupportedOperationException(pe.getLocalizedMessage());
      }
    }
    if (!EOCL_ENV
        .createQuery(VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_INV)
        .check(smokingStatusMeaningfulUse2)) {
      if (diagnostics != null) {
        diagnostics.add(
            new BasicDiagnostic(
                Diagnostic.ERROR,
                ConsolValidator.DIAGNOSTIC_SOURCE,
                ConsolValidator.SMOKING_STATUS_MEANINGFUL_USE2__SMOKING_STATUS_OBSERVATION_VALUE_P,
                ConsolPlugin.INSTANCE.getString("SmokingStatusObservationValueP"),
                new Object[] {smokingStatusMeaningfulUse2}));
      }

      if (context != null) {
        // generate a pass token for my dependent constraints to short-circuit or filter results
        @SuppressWarnings("unchecked")
        Collection<Object> passToken =
            (Collection<Object>)
                context.get(
                    "org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservationValueP");
        if (passToken == null) {
          // anticipate a reasonably healthy model
          passToken = new java.util.ArrayList<Object>(3);
          context.put(
              "org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservationValueP", passToken);
        }
        passToken.add(smokingStatusMeaningfulUse2);
      }

      return false;
    }
    return true;
  }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public CD getValue() {
   if (GET_VALUE__EOCL_QRY == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setOperationContext(
         DomainPackage.Literals.IEPISODE_OBSERVATION,
         DomainPackage.Literals.IEPISODE_OBSERVATION.getEAllOperations().get(3));
     try {
       GET_VALUE__EOCL_QRY = helper.createQuery(GET_VALUE__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   OCL.Query query = EOCL_ENV.createQuery(GET_VALUE__EOCL_QRY);
   return (CD) query.evaluate(this);
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public static ProblemEntry getProblemEntry(EyesSection eyesSection) {
   if (GET_PROBLEM_ENTRY__EOCL_QRY == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setOperationContext(
         IHEPackage.Literals.EYES_SECTION,
         IHEPackage.Literals.EYES_SECTION.getEAllOperations().get(58));
     try {
       GET_PROBLEM_ENTRY__EOCL_QRY = helper.createQuery(GET_PROBLEM_ENTRY__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   OCL.Query query = EOCL_ENV.createQuery(GET_PROBLEM_ENTRY__EOCL_QRY);
   return (ProblemEntry) query.evaluate(eyesSection);
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public ICauseOfDeathObservation getCauseOfDeath() {
   if (GET_CAUSE_OF_DEATH__EOCL_QRY == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setOperationContext(
         DomainPackage.Literals.IPROBLEM_ENTRY,
         DomainPackage.Literals.IPROBLEM_ENTRY.getEAllOperations().get(30));
     try {
       GET_CAUSE_OF_DEATH__EOCL_QRY = helper.createQuery(GET_CAUSE_OF_DEATH__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   OCL.Query query = EOCL_ENV.createQuery(GET_CAUSE_OF_DEATH__EOCL_QRY);
   return (ICauseOfDeathObservation) query.evaluate(this);
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public ISeverity getSeverity() {
   if (GET_SEVERITY__EOCL_QRY == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setOperationContext(
         DomainPackage.Literals.IPROBLEM_ENTRY,
         DomainPackage.Literals.IPROBLEM_ENTRY.getEAllOperations().get(18));
     try {
       GET_SEVERITY__EOCL_QRY = helper.createQuery(GET_SEVERITY__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   OCL.Query query = EOCL_ENV.createQuery(GET_SEVERITY__EOCL_QRY);
   return (ISeverity) query.evaluate(this);
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public IProblemStatusObservation getProblemStatus() {
   if (GET_PROBLEM_STATUS__EOCL_QRY == null) {
     OCL.Helper helper = EOCL_ENV.createOCLHelper();
     helper.setOperationContext(
         DomainPackage.Literals.IPROBLEM_ENTRY,
         DomainPackage.Literals.IPROBLEM_ENTRY.getEAllOperations().get(21));
     try {
       GET_PROBLEM_STATUS__EOCL_QRY = helper.createQuery(GET_PROBLEM_STATUS__EOCL_EXP);
     } catch (ParserException pe) {
       throw new UnsupportedOperationException(pe.getLocalizedMessage());
     }
   }
   OCL.Query query = EOCL_ENV.createQuery(GET_PROBLEM_STATUS__EOCL_QRY);
   return (IProblemStatusObservation) query.evaluate(this);
 }