All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openhealthtools.mdht.uml.cda.operations.SectionOperations Maven / Gradle / Ivy

/*******************************************************************************
 * Copyright (c) 2009, 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     David A Carlson (XMLmodeling.com) - getEntryTargets
 *******************************************************************************/
package org.openhealthtools.mdht.uml.cda.operations;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.URIConverter;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.GenericXMLResourceFactoryImpl;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.ecore.xml.type.XMLTypeDocumentRoot;
import org.eclipse.ocl.EvaluationEnvironment;
import org.eclipse.ocl.ParserException;
import org.eclipse.ocl.ecore.Constraint;
import org.eclipse.ocl.ecore.OCL;
import org.eclipse.ocl.expressions.OCLExpression;
import org.openhealthtools.mdht.uml.cda.Act;
import org.openhealthtools.mdht.uml.cda.CDAFactory;
import org.openhealthtools.mdht.uml.cda.CDAPackage;
import org.openhealthtools.mdht.uml.cda.ClinicalDocument;
import org.openhealthtools.mdht.uml.cda.ClinicalStatement;
import org.openhealthtools.mdht.uml.cda.Component5;
import org.openhealthtools.mdht.uml.cda.Encounter;
import org.openhealthtools.mdht.uml.cda.Entry;
import org.openhealthtools.mdht.uml.cda.Observation;
import org.openhealthtools.mdht.uml.cda.ObservationMedia;
import org.openhealthtools.mdht.uml.cda.Organizer;
import org.openhealthtools.mdht.uml.cda.Procedure;
import org.openhealthtools.mdht.uml.cda.RegionOfInterest;
import org.openhealthtools.mdht.uml.cda.Section;
import org.openhealthtools.mdht.uml.cda.StrucDocText;
import org.openhealthtools.mdht.uml.cda.SubstanceAdministration;
import org.openhealthtools.mdht.uml.cda.Supply;
import org.openhealthtools.mdht.uml.cda.util.CDAUtil;
import org.openhealthtools.mdht.uml.cda.util.CDAValidator;
import org.openhealthtools.mdht.uml.hl7.rim.operations.ActOperations;
import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntry;

/**
 * 
 * A static utility class that provides operations related to 'Section' model objects.
 * 
 *
 * 

* The following operations are supported: *

    *
  • {@link org.openhealthtools.mdht.uml.cda.Section#validateClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Class Code}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#validateMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mood Code}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addAct(org.openhealthtools.mdht.uml.cda.Act) Add Act}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addEncounter(org.openhealthtools.mdht.uml.cda.Encounter) Add Encounter}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addObservation(org.openhealthtools.mdht.uml.cda.Observation) Add Observation}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addObservationMedia(org.openhealthtools.mdht.uml.cda.ObservationMedia) Add Observation Media}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addOrganizer(org.openhealthtools.mdht.uml.cda.Organizer) Add Organizer}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addProcedure(org.openhealthtools.mdht.uml.cda.Procedure) Add Procedure}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addRegionOfInterest(org.openhealthtools.mdht.uml.cda.RegionOfInterest) Add Region Of Interest}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addSection(org.openhealthtools.mdht.uml.cda.Section) Add Section}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addSubstanceAdministration(org.openhealthtools.mdht.uml.cda.SubstanceAdministration) Add Substance Administration}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#addSupply(org.openhealthtools.mdht.uml.cda.Supply) Add Supply}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#createStrucDocText(java.lang.String) Create Struc Doc Text}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getActs() Get Acts}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getClinicalDocument() Get Clinical Document}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getEncounters() Get Encounters}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getObservations() Get Observations}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getObservationMedia() Get Observation Media}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getOrganizers() Get Organizers}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getProcedures() Get Procedures}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getRegionsOfInterest() Get Regions Of Interest}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getSections() Get Sections}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getAllSections() Get All Sections}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getSubstanceAdministrations() Get Substance Administrations}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getSupplies() Get Supplies}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasActTemplate(java.lang.String) Has Act Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasCode(java.lang.String, java.lang.String, java.lang.String) Has Code}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasEncounterTemplate(java.lang.String) Has Encounter Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasObservationMediaTemplate(java.lang.String) Has Observation Media Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasObservationTemplate(java.lang.String) Has Observation Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasOrganizerTemplate(java.lang.String) Has Organizer Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasProcedureTemplate(java.lang.String) Has Procedure Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasRegionOfInterestTemplate(java.lang.String) Has Region Of Interest Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasSubstanceAdministrationTemplate(java.lang.String) Has Substance Administration Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasSectionTemplate(java.lang.String) Has Section Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasSupplyTemplate(java.lang.String) Has Supply Template}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#hasTemplateId(java.lang.String) Has Template Id}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getEntryTargets(org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntry, java.lang.Object) Get Entry Targets}
  • *
  • {@link org.openhealthtools.mdht.uml.cda.Section#getEntryTargets(java.lang.Object) Get Entry Targets}
  • *
*

* * @generated */ public class SectionOperations extends ActOperations { /** * * * @generated */ protected SectionOperations() { super(); } /** * The cached OCL expression body for the '{@link #validateClassCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Class Code}' operation. * * * @see #validateClassCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) * @generated * @ordered */ protected static final String VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.isClassCodeDefined() implies self.classCode=vocab::ActClass::DOCSECT"; /** * The cached OCL invariant for the '{@link #validateClassCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Class Code}' invariant operation. * * * @see #validateClassCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) * @generated * @ordered */ protected static Constraint VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; /** * * * * self.isClassCodeDefined() implies self.classCode=vocab::ActClass::DOCSECT * @param section The receiving 'Section' model object. * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * * @generated */ public static boolean validateClassCode(Section section, DiagnosticChain diagnostics, Map context) { if (VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(CDAPackage.Literals.SECTION); try { VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } if (!EOCL_ENV.createQuery(VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(section)) { if (diagnostics != null) { diagnostics.add(new BasicDiagnostic( Diagnostic.ERROR, CDAValidator.DIAGNOSTIC_SOURCE, CDAValidator.SECTION__CLASS_CODE, org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE.getString( "_UI_GenericInvariant_diagnostic", new Object[] { "validateClassCode", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(section, context) }), new Object[] { section })); } return false; } return true; } /** * The cached OCL expression body for the '{@link #validateMoodCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mood Code}' operation. * * * @see #validateMoodCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) * @generated * @ordered */ protected static final String VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.isMoodCodeDefined() implies self.moodCode=vocab::ActMood::EVN"; /** * The cached OCL invariant for the '{@link #validateMoodCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mood Code}' invariant operation. * * * @see #validateMoodCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) * @generated * @ordered */ protected static Constraint VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; /** * * * * self.isMoodCodeDefined() implies self.moodCode=vocab::ActMood::EVN * @param section The receiving 'Section' model object. * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * * @generated */ public static boolean validateMoodCode(Section section, DiagnosticChain diagnostics, Map context) { if (VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(CDAPackage.Literals.SECTION); try { VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } if (!EOCL_ENV.createQuery(VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(section)) { if (diagnostics != null) { diagnostics.add(new BasicDiagnostic( Diagnostic.ERROR, CDAValidator.DIAGNOSTIC_SOURCE, CDAValidator.SECTION__MOOD_CODE, org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE.getString( "_UI_GenericInvariant_diagnostic", new Object[] { "validateMoodCode", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(section, context) }), new Object[] { section })); } return false; } return true; } /** * * * * @generated NOT */ public static void addAct(Section section, Act act) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setAct(act); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addEncounter(Section section, Encounter encounter) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setEncounter(encounter); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addObservation(Section section, Observation observation) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setObservation(observation); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addObservationMedia(Section section, ObservationMedia observationMedia) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setObservationMedia(observationMedia); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addOrganizer(Section section, Organizer organizer) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setOrganizer(organizer); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addProcedure(Section section, Procedure procedure) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setProcedure(procedure); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addRegionOfInterest(Section section, RegionOfInterest regionOfInterest) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setRegionOfInterest(regionOfInterest); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addSection(Section section, Section newSection) { Component5 component5 = CDAFactory.eINSTANCE.createComponent5(); component5.setSection(newSection); section.getComponents().add(component5); } /** * * * * @generated NOT */ public static void addSubstanceAdministration(Section section, SubstanceAdministration substanceAdministration) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setSubstanceAdministration(substanceAdministration); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static void addSupply(Section section, Supply supply) { Entry entry = CDAFactory.eINSTANCE.createEntry(); entry.setSupply(supply); section.getEntries().add(entry); } /** * * * * @generated NOT */ public static StrucDocText createStrucDocText(Section section, String xmlString) { StrucDocText text = null; try { Resource.Factory factory = new GenericXMLResourceFactoryImpl(); XMLResource resource = (XMLResource) factory.createResource(null); resource.load(new URIConverter.ReadableInputStream("" + xmlString + ""), null); XMLTypeDocumentRoot root = (XMLTypeDocumentRoot) resource.getContents().get(0); AnyType value = (AnyType) root.getMixed().getValue(0); text = CDAFactory.eINSTANCE.createStrucDocText(); text.getMixed().addAll(value.getMixed()); section.setText(text); } catch (Exception e) { } return text; } /** * The cached OCL expression body for the '{@link #getActs(Section) Get Acts}' operation. * * * @see #getActs(Section) * @generated * @ordered */ protected static final String GET_ACTS__EOCL_EXP = "self.entry.act->select(act : cda::Act | not act.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getActs(Section) Get Acts}' query operation. * * * @see #getActs(Section) * @generated * @ordered */ protected static OCLExpression GET_ACTS__EOCL_QRY; /** * * * * self.entry.act->select(act : cda::Act | not act.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getActs(Section section) { if (GET_ACTS__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(29)); try { GET_ACTS__EOCL_QRY = helper.createQuery(GET_ACTS__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_ACTS__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * * * * @generated NOT */ public static ClinicalDocument getClinicalDocument(Section section) { return CDAUtil.getClinicalDocument(section); } /** * The cached OCL expression body for the '{@link #getEncounters(Section) Get Encounters}' operation. * * * @see #getEncounters(Section) * @generated * @ordered */ protected static final String GET_ENCOUNTERS__EOCL_EXP = "self.entry.encounter->select(enc : cda::Encounter | not enc.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getEncounters(Section) Get Encounters}' query operation. * * * @see #getEncounters(Section) * @generated * @ordered */ protected static OCLExpression GET_ENCOUNTERS__EOCL_QRY; /** * * * * self.entry.encounter->select(enc : cda::Encounter | not enc.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getEncounters(Section section) { if (GET_ENCOUNTERS__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(31)); try { GET_ENCOUNTERS__EOCL_QRY = helper.createQuery(GET_ENCOUNTERS__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_ENCOUNTERS__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #getObservations(Section) Get Observations}' operation. * * * @see #getObservations(Section) * @generated * @ordered */ protected static final String GET_OBSERVATIONS__EOCL_EXP = "self.entry.observation->select(obs : cda::Observation | not obs.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getObservations(Section) Get Observations}' query operation. * * * @see #getObservations(Section) * @generated * @ordered */ protected static OCLExpression GET_OBSERVATIONS__EOCL_QRY; /** * * * * self.entry.observation->select(obs : cda::Observation | not obs.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getObservations(Section section) { if (GET_OBSERVATIONS__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(32)); try { GET_OBSERVATIONS__EOCL_QRY = helper.createQuery(GET_OBSERVATIONS__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_OBSERVATIONS__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #getObservationMedia(Section) Get Observation Media}' operation. * * * @see #getObservationMedia(Section) * @generated * @ordered */ protected static final String GET_OBSERVATION_MEDIA__EOCL_EXP = "self.entry.observationMedia->select(media : cda::ObservationMedia | not media.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getObservationMedia(Section) Get Observation Media}' query operation. * * * @see #getObservationMedia(Section) * @generated * @ordered */ protected static OCLExpression GET_OBSERVATION_MEDIA__EOCL_QRY; /** * * * * self.entry.observationMedia->select(media : cda::ObservationMedia | not media.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getObservationMedia(Section section) { if (GET_OBSERVATION_MEDIA__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(33)); try { GET_OBSERVATION_MEDIA__EOCL_QRY = helper.createQuery(GET_OBSERVATION_MEDIA__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_OBSERVATION_MEDIA__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #getOrganizers(Section) Get Organizers}' operation. * * * @see #getOrganizers(Section) * @generated * @ordered */ protected static final String GET_ORGANIZERS__EOCL_EXP = "self.entry.organizer->select(org : cda::Organizer | not org.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getOrganizers(Section) Get Organizers}' query operation. * * * @see #getOrganizers(Section) * @generated * @ordered */ protected static OCLExpression GET_ORGANIZERS__EOCL_QRY; /** * * * * self.entry.organizer->select(org : cda::Organizer | not org.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getOrganizers(Section section) { if (GET_ORGANIZERS__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(34)); try { GET_ORGANIZERS__EOCL_QRY = helper.createQuery(GET_ORGANIZERS__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_ORGANIZERS__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #getProcedures(Section) Get Procedures}' operation. * * * @see #getProcedures(Section) * @generated * @ordered */ protected static final String GET_PROCEDURES__EOCL_EXP = "self.entry.procedure->select(proc : cda::Procedure | not proc.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getProcedures(Section) Get Procedures}' query operation. * * * @see #getProcedures(Section) * @generated * @ordered */ protected static OCLExpression GET_PROCEDURES__EOCL_QRY; /** * * * * self.entry.procedure->select(proc : cda::Procedure | not proc.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getProcedures(Section section) { if (GET_PROCEDURES__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(35)); try { GET_PROCEDURES__EOCL_QRY = helper.createQuery(GET_PROCEDURES__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_PROCEDURES__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #getRegionsOfInterest(Section) Get Regions Of Interest}' operation. * * * @see #getRegionsOfInterest(Section) * @generated * @ordered */ protected static final String GET_REGIONS_OF_INTEREST__EOCL_EXP = "self.entry.regionOfInterest->select(reg : cda::RegionOfInterest | not reg.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getRegionsOfInterest(Section) Get Regions Of Interest}' query operation. * * * @see #getRegionsOfInterest(Section) * @generated * @ordered */ protected static OCLExpression GET_REGIONS_OF_INTEREST__EOCL_QRY; /** * * * * self.entry.regionOfInterest->select(reg : cda::RegionOfInterest | not reg.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getRegionsOfInterest(Section section) { if (GET_REGIONS_OF_INTEREST__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(36)); try { GET_REGIONS_OF_INTEREST__EOCL_QRY = helper.createQuery(GET_REGIONS_OF_INTEREST__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_REGIONS_OF_INTEREST__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #getSections(Section) Get Sections}' operation. * * * @see #getSections(Section) * @generated * @ordered */ protected static final String GET_SECTIONS__EOCL_EXP = "self.component.section"; /** * The cached OCL query for the '{@link #getSections(Section) Get Sections}' query operation. * * * @see #getSections(Section) * @generated * @ordered */ protected static OCLExpression GET_SECTIONS__EOCL_QRY; /** * * * * self.component.section * @param section The receiving 'Section' model object. * * @generated */ public static EList
getSections(Section section) { if (GET_SECTIONS__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(37)); try { GET_SECTIONS__EOCL_QRY = helper.createQuery(GET_SECTIONS__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_SECTIONS__EOCL_QRY); @SuppressWarnings("unchecked") Collection
result = (Collection
) query.evaluate(section); return new BasicEList.UnmodifiableEList
(result.size(), result.toArray()); } /** * * * * @generated NOT */ public static EList
getAllSections(Section section) { List
sections = CDAUtil.getAllSections(section); return new BasicEList.UnmodifiableEList
(sections.size(), sections.toArray()); } /** * The cached OCL expression body for the '{@link #getSubstanceAdministrations(Section) Get Substance Administrations}' operation. * * * @see #getSubstanceAdministrations(Section) * @generated * @ordered */ protected static final String GET_SUBSTANCE_ADMINISTRATIONS__EOCL_EXP = "self.entry.substanceAdministration->select(sub : cda::SubstanceAdministration | not sub.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getSubstanceAdministrations(Section) Get Substance Administrations}' query operation. * * * @see #getSubstanceAdministrations(Section) * @generated * @ordered */ protected static OCLExpression GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY; /** * * * * self.entry.substanceAdministration->select(sub : cda::SubstanceAdministration | not sub.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getSubstanceAdministrations(Section section) { if (GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(39)); try { GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY = helper.createQuery(GET_SUBSTANCE_ADMINISTRATIONS__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #getSupplies(Section) Get Supplies}' operation. * * * @see #getSupplies(Section) * @generated * @ordered */ protected static final String GET_SUPPLIES__EOCL_EXP = "self.entry.supply->select(sup : cda::Supply | not sup.oclIsUndefined())"; /** * The cached OCL query for the '{@link #getSupplies(Section) Get Supplies}' query operation. * * * @see #getSupplies(Section) * @generated * @ordered */ protected static OCLExpression GET_SUPPLIES__EOCL_QRY; /** * * * * self.entry.supply->select(sup : cda::Supply | not sup.oclIsUndefined()) * @param section The receiving 'Section' model object. * * @generated */ public static EList getSupplies(Section section) { if (GET_SUPPLIES__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(40)); try { GET_SUPPLIES__EOCL_QRY = helper.createQuery(GET_SUPPLIES__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(GET_SUPPLIES__EOCL_QRY); @SuppressWarnings("unchecked") Collection result = (Collection) query.evaluate(section); return new BasicEList.UnmodifiableEList(result.size(), result.toArray()); } /** * The cached OCL expression body for the '{@link #hasActTemplate(Section, java.lang.String) Has Act Template}' operation. * * * @see #hasActTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_ACT_TEMPLATE__STRING__EOCL_EXP = "self.getActs()->exists(act : cda::Act | act.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasActTemplate(Section, java.lang.String) Has Act Template}' query operation. * * * @see #hasActTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_ACT_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getActs()->exists(act : cda::Act | act.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasActTemplate(Section section, String templateId) { if (HAS_ACT_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(41)); try { HAS_ACT_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_ACT_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_ACT_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasCode(Section, java.lang.String, java.lang.String, java.lang.String) Has Code}' operation. * * * @see #hasCode(Section, java.lang.String, java.lang.String, java.lang.String) * @generated * @ordered */ protected static final String HAS_CODE__STRING_STRING_STRING__EOCL_EXP = "self.code.code = code and self.code.codeSystem = codeSystem and self.code.codeSystemName = codeSystemName"; /** * The cached OCL query for the '{@link #hasCode(Section, java.lang.String, java.lang.String, java.lang.String) Has Code}' query operation. * * * @see #hasCode(Section, java.lang.String, java.lang.String, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_CODE__STRING_STRING_STRING__EOCL_QRY; /** * * * * self.code.code = code and self.code.codeSystem = codeSystem and self.code.codeSystemName = codeSystemName * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasCode(Section section, String code, String codeSystem, String codeSystemName) { if (HAS_CODE__STRING_STRING_STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(42)); try { HAS_CODE__STRING_STRING_STRING__EOCL_QRY = helper.createQuery(HAS_CODE__STRING_STRING_STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_CODE__STRING_STRING_STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("code", code); environment.add("codeSystem", codeSystem); environment.add("codeSystemName", codeSystemName); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasEncounterTemplate(Section, java.lang.String) Has Encounter Template}' operation. * * * @see #hasEncounterTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_EXP = "self.getEncounters()->exists(enc : cda::Encounter | enc.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasEncounterTemplate(Section, java.lang.String) Has Encounter Template}' query operation. * * * @see #hasEncounterTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getEncounters()->exists(enc : cda::Encounter | enc.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasEncounterTemplate(Section section, String templateId) { if (HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(43)); try { HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasObservationMediaTemplate(Section, java.lang.String) Has Observation Media Template}' operation. * * * @see #hasObservationMediaTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_EXP = "self.getObservationMedia()->exists(media : cda::ObservationMedia | media.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasObservationMediaTemplate(Section, java.lang.String) Has Observation Media Template}' query operation. * * * @see #hasObservationMediaTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getObservationMedia()->exists(media : cda::ObservationMedia | media.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasObservationMediaTemplate(Section section, String templateId) { if (HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(44)); try { HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasObservationTemplate(Section, java.lang.String) Has Observation Template}' operation. * * * @see #hasObservationTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_OBSERVATION_TEMPLATE__STRING__EOCL_EXP = "self.getObservations()->exists(obs : cda::Observation | obs.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasObservationTemplate(Section, java.lang.String) Has Observation Template}' query operation. * * * @see #hasObservationTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getObservations()->exists(obs : cda::Observation | obs.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasObservationTemplate(Section section, String templateId) { if (HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(45)); try { HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_OBSERVATION_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasOrganizerTemplate(Section, java.lang.String) Has Organizer Template}' operation. * * * @see #hasOrganizerTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_ORGANIZER_TEMPLATE__STRING__EOCL_EXP = "self.getOrganizers()->exists(org : cda::Organizer | org.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasOrganizerTemplate(Section, java.lang.String) Has Organizer Template}' query operation. * * * @see #hasOrganizerTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getOrganizers()->exists(org : cda::Organizer | org.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasOrganizerTemplate(Section section, String templateId) { if (HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(46)); try { HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_ORGANIZER_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasProcedureTemplate(Section, java.lang.String) Has Procedure Template}' operation. * * * @see #hasProcedureTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_PROCEDURE_TEMPLATE__STRING__EOCL_EXP = "self.getProcedures()->exists(proc : cda::Procedure | proc.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasProcedureTemplate(Section, java.lang.String) Has Procedure Template}' query operation. * * * @see #hasProcedureTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getProcedures()->exists(proc : cda::Procedure | proc.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasProcedureTemplate(Section section, String templateId) { if (HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(47)); try { HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_PROCEDURE_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasRegionOfInterestTemplate(Section, java.lang.String) Has Region Of Interest Template}' operation. * * * @see #hasRegionOfInterestTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_EXP = "self.getRegionsOfInterest()->exists(reg : cda::RegionOfInterest | reg.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasRegionOfInterestTemplate(Section, java.lang.String) Has Region Of Interest Template}' query operation. * * * @see #hasRegionOfInterestTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getRegionsOfInterest()->exists(reg : cda::RegionOfInterest | reg.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasRegionOfInterestTemplate(Section section, String templateId) { if (HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(48)); try { HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasSubstanceAdministrationTemplate(Section, java.lang.String) Has Substance Administration Template}' operation. * * * @see #hasSubstanceAdministrationTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_EXP = "self.getSubstanceAdministrations()->exists(sub : cda::SubstanceAdministration | sub.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasSubstanceAdministrationTemplate(Section, java.lang.String) Has Substance Administration Template}' query operation. * * * @see #hasSubstanceAdministrationTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getSubstanceAdministrations()->exists(sub : cda::SubstanceAdministration | sub.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasSubstanceAdministrationTemplate(Section section, String templateId) { if (HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(49)); try { HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasSectionTemplate(Section, java.lang.String) Has Section Template}' operation. * * * @see #hasSectionTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_SECTION_TEMPLATE__STRING__EOCL_EXP = "self.getSections()->exists(sect : cda::Section | sect.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasSectionTemplate(Section, java.lang.String) Has Section Template}' query operation. * * * @see #hasSectionTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_SECTION_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getSections()->exists(sect : cda::Section | sect.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasSectionTemplate(Section section, String templateId) { if (HAS_SECTION_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(50)); try { HAS_SECTION_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_SECTION_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_SECTION_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasSupplyTemplate(Section, java.lang.String) Has Supply Template}' operation. * * * @see #hasSupplyTemplate(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_SUPPLY_TEMPLATE__STRING__EOCL_EXP = "self.getSupplies()->exists(sup : cda::Supply | sup.hasTemplateId(templateId))"; /** * The cached OCL query for the '{@link #hasSupplyTemplate(Section, java.lang.String) Has Supply Template}' query operation. * * * @see #hasSupplyTemplate(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY; /** * * * * self.getSupplies()->exists(sup : cda::Supply | sup.hasTemplateId(templateId)) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasSupplyTemplate(Section section, String templateId) { if (HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(51)); try { HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY = helper.createQuery(HAS_SUPPLY_TEMPLATE__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * The cached OCL expression body for the '{@link #hasTemplateId(Section, java.lang.String) Has Template Id}' operation. * * * @see #hasTemplateId(Section, java.lang.String) * @generated * @ordered */ protected static final String HAS_TEMPLATE_ID__STRING__EOCL_EXP = "self.templateId->exists(id : datatypes::II | id.root = templateId)"; /** * The cached OCL query for the '{@link #hasTemplateId(Section, java.lang.String) Has Template Id}' query operation. * * * @see #hasTemplateId(Section, java.lang.String) * @generated * @ordered */ protected static OCLExpression HAS_TEMPLATE_ID__STRING__EOCL_QRY; /** * * * * self.templateId->exists(id : datatypes::II | id.root = templateId) * @param section The receiving 'Section' model object. * * @generated */ public static boolean hasTemplateId(Section section, String templateId) { if (HAS_TEMPLATE_ID__STRING__EOCL_QRY == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setOperationContext( CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(52)); try { HAS_TEMPLATE_ID__STRING__EOCL_QRY = helper.createQuery(HAS_TEMPLATE_ID__STRING__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } OCL.Query query = EOCL_ENV.createQuery(HAS_TEMPLATE_ID__STRING__EOCL_QRY); EvaluationEnvironment environment = query.getEvaluationEnvironment(); environment.add("templateId", templateId); return ((Boolean) query.evaluate(section)).booleanValue(); } /** * * * * @generated NOT */ public static EList getEntryTargets(Section section, x_ActRelationshipEntry typeCode, Object targetClass) { if (targetClass != null && !(targetClass instanceof EClass)) { throw new IllegalArgumentException("targetClass must be an EClass"); } return CDAUtil.getEntryTargets(section, typeCode, (EClass) targetClass); } /** * * * * @generated NOT */ public static EList getEntryTargets(Section section, Object targetClass) { return getEntryTargets(section, null, targetClass); } } // SectionOperations




© 2015 - 2024 Weber Informatics LLC | Privacy Policy