org.openhealthtools.mdht.uml.cda.operations.ClinicalStatementOperations 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) - getEntryRelationshipTargets
*******************************************************************************/
package org.openhealthtools.mdht.uml.cda.operations;
import java.util.Collection;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.ocl.EvaluationEnvironment;
import org.eclipse.ocl.ParserException;
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.AssignedEntity;
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.Encounter;
import org.openhealthtools.mdht.uml.cda.EntryRelationship;
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.ParticipantRole;
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.SubstanceAdministration;
import org.openhealthtools.mdht.uml.cda.Supply;
import org.openhealthtools.mdht.uml.cda.util.CDAUtil;
import org.openhealthtools.mdht.uml.hl7.datatypes.CD;
import org.openhealthtools.mdht.uml.hl7.datatypes.II;
import org.openhealthtools.mdht.uml.hl7.rim.operations.ActOperations;
import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship;
/**
*
* A static utility class that provides operations related to 'Clinical Statement' model objects.
*
*
*
* The following operations are supported:
*
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addAct(org.openhealthtools.mdht.uml.cda.Act) Add Act}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addEncounter(org.openhealthtools.mdht.uml.cda.Encounter) Add Encounter}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addObservation(org.openhealthtools.mdht.uml.cda.Observation) Add Observation}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addObservationMedia(org.openhealthtools.mdht.uml.cda.ObservationMedia) Add Observation Media}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addOrganizer(org.openhealthtools.mdht.uml.cda.Organizer) Add Organizer}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addProcedure(org.openhealthtools.mdht.uml.cda.Procedure) Add Procedure}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addRegionOfInterest(org.openhealthtools.mdht.uml.cda.RegionOfInterest) Add Region Of Interest}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addSubstanceAdministration(org.openhealthtools.mdht.uml.cda.SubstanceAdministration) Add Substance Administration}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#addSupply(org.openhealthtools.mdht.uml.cda.Supply) Add Supply}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getActs() Get Acts}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getClinicalDocument() Get Clinical Document}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getEncounters() Get Encounters}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getEntryRelationshipTargets(org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship, java.lang.Object) Get Entry Relationship Targets}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getEntryRelationshipTargets(java.lang.Object) Get Entry Relationship Targets}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getObservations() Get Observations}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getObservationMedia() Get Observation Media}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getOrganizers() Get Organizers}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getProcedures() Get Procedures}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getRegionsOfInterest() Get Regions Of Interest}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getSection() Get Section}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getSubstanceAdministrations() Get Substance Administrations}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getSupplies() Get Supplies}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasActTemplate(java.lang.String) Has Act Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasCode(java.lang.String, java.lang.String, java.lang.String) Has Code}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasEncounterTemplate(java.lang.String) Has Encounter Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasObservationMediaTemplate(java.lang.String) Has Observation Media Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasObservationTemplate(java.lang.String) Has Observation Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasOrganizerTemplate(java.lang.String) Has Organizer Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasProcedureTemplate(java.lang.String) Has Procedure Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasRegionOfInterestTemplate(java.lang.String) Has Region Of Interest Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasSubstanceAdministrationTemplate(java.lang.String) Has Substance Administration Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasSupplyTemplate(java.lang.String) Has Supply Template}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#hasTemplateId(java.lang.String) Has Template Id}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getParticipantRoles() Get Participant Roles}
* - {@link org.openhealthtools.mdht.uml.cda.ClinicalStatement#getAssignedEntities() Get Assigned Entities}
*
*
*
* @generated
*/
public class ClinicalStatementOperations extends ActOperations {
/**
*
*
* @generated
*/
protected ClinicalStatementOperations() {
super();
}
@SuppressWarnings("unchecked")
private static List getEntryRelationships(ClinicalStatement clinicalStatement) {
return ((List) clinicalStatement.eGet(clinicalStatement.eClass().getEStructuralFeature(
"entryRelationship")));
}
/**
*
*
*
* @generated NOT
*/
public static void addAct(ClinicalStatement clinicalStatement, Act act) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setAct(act);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addEncounter(ClinicalStatement clinicalStatement, Encounter encounter) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setEncounter(encounter);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addObservation(ClinicalStatement clinicalStatement, Observation observation) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setObservation(observation);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addObservationMedia(ClinicalStatement clinicalStatement, ObservationMedia observationMedia) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setObservationMedia(observationMedia);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addOrganizer(ClinicalStatement clinicalStatement, Organizer organizer) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setOrganizer(organizer);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addProcedure(ClinicalStatement clinicalStatement, Procedure procedure) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setProcedure(procedure);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addRegionOfInterest(ClinicalStatement clinicalStatement, RegionOfInterest regionOfInterest) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setRegionOfInterest(regionOfInterest);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addSubstanceAdministration(ClinicalStatement clinicalStatement,
SubstanceAdministration substanceAdministration) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setSubstanceAdministration(substanceAdministration);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static void addSupply(ClinicalStatement clinicalStatement, Supply supply) {
EntryRelationship entryRelationship = CDAFactory.eINSTANCE.createEntryRelationship();
entryRelationship.setSupply(supply);
getEntryRelationships(clinicalStatement).add(entryRelationship);
}
/**
*
*
*
* @generated NOT
*/
public static EList getActs(ClinicalStatement clinicalStatement) {
List acts = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getAct() != null) {
acts.add(entryRelationship.getAct());
}
}
return new BasicEList.UnmodifiableEList(acts.size(), acts.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static ClinicalDocument getClinicalDocument(ClinicalStatement clinicalStatement) {
return CDAUtil.getClinicalDocument(clinicalStatement);
}
/**
*
*
*
* @generated NOT
*/
public static EList getEncounters(ClinicalStatement clinicalStatement) {
List encounters = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getEncounter() != null) {
encounters.add(entryRelationship.getEncounter());
}
}
return new BasicEList.UnmodifiableEList(encounters.size(), encounters.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static EList getEntryRelationshipTargets(ClinicalStatement clinicalStatement,
x_ActRelationshipEntryRelationship typeCode, Object targetClass) {
if (targetClass != null && !(targetClass instanceof EClass)) {
throw new IllegalArgumentException("targetClass must be an EClass");
}
return CDAUtil.getEntryRelationshipTargets(clinicalStatement, typeCode, (EClass) targetClass);
}
/**
*
*
*
* @generated NOT
*/
public static EList getEntryRelationshipTargets(ClinicalStatement clinicalStatement,
Object targetClass) {
return getEntryRelationshipTargets(clinicalStatement, null, targetClass);
}
/**
*
*
*
* @generated NOT
*/
public static EList getObservations(ClinicalStatement clinicalStatement) {
List observations = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getObservation() != null) {
observations.add(entryRelationship.getObservation());
}
}
return new BasicEList.UnmodifiableEList(observations.size(), observations.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static EList getObservationMedia(ClinicalStatement clinicalStatement) {
List observationMedia = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getObservationMedia() != null) {
observationMedia.add(entryRelationship.getObservationMedia());
}
}
return new BasicEList.UnmodifiableEList(observationMedia.size(), observationMedia.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static EList getOrganizers(ClinicalStatement clinicalStatement) {
List organizers = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getOrganizer() != null) {
organizers.add(entryRelationship.getOrganizer());
}
}
return new BasicEList.UnmodifiableEList(organizers.size(), organizers.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static EList getProcedures(ClinicalStatement clinicalStatement) {
List procedures = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getProcedure() != null) {
procedures.add(entryRelationship.getProcedure());
}
}
return new BasicEList.UnmodifiableEList(procedures.size(), procedures.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static EList getRegionsOfInterest(ClinicalStatement clinicalStatement) {
List regionsOfInterest = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getRegionOfInterest() != null) {
regionsOfInterest.add(entryRelationship.getRegionOfInterest());
}
}
return new BasicEList.UnmodifiableEList(regionsOfInterest.size(), regionsOfInterest.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static Section getSection(ClinicalStatement clinicalStatement) {
return CDAUtil.getSection(clinicalStatement);
}
/**
*
*
*
* @generated NOT
*/
public static EList getSubstanceAdministrations(ClinicalStatement clinicalStatement) {
List substanceAdministrations = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getSubstanceAdministration() != null) {
substanceAdministrations.add(entryRelationship.getSubstanceAdministration());
}
}
return new BasicEList.UnmodifiableEList(
substanceAdministrations.size(), substanceAdministrations.toArray());
}
/**
*
*
*
* @generated NOT
*/
public static EList getSupplies(ClinicalStatement clinicalStatement) {
List supplies = new ArrayList();
for (EntryRelationship entryRelationship : getEntryRelationships(clinicalStatement)) {
if (entryRelationship.getSupply() != null) {
supplies.add(entryRelationship.getSupply());
}
}
return new BasicEList.UnmodifiableEList(supplies.size(), supplies.toArray());
}
/**
* The cached OCL expression body for the '{@link #hasActTemplate(ClinicalStatement, java.lang.String) Has Act Template}' operation.
*
*
* @see #hasActTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Act Template}' query operation.
*
*
* @see #hasActTemplate(ClinicalStatement, java.lang.String)
* @generated
* @ordered
*/
protected static OCLExpression HAS_ACT_TEMPLATE__STRING__EOCL_QRY;
/**
*
*
*
* self.getActs()->exists(act : cda::Act | act.hasTemplateId(templateId))
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasActTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_ACT_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(38));
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(clinicalStatement)).booleanValue();
}
/**
*
*
*
* @generated NOT
*/
public static boolean hasCode(ClinicalStatement clinicalStatement, String code, String codeSystem,
String codeSystemName) {
CD cd = (CD) clinicalStatement.eGet(clinicalStatement.eClass().getEStructuralFeature("code"));
if (cd == null || code == null || codeSystem == null || codeSystemName == null) {
return false;
}
return code.equals(cd.getCode()) && codeSystem.equals(cd.getCodeSystem()) &&
codeSystemName.equals(cd.getCodeSystemName());
}
/**
* The cached OCL expression body for the '{@link #hasEncounterTemplate(ClinicalStatement, java.lang.String) Has Encounter Template}' operation.
*
*
* @see #hasEncounterTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Encounter Template}' query operation.
*
*
* @see #hasEncounterTemplate(ClinicalStatement, java.lang.String)
* @generated
* @ordered
*/
protected static OCLExpression HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY;
/**
*
*
*
* self.getEncounters()->exists(enc : cda::Encounter | enc.hasTemplateId(templateId))
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasEncounterTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_ENCOUNTER_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(40));
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(clinicalStatement)).booleanValue();
}
/**
* The cached OCL expression body for the '{@link #hasObservationMediaTemplate(ClinicalStatement, java.lang.String) Has Observation Media Template}' operation.
*
*
* @see #hasObservationMediaTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Observation Media Template}' query operation.
*
*
* @see #hasObservationMediaTemplate(ClinicalStatement, 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 clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasObservationMediaTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_OBSERVATION_MEDIA_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(41));
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(clinicalStatement)).booleanValue();
}
/**
* The cached OCL expression body for the '{@link #hasObservationTemplate(ClinicalStatement, java.lang.String) Has Observation Template}' operation.
*
*
* @see #hasObservationTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Observation Template}' query operation.
*
*
* @see #hasObservationTemplate(ClinicalStatement, java.lang.String)
* @generated
* @ordered
*/
protected static OCLExpression HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY;
/**
*
*
*
* self.getObservations()->exists(obs : cda::Observation | obs.hasTemplateId(templateId))
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasObservationTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_OBSERVATION_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(42));
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(clinicalStatement)).booleanValue();
}
/**
* The cached OCL expression body for the '{@link #hasOrganizerTemplate(ClinicalStatement, java.lang.String) Has Organizer Template}' operation.
*
*
* @see #hasOrganizerTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Organizer Template}' query operation.
*
*
* @see #hasOrganizerTemplate(ClinicalStatement, java.lang.String)
* @generated
* @ordered
*/
protected static OCLExpression HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY;
/**
*
*
*
* self.getOrganizers()->exists(org : cda::Organizer | org.hasTemplateId(templateId))
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasOrganizerTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_ORGANIZER_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(43));
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(clinicalStatement)).booleanValue();
}
/**
* The cached OCL expression body for the '{@link #hasProcedureTemplate(ClinicalStatement, java.lang.String) Has Procedure Template}' operation.
*
*
* @see #hasProcedureTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Procedure Template}' query operation.
*
*
* @see #hasProcedureTemplate(ClinicalStatement, java.lang.String)
* @generated
* @ordered
*/
protected static OCLExpression HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY;
/**
*
*
*
* self.getProcedures()->exists(proc : cda::Procedure | proc.hasTemplateId(templateId))
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasProcedureTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_PROCEDURE_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(44));
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(clinicalStatement)).booleanValue();
}
/**
* The cached OCL expression body for the '{@link #hasRegionOfInterestTemplate(ClinicalStatement, java.lang.String) Has Region Of Interest Template}' operation.
*
*
* @see #hasRegionOfInterestTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Region Of Interest Template}' query operation.
*
*
* @see #hasRegionOfInterestTemplate(ClinicalStatement, 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 clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasRegionOfInterestTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_REGION_OF_INTEREST_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(45));
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(clinicalStatement)).booleanValue();
}
/**
* The cached OCL expression body for the '{@link #hasSubstanceAdministrationTemplate(ClinicalStatement, java.lang.String) Has Substance Administration Template}' operation.
*
*
* @see #hasSubstanceAdministrationTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Substance Administration Template}' query operation.
*
*
* @see #hasSubstanceAdministrationTemplate(ClinicalStatement, 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 clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasSubstanceAdministrationTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_SUBSTANCE_ADMINISTRATION_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(46));
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(clinicalStatement)).booleanValue();
}
/**
* The cached OCL expression body for the '{@link #hasSupplyTemplate(ClinicalStatement, java.lang.String) Has Supply Template}' operation.
*
*
* @see #hasSupplyTemplate(ClinicalStatement, 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(ClinicalStatement, java.lang.String) Has Supply Template}' query operation.
*
*
* @see #hasSupplyTemplate(ClinicalStatement, java.lang.String)
* @generated
* @ordered
*/
protected static OCLExpression HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY;
/**
*
*
*
* self.getSupplies()->exists(sup : cda::Supply | sup.hasTemplateId(templateId))
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static boolean hasSupplyTemplate(ClinicalStatement clinicalStatement, String templateId) {
if (HAS_SUPPLY_TEMPLATE__STRING__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(47));
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(clinicalStatement)).booleanValue();
}
/**
*
*
*
* @generated NOT
*/
@SuppressWarnings("unchecked")
public static boolean hasTemplateId(ClinicalStatement clinicalStatement, String templateId) {
for (II ii : (List) clinicalStatement.eGet(clinicalStatement.eClass().getEStructuralFeature("templateId"))) {
if (templateId.equals(ii.getRoot())) {
return true;
}
}
return false;
}
/**
* The cached OCL expression body for the '{@link #getParticipantRoles(ClinicalStatement) Get Participant Roles}' operation.
*
*
* @see #getParticipantRoles(ClinicalStatement)
* @generated
* @ordered
*/
protected static final String GET_PARTICIPANT_ROLES__EOCL_EXP = "self.participant.participantRole->excluding(null)";
/**
* The cached OCL query for the '{@link #getParticipantRoles(ClinicalStatement) Get Participant Roles}' query operation.
*
*
* @see #getParticipantRoles(ClinicalStatement)
* @generated
* @ordered
*/
protected static OCLExpression GET_PARTICIPANT_ROLES__EOCL_QRY;
/**
*
*
*
* self.participant.participantRole->excluding(null)
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static EList getParticipantRoles(ClinicalStatement clinicalStatement) {
if (GET_PARTICIPANT_ROLES__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(49));
try {
GET_PARTICIPANT_ROLES__EOCL_QRY = helper.createQuery(GET_PARTICIPANT_ROLES__EOCL_EXP);
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
OCL.Query query = EOCL_ENV.createQuery(GET_PARTICIPANT_ROLES__EOCL_QRY);
@SuppressWarnings("unchecked")
Collection result = (Collection) query.evaluate(clinicalStatement);
return new BasicEList.UnmodifiableEList(result.size(), result.toArray());
}
/**
* The cached OCL expression body for the '{@link #getAssignedEntities(ClinicalStatement) Get Assigned Entities}' operation.
*
*
* @see #getAssignedEntities(ClinicalStatement)
* @generated
* @ordered
*/
protected static final String GET_ASSIGNED_ENTITIES__EOCL_EXP = "self.performer.assignedEntity->excluding(null)";
/**
* The cached OCL query for the '{@link #getAssignedEntities(ClinicalStatement) Get Assigned Entities}' query operation.
*
*
* @see #getAssignedEntities(ClinicalStatement)
* @generated
* @ordered
*/
protected static OCLExpression GET_ASSIGNED_ENTITIES__EOCL_QRY;
/**
*
*
*
* self.performer.assignedEntity->excluding(null)
* @param clinicalStatement The receiving 'Clinical Statement' model object.
*
* @generated
*/
public static EList getAssignedEntities(ClinicalStatement clinicalStatement) {
if (GET_ASSIGNED_ENTITIES__EOCL_QRY == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setOperationContext(
CDAPackage.Literals.CLINICAL_STATEMENT,
CDAPackage.Literals.CLINICAL_STATEMENT.getEAllOperations().get(50));
try {
GET_ASSIGNED_ENTITIES__EOCL_QRY = helper.createQuery(GET_ASSIGNED_ENTITIES__EOCL_EXP);
} catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
OCL.Query query = EOCL_ENV.createQuery(GET_ASSIGNED_ENTITIES__EOCL_QRY);
@SuppressWarnings("unchecked")
Collection result = (Collection) query.evaluate(clinicalStatement);
return new BasicEList.UnmodifiableEList(result.size(), result.toArray());
}
} // ClinicalStatementOperations