| /** |
| */ |
| package org.hl7.fhir.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.hl7.fhir.CodeableConcept; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.ProcedurePerformer; |
| import org.hl7.fhir.Reference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Procedure Performer</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ProcedurePerformerImpl#getActor <em>Actor</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ProcedurePerformerImpl#getRole <em>Role</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ProcedurePerformerImpl extends BackboneElementImpl implements ProcedurePerformer { |
| /** |
| * The cached value of the '{@link #getActor() <em>Actor</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActor() |
| * @generated |
| * @ordered |
| */ |
| protected Reference actor; |
| |
| /** |
| * The cached value of the '{@link #getRole() <em>Role</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRole() |
| * @generated |
| * @ordered |
| */ |
| protected CodeableConcept role; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ProcedurePerformerImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getProcedurePerformer(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Reference getActor() { |
| return actor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetActor(Reference newActor, NotificationChain msgs) { |
| Reference oldActor = actor; |
| actor = newActor; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_PERFORMER__ACTOR, oldActor, newActor); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setActor(Reference newActor) { |
| if (newActor != actor) { |
| NotificationChain msgs = null; |
| if (actor != null) |
| msgs = ((InternalEObject)actor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_PERFORMER__ACTOR, null, msgs); |
| if (newActor != null) |
| msgs = ((InternalEObject)newActor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_PERFORMER__ACTOR, null, msgs); |
| msgs = basicSetActor(newActor, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_PERFORMER__ACTOR, newActor, newActor)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CodeableConcept getRole() { |
| return role; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetRole(CodeableConcept newRole, NotificationChain msgs) { |
| CodeableConcept oldRole = role; |
| role = newRole; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_PERFORMER__ROLE, oldRole, newRole); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRole(CodeableConcept newRole) { |
| if (newRole != role) { |
| NotificationChain msgs = null; |
| if (role != null) |
| msgs = ((InternalEObject)role).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_PERFORMER__ROLE, null, msgs); |
| if (newRole != null) |
| msgs = ((InternalEObject)newRole).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_PERFORMER__ROLE, null, msgs); |
| msgs = basicSetRole(newRole, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_PERFORMER__ROLE, newRole, newRole)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.PROCEDURE_PERFORMER__ACTOR: |
| return basicSetActor(null, msgs); |
| case FhirPackage.PROCEDURE_PERFORMER__ROLE: |
| return basicSetRole(null, 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 FhirPackage.PROCEDURE_PERFORMER__ACTOR: |
| return getActor(); |
| case FhirPackage.PROCEDURE_PERFORMER__ROLE: |
| return getRole(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirPackage.PROCEDURE_PERFORMER__ACTOR: |
| setActor((Reference)newValue); |
| return; |
| case FhirPackage.PROCEDURE_PERFORMER__ROLE: |
| setRole((CodeableConcept)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.PROCEDURE_PERFORMER__ACTOR: |
| setActor((Reference)null); |
| return; |
| case FhirPackage.PROCEDURE_PERFORMER__ROLE: |
| setRole((CodeableConcept)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.PROCEDURE_PERFORMER__ACTOR: |
| return actor != null; |
| case FhirPackage.PROCEDURE_PERFORMER__ROLE: |
| return role != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ProcedurePerformerImpl |