blob: fce56bbc3f053764e67bd216f94ec7a76db423aa [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016 David Carlson 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:
* David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation
*******************************************************************************/
/**
*/
package org.eclipse.mdht.uml.fhir.core.resource.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.mdht.uml.fhir.core.datatype.CodeableConcept;
import org.eclipse.mdht.uml.fhir.core.datatype.DateTime;
import org.eclipse.mdht.uml.fhir.core.datatype.Oid;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
import org.eclipse.mdht.uml.fhir.core.resource.ImagingObjectSelection;
import org.eclipse.mdht.uml.fhir.core.resource.ImagingObjectSelectionStudy;
import org.eclipse.mdht.uml.fhir.core.resource.Patient;
import org.eclipse.mdht.uml.fhir.core.resource.Resource;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Imaging Object Selection</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImagingObjectSelectionImpl#getUid <em>Uid</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImagingObjectSelectionImpl#getPatient <em>Patient</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImagingObjectSelectionImpl#getTitle <em>Title</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImagingObjectSelectionImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImagingObjectSelectionImpl#getAuthor <em>Author</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImagingObjectSelectionImpl#getAuthoringTime <em>Authoring Time</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImagingObjectSelectionImpl#getStudies <em>Study</em>}</li>
* </ul>
*
* @generated
*/
public class ImagingObjectSelectionImpl extends DomainResourceImpl implements ImagingObjectSelection {
/**
* The cached value of the '{@link #getUid() <em>Uid</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUid()
* @generated
* @ordered
*/
protected Oid uid;
/**
* The cached value of the '{@link #getPatient() <em>Patient</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPatient()
* @generated
* @ordered
*/
protected Patient patient;
/**
* The cached value of the '{@link #getTitle() <em>Title</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTitle()
* @generated
* @ordered
*/
protected CodeableConcept title;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String description;
/**
* The cached value of the '{@link #getAuthor() <em>Author</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthor()
* @generated
* @ordered
*/
protected Resource author;
/**
* The cached value of the '{@link #getAuthoringTime() <em>Authoring Time</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthoringTime()
* @generated
* @ordered
*/
protected DateTime authoringTime;
/**
* The cached value of the '{@link #getStudies() <em>Study</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStudies()
* @generated
* @ordered
*/
protected EList<ImagingObjectSelectionStudy> studies;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ImagingObjectSelectionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getImagingObjectSelection();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Oid getUid() {
if (uid != null && uid.eIsProxy()) {
InternalEObject oldUid = (InternalEObject)uid;
uid = (Oid)eResolveProxy(oldUid);
if (uid != oldUid) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMAGING_OBJECT_SELECTION__UID, oldUid, uid));
}
}
return uid;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Oid basicGetUid() {
return uid;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUid(Oid newUid) {
Oid oldUid = uid;
uid = newUid;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMAGING_OBJECT_SELECTION__UID, oldUid, uid));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Patient getPatient() {
if (patient != null && patient.eIsProxy()) {
InternalEObject oldPatient = (InternalEObject)patient;
patient = (Patient)eResolveProxy(oldPatient);
if (patient != oldPatient) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMAGING_OBJECT_SELECTION__PATIENT, oldPatient, patient));
}
}
return patient;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Patient basicGetPatient() {
return patient;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPatient(Patient newPatient) {
Patient oldPatient = patient;
patient = newPatient;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMAGING_OBJECT_SELECTION__PATIENT, oldPatient, patient));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getTitle() {
if (title != null && title.eIsProxy()) {
InternalEObject oldTitle = (InternalEObject)title;
title = (CodeableConcept)eResolveProxy(oldTitle);
if (title != oldTitle) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMAGING_OBJECT_SELECTION__TITLE, oldTitle, title));
}
}
return title;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept basicGetTitle() {
return title;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTitle(CodeableConcept newTitle) {
CodeableConcept oldTitle = title;
title = newTitle;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMAGING_OBJECT_SELECTION__TITLE, oldTitle, title));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getDescription() {
if (description != null && description.eIsProxy()) {
InternalEObject oldDescription = (InternalEObject)description;
description = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldDescription);
if (description != oldDescription) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMAGING_OBJECT_SELECTION__DESCRIPTION, oldDescription, description));
}
}
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(org.eclipse.mdht.uml.fhir.core.datatype.String newDescription) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMAGING_OBJECT_SELECTION__DESCRIPTION, oldDescription, description));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Resource getAuthor() {
if (author != null && author.eIsProxy()) {
InternalEObject oldAuthor = (InternalEObject)author;
author = (Resource)eResolveProxy(oldAuthor);
if (author != oldAuthor) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHOR, oldAuthor, author));
}
}
return author;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Resource basicGetAuthor() {
return author;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAuthor(Resource newAuthor) {
Resource oldAuthor = author;
author = newAuthor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHOR, oldAuthor, author));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DateTime getAuthoringTime() {
if (authoringTime != null && authoringTime.eIsProxy()) {
InternalEObject oldAuthoringTime = (InternalEObject)authoringTime;
authoringTime = (DateTime)eResolveProxy(oldAuthoringTime);
if (authoringTime != oldAuthoringTime) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHORING_TIME, oldAuthoringTime, authoringTime));
}
}
return authoringTime;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DateTime basicGetAuthoringTime() {
return authoringTime;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAuthoringTime(DateTime newAuthoringTime) {
DateTime oldAuthoringTime = authoringTime;
authoringTime = newAuthoringTime;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHORING_TIME, oldAuthoringTime, authoringTime));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ImagingObjectSelectionStudy> getStudies() {
if (studies == null) {
studies = new EObjectContainmentEList<ImagingObjectSelectionStudy>(ImagingObjectSelectionStudy.class, this, FhirResourcePackage.IMAGING_OBJECT_SELECTION__STUDY);
}
return studies;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__STUDY:
return ((InternalEList<?>)getStudies()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__UID:
if (resolve) return getUid();
return basicGetUid();
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__PATIENT:
if (resolve) return getPatient();
return basicGetPatient();
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__TITLE:
if (resolve) return getTitle();
return basicGetTitle();
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__DESCRIPTION:
if (resolve) return getDescription();
return basicGetDescription();
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHOR:
if (resolve) return getAuthor();
return basicGetAuthor();
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHORING_TIME:
if (resolve) return getAuthoringTime();
return basicGetAuthoringTime();
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__STUDY:
return getStudies();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__UID:
setUid((Oid)newValue);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__PATIENT:
setPatient((Patient)newValue);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__TITLE:
setTitle((CodeableConcept)newValue);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__DESCRIPTION:
setDescription((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHOR:
setAuthor((Resource)newValue);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHORING_TIME:
setAuthoringTime((DateTime)newValue);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__STUDY:
getStudies().clear();
getStudies().addAll((Collection<? extends ImagingObjectSelectionStudy>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__UID:
setUid((Oid)null);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__PATIENT:
setPatient((Patient)null);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__TITLE:
setTitle((CodeableConcept)null);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__DESCRIPTION:
setDescription((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHOR:
setAuthor((Resource)null);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHORING_TIME:
setAuthoringTime((DateTime)null);
return;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__STUDY:
getStudies().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__UID:
return uid != null;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__PATIENT:
return patient != null;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__TITLE:
return title != null;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__DESCRIPTION:
return description != null;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHOR:
return author != null;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__AUTHORING_TIME:
return authoringTime != null;
case FhirResourcePackage.IMAGING_OBJECT_SELECTION__STUDY:
return studies != null && !studies.isEmpty();
}
return super.eIsSet(featureID);
}
} //ImagingObjectSelectionImpl