blob: 77b38d16b7a569939bcf55794d34c02a4ed82738 [file] [log] [blame]
/*******************************************************************************
* 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.eclipse.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.mdht.uml.cda.Act;
import org.eclipse.mdht.uml.cda.CDAFactory;
import org.eclipse.mdht.uml.cda.CDAPackage;
import org.eclipse.mdht.uml.cda.ClinicalDocument;
import org.eclipse.mdht.uml.cda.ClinicalStatement;
import org.eclipse.mdht.uml.cda.Component5;
import org.eclipse.mdht.uml.cda.Encounter;
import org.eclipse.mdht.uml.cda.Entry;
import org.eclipse.mdht.uml.cda.Observation;
import org.eclipse.mdht.uml.cda.ObservationMedia;
import org.eclipse.mdht.uml.cda.Organizer;
import org.eclipse.mdht.uml.cda.Procedure;
import org.eclipse.mdht.uml.cda.RegionOfInterest;
import org.eclipse.mdht.uml.cda.Section;
import org.eclipse.mdht.uml.cda.StrucDocText;
import org.eclipse.mdht.uml.cda.SubstanceAdministration;
import org.eclipse.mdht.uml.cda.Supply;
import org.eclipse.mdht.uml.cda.util.CDAUtil;
import org.eclipse.mdht.uml.cda.util.CDAValidator;
import org.eclipse.mdht.uml.hl7.datatypes.util.DatatypesUtil;
import org.eclipse.mdht.uml.hl7.rim.operations.ActOperations;
import org.eclipse.mdht.uml.hl7.vocab.x_ActRelationshipEntry;
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;
/**
* <!-- begin-user-doc -->
* A static utility class that provides operations related to '<em><b>Section</b></em>' model objects.
* <!-- end-user-doc -->
*
* <p>
* The following operations are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.cda.Section#validateClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Class Code</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#validateMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Mood Code</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addAct(org.eclipse.mdht.uml.cda.Act) <em>Add Act</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addEncounter(org.eclipse.mdht.uml.cda.Encounter) <em>Add Encounter</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addObservation(org.eclipse.mdht.uml.cda.Observation) <em>Add Observation</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addObservationMedia(org.eclipse.mdht.uml.cda.ObservationMedia) <em>Add Observation Media</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addOrganizer(org.eclipse.mdht.uml.cda.Organizer) <em>Add Organizer</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addProcedure(org.eclipse.mdht.uml.cda.Procedure) <em>Add Procedure</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addRegionOfInterest(org.eclipse.mdht.uml.cda.RegionOfInterest) <em>Add Region Of Interest</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addSection(org.eclipse.mdht.uml.cda.Section) <em>Add Section</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addSubstanceAdministration(org.eclipse.mdht.uml.cda.SubstanceAdministration) <em>Add Substance Administration</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#addSupply(org.eclipse.mdht.uml.cda.Supply) <em>Add Supply</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#createStrucDocText(java.lang.String) <em>Create Struc Doc Text</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getActs() <em>Get Acts</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getClinicalDocument() <em>Get Clinical Document</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getEncounters() <em>Get Encounters</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getObservations() <em>Get Observations</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getObservationMedia() <em>Get Observation Media</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getOrganizers() <em>Get Organizers</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getProcedures() <em>Get Procedures</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getRegionsOfInterest() <em>Get Regions Of Interest</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getSections() <em>Get Sections</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getAllSections() <em>Get All Sections</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getSubstanceAdministrations() <em>Get Substance Administrations</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getSupplies() <em>Get Supplies</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasActTemplate(java.lang.String) <em>Has Act Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasCode(java.lang.String, java.lang.String, java.lang.String) <em>Has Code</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasEncounterTemplate(java.lang.String) <em>Has Encounter Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasObservationMediaTemplate(java.lang.String) <em>Has Observation Media Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasObservationTemplate(java.lang.String) <em>Has Observation Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasOrganizerTemplate(java.lang.String) <em>Has Organizer Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasProcedureTemplate(java.lang.String) <em>Has Procedure Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasRegionOfInterestTemplate(java.lang.String) <em>Has Region Of Interest Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasSubstanceAdministrationTemplate(java.lang.String) <em>Has Substance Administration Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasSectionTemplate(java.lang.String) <em>Has Section Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasSupplyTemplate(java.lang.String) <em>Has Supply Template</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#hasTemplateId(java.lang.String) <em>Has Template Id</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getEntryTargets(org.eclipse.mdht.uml.hl7.vocab.x_ActRelationshipEntry, java.lang.Object) <em>Get Entry Targets</em>}</li>
* <li>{@link org.eclipse.mdht.uml.cda.Section#getEntryTargets(java.lang.Object) <em>Get Entry Targets</em>}</li>
* </ul>
*
* @generated
*/
public class SectionOperations extends ActOperations {
/**
* The cached environment for evaluating OCL expressions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected static final ThreadLocal<OCL> EOCL_ENV = new ThreadLocal<OCL>() {
@Override
public OCL initialValue() {
return OCL.newInstance();
}
};
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SectionOperations() {
super();
}
/**
* The cached OCL expression body for the '{@link #validateClassCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Class Code</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Validate Class Code</em>}' invariant operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #validateClassCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)
* @generated
* @ordered
*/
protected static ThreadLocal<Constraint> VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* @param section The receiving '<em><b>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 validateClassCode(Section section, DiagnosticChain diagnostics, Map<Object, Object> context) {
DatatypesUtil.increment(context, "SectionClassCode", "ERROR");
if (VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setContext(CDAPackage.Literals.SECTION);
try {
VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV.set(
helper.createInvariant(VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
if (!EOCL_ENV.get().createQuery(VALIDATE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV.get()).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) <em>Validate Mood Code</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Validate Mood Code</em>}' invariant operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #validateMoodCode(Section, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)
* @generated
* @ordered
*/
protected static ThreadLocal<Constraint> VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* @param section The receiving '<em><b>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 validateMoodCode(Section section, DiagnosticChain diagnostics, Map<Object, Object> context) {
DatatypesUtil.increment(context, "SectionMoodCode", "ERROR");
if (VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setContext(CDAPackage.Literals.SECTION);
try {
VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV.set(
helper.createInvariant(VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
if (!EOCL_ENV.get().createQuery(VALIDATE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV.get()).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;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addAct(Section section, Act act) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setAct(act);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addEncounter(Section section, Encounter encounter) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setEncounter(encounter);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addObservation(Section section, Observation observation) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setObservation(observation);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addObservationMedia(Section section, ObservationMedia observationMedia) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setObservationMedia(observationMedia);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addOrganizer(Section section, Organizer organizer) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setOrganizer(organizer);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addProcedure(Section section, Procedure procedure) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setProcedure(procedure);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addRegionOfInterest(Section section, RegionOfInterest regionOfInterest) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setRegionOfInterest(regionOfInterest);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addSection(Section section, Section newSection) {
Component5 component5 = CDAFactory.eINSTANCE.createComponent5();
component5.setSection(newSection);
section.getComponents().add(component5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addSubstanceAdministration(Section section, SubstanceAdministration substanceAdministration) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setSubstanceAdministration(substanceAdministration);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static void addSupply(Section section, Supply supply) {
Entry entry = CDAFactory.eINSTANCE.createEntry();
entry.setSupply(supply);
section.getEntries().add(entry);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @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("<text>" + xmlString + "</text>"), 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) {
e.printStackTrace();
}
return text;
}
/**
* The cached OCL expression body for the '{@link #getActs(Section) <em>Get Acts</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Acts</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getActs(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_ACTS__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<Act> getActs(Section section) {
if (GET_ACTS__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(29));
try {
GET_ACTS__EOCL_QRY.set(helper.createQuery(GET_ACTS__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_ACTS__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<Act> result = (Collection<Act>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static ClinicalDocument getClinicalDocument(Section section) {
return CDAUtil.getClinicalDocument(section);
}
/**
* The cached OCL expression body for the '{@link #getEncounters(Section) <em>Get Encounters</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Encounters</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEncounters(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_ENCOUNTERS__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<Encounter> getEncounters(Section section) {
if (GET_ENCOUNTERS__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(31));
try {
GET_ENCOUNTERS__EOCL_QRY.set(helper.createQuery(GET_ENCOUNTERS__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_ENCOUNTERS__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<Encounter> result = (Collection<Encounter>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getObservations(Section) <em>Get Observations</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Observations</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObservations(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_OBSERVATIONS__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<Observation> getObservations(Section section) {
if (GET_OBSERVATIONS__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(32));
try {
GET_OBSERVATIONS__EOCL_QRY.set(helper.createQuery(GET_OBSERVATIONS__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_OBSERVATIONS__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<Observation> result = (Collection<Observation>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getObservationMedia(Section) <em>Get Observation Media</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Observation Media</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObservationMedia(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_OBSERVATION_MEDIA__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<ObservationMedia> getObservationMedia(Section section) {
if (GET_OBSERVATION_MEDIA__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(33));
try {
GET_OBSERVATION_MEDIA__EOCL_QRY.set(helper.createQuery(GET_OBSERVATION_MEDIA__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_OBSERVATION_MEDIA__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<ObservationMedia> result = (Collection<ObservationMedia>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getOrganizers(Section) <em>Get Organizers</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Organizers</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOrganizers(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_ORGANIZERS__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<Organizer> getOrganizers(Section section) {
if (GET_ORGANIZERS__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(34));
try {
GET_ORGANIZERS__EOCL_QRY.set(helper.createQuery(GET_ORGANIZERS__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_ORGANIZERS__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<Organizer> result = (Collection<Organizer>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getProcedures(Section) <em>Get Procedures</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Procedures</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProcedures(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_PROCEDURES__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<Procedure> getProcedures(Section section) {
if (GET_PROCEDURES__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(35));
try {
GET_PROCEDURES__EOCL_QRY.set(helper.createQuery(GET_PROCEDURES__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_PROCEDURES__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<Procedure> result = (Collection<Procedure>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getRegionsOfInterest(Section) <em>Get Regions Of Interest</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Regions Of Interest</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRegionsOfInterest(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_REGIONS_OF_INTEREST__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<RegionOfInterest> getRegionsOfInterest(Section section) {
if (GET_REGIONS_OF_INTEREST__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(36));
try {
GET_REGIONS_OF_INTEREST__EOCL_QRY.set(helper.createQuery(GET_REGIONS_OF_INTEREST__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_REGIONS_OF_INTEREST__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<RegionOfInterest> result = (Collection<RegionOfInterest>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getSections(Section) <em>Get Sections</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Sections</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSections(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_SECTIONS__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<Section> getSections(Section section) {
if (GET_SECTIONS__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(37));
try {
GET_SECTIONS__EOCL_QRY.set(helper.createQuery(GET_SECTIONS__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_SECTIONS__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<Section> result = (Collection<Section>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static EList<Section> getAllSections(Section section) {
List<Section> sections = CDAUtil.getAllSections(section);
return new BasicEList.UnmodifiableEList<>(sections.size(), sections.toArray());
}
/**
* The cached OCL expression body for the '{@link #getSubstanceAdministrations(Section) <em>Get Substance Administrations</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Substance Administrations</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSubstanceAdministrations(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<SubstanceAdministration> getSubstanceAdministrations(Section section) {
if (GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(39));
try {
GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY.set(
helper.createQuery(GET_SUBSTANCE_ADMINISTRATIONS__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<SubstanceAdministration> result = (Collection<SubstanceAdministration>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getSupplies(Section) <em>Get Supplies</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Get Supplies</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSupplies(Section)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> GET_SUPPLIES__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static EList<Supply> getSupplies(Section section) {
if (GET_SUPPLIES__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(40));
try {
GET_SUPPLIES__EOCL_QRY.set(helper.createQuery(GET_SUPPLIES__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(GET_SUPPLIES__EOCL_QRY.get());
@SuppressWarnings("unchecked")
Collection<Supply> result = (Collection<Supply>) query.evaluate(section);
return new BasicEList.UnmodifiableEList<>(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #hasActTemplate(Section, java.lang.String) <em>Has Act Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Act Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasActTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_ACT_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasActTemplate(Section section, String templateId) {
if (HAS_ACT_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(41));
try {
HAS_ACT_TEMPLATE__STRING__EOCL_QRY.set(helper.createQuery(HAS_ACT_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_ACT_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Code</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Code</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasCode(Section, java.lang.String, java.lang.String, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_CODE__STRING_STRING_STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasCode(Section section, String code, String codeSystem, String codeSystemName) {
if (HAS_CODE__STRING_STRING_STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(42));
try {
HAS_CODE__STRING_STRING_STRING__EOCL_QRY.set(
helper.createQuery(HAS_CODE__STRING_STRING_STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_CODE__STRING_STRING_STRING__EOCL_QRY.get());
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) <em>Has Encounter Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Encounter Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasEncounterTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasEncounterTemplate(Section section, String templateId) {
if (HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(43));
try {
HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Observation Media Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Observation Media Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasObservationMediaTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasObservationMediaTemplate(Section section, String templateId) {
if (HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(44));
try {
HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Observation Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Observation Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasObservationTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasObservationTemplate(Section section, String templateId) {
if (HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(45));
try {
HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_OBSERVATION_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Organizer Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Organizer Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasOrganizerTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasOrganizerTemplate(Section section, String templateId) {
if (HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(46));
try {
HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_ORGANIZER_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Procedure Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Procedure Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasProcedureTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasProcedureTemplate(Section section, String templateId) {
if (HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(47));
try {
HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_PROCEDURE_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Region Of Interest Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Region Of Interest Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasRegionOfInterestTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasRegionOfInterestTemplate(Section section, String templateId) {
if (HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(48));
try {
HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Substance Administration Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Substance Administration Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasSubstanceAdministrationTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasSubstanceAdministrationTemplate(Section section, String templateId) {
if (HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(49));
try {
HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Section Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Section Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasSectionTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_SECTION_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasSectionTemplate(Section section, String templateId) {
if (HAS_SECTION_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(50));
try {
HAS_SECTION_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_SECTION_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_SECTION_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Supply Template</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Supply Template</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasSupplyTemplate(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasSupplyTemplate(Section section, String templateId) {
if (HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(51));
try {
HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY.set(
helper.createQuery(HAS_SUPPLY_TEMPLATE__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY.get());
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) <em>Has Template Id</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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) <em>Has Template Id</em>}' query operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #hasTemplateId(Section, java.lang.String)
* @generated
* @ordered
*/
protected static ThreadLocal<OCLExpression<EClassifier>> HAS_TEMPLATE_ID__STRING__EOCL_QRY = new ThreadLocal<>();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean hasTemplateId(Section section, String templateId) {
if (HAS_TEMPLATE_ID__STRING__EOCL_QRY.get() == null) {
synchronized (EOCL_ENV) {
OCL.Helper helper = EOCL_ENV.get().createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.SECTION, CDAPackage.Literals.SECTION.getEAllOperations().get(52));
try {
HAS_TEMPLATE_ID__STRING__EOCL_QRY.set(helper.createQuery(HAS_TEMPLATE_ID__STRING__EOCL_EXP));
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
}
OCL.Query query = EOCL_ENV.get().createQuery(HAS_TEMPLATE_ID__STRING__EOCL_QRY.get());
EvaluationEnvironment<?, ?, ?, ?, ?> environment = query.getEvaluationEnvironment();
environment.add("templateId", templateId);
return ((Boolean) query.evaluate(section)).booleanValue();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static EList<ClinicalStatement> 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);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
public static EList<ClinicalStatement> getEntryTargets(Section section, Object targetClass) {
return getEntryTargets(section, null, targetClass);
}
} // SectionOperations