| /** |
| */ |
| 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.CarePlanParticipant; |
| import org.hl7.fhir.CodeableConcept; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.Reference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Care Plan Participant</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.CarePlanParticipantImpl#getRole <em>Role</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.CarePlanParticipantImpl#getMember <em>Member</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CarePlanParticipantImpl extends BackboneElementImpl implements CarePlanParticipant { |
| /** |
| * 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; |
| |
| /** |
| * The cached value of the '{@link #getMember() <em>Member</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMember() |
| * @generated |
| * @ordered |
| */ |
| protected Reference member; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CarePlanParticipantImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getCarePlanParticipant(); |
| } |
| |
| /** |
| * <!-- 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.CARE_PLAN_PARTICIPANT__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.CARE_PLAN_PARTICIPANT__ROLE, null, msgs); |
| if (newRole != null) |
| msgs = ((InternalEObject)newRole).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CARE_PLAN_PARTICIPANT__ROLE, null, msgs); |
| msgs = basicSetRole(newRole, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CARE_PLAN_PARTICIPANT__ROLE, newRole, newRole)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Reference getMember() { |
| return member; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetMember(Reference newMember, NotificationChain msgs) { |
| Reference oldMember = member; |
| member = newMember; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER, oldMember, newMember); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMember(Reference newMember) { |
| if (newMember != member) { |
| NotificationChain msgs = null; |
| if (member != null) |
| msgs = ((InternalEObject)member).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER, null, msgs); |
| if (newMember != null) |
| msgs = ((InternalEObject)newMember).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER, null, msgs); |
| msgs = basicSetMember(newMember, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER, newMember, newMember)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.CARE_PLAN_PARTICIPANT__ROLE: |
| return basicSetRole(null, msgs); |
| case FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER: |
| return basicSetMember(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.CARE_PLAN_PARTICIPANT__ROLE: |
| return getRole(); |
| case FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER: |
| return getMember(); |
| } |
| 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.CARE_PLAN_PARTICIPANT__ROLE: |
| setRole((CodeableConcept)newValue); |
| return; |
| case FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER: |
| setMember((Reference)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.CARE_PLAN_PARTICIPANT__ROLE: |
| setRole((CodeableConcept)null); |
| return; |
| case FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER: |
| setMember((Reference)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.CARE_PLAN_PARTICIPANT__ROLE: |
| return role != null; |
| case FhirPackage.CARE_PLAN_PARTICIPANT__MEMBER: |
| return member != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //CarePlanParticipantImpl |