blob: 15cfcefeed97ca96adc9a5368e8d22c52fb041c2 [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 org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.mdht.uml.fhir.core.datatype.Code;
import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
import org.eclipse.mdht.uml.fhir.core.resource.Patient;
import org.eclipse.mdht.uml.fhir.core.resource.PatientLink;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Patient Link</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.PatientLinkImpl#getOther <em>Other</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.PatientLinkImpl#getType <em>Type</em>}</li>
* </ul>
*
* @generated
*/
public class PatientLinkImpl extends BackboneElementImpl implements PatientLink {
/**
* The cached value of the '{@link #getOther() <em>Other</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOther()
* @generated
* @ordered
*/
protected Patient other;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected Code type;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PatientLinkImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getPatientLink();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Patient getOther() {
if (other != null && other.eIsProxy()) {
InternalEObject oldOther = (InternalEObject)other;
other = (Patient)eResolveProxy(oldOther);
if (other != oldOther) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.PATIENT_LINK__OTHER, oldOther, other));
}
}
return other;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Patient basicGetOther() {
return other;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOther(Patient newOther) {
Patient oldOther = other;
other = newOther;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.PATIENT_LINK__OTHER, oldOther, other));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (Code)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.PATIENT_LINK__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Code newType) {
Code oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.PATIENT_LINK__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.PATIENT_LINK__OTHER:
if (resolve) return getOther();
return basicGetOther();
case FhirResourcePackage.PATIENT_LINK__TYPE:
if (resolve) return getType();
return basicGetType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirResourcePackage.PATIENT_LINK__OTHER:
setOther((Patient)newValue);
return;
case FhirResourcePackage.PATIENT_LINK__TYPE:
setType((Code)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.PATIENT_LINK__OTHER:
setOther((Patient)null);
return;
case FhirResourcePackage.PATIENT_LINK__TYPE:
setType((Code)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.PATIENT_LINK__OTHER:
return other != null;
case FhirResourcePackage.PATIENT_LINK__TYPE:
return type != null;
}
return super.eIsSet(featureID);
}
} //PatientLinkImpl