blob: 66fbdc22857851d5de3bf1ae9763b3e8247e3f4f [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.CodeableConcept;
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.MedicationOrderSubstitution;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Medication Order Substitution</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MedicationOrderSubstitutionImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MedicationOrderSubstitutionImpl#getReason <em>Reason</em>}</li>
* </ul>
*
* @generated
*/
public class MedicationOrderSubstitutionImpl extends BackboneElementImpl implements MedicationOrderSubstitution {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected CodeableConcept type;
/**
* The cached value of the '{@link #getReason() <em>Reason</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReason()
* @generated
* @ordered
*/
protected CodeableConcept reason;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MedicationOrderSubstitutionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getMedicationOrderSubstitution();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (CodeableConcept)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept basicGetType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(CodeableConcept newType) {
CodeableConcept oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getReason() {
if (reason != null && reason.eIsProxy()) {
InternalEObject oldReason = (InternalEObject)reason;
reason = (CodeableConcept)eResolveProxy(oldReason);
if (reason != oldReason) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__REASON, oldReason, reason));
}
}
return reason;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept basicGetReason() {
return reason;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReason(CodeableConcept newReason) {
CodeableConcept oldReason = reason;
reason = newReason;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__REASON, oldReason, reason));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__TYPE:
if (resolve) return getType();
return basicGetType();
case FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__REASON:
if (resolve) return getReason();
return basicGetReason();
}
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.MEDICATION_ORDER_SUBSTITUTION__TYPE:
setType((CodeableConcept)newValue);
return;
case FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__REASON:
setReason((CodeableConcept)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__TYPE:
setType((CodeableConcept)null);
return;
case FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__REASON:
setReason((CodeableConcept)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__TYPE:
return type != null;
case FhirResourcePackage.MEDICATION_ORDER_SUBSTITUTION__REASON:
return reason != null;
}
return super.eIsSet(featureID);
}
} //MedicationOrderSubstitutionImpl