| /** |
| */ |
| package org.hl7.fhir.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.hl7.fhir.AppointmentParticipant; |
| import org.hl7.fhir.CodeableConcept; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.ParticipantRequired; |
| import org.hl7.fhir.ParticipationStatus; |
| import org.hl7.fhir.Reference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Appointment Participant</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.AppointmentParticipantImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.AppointmentParticipantImpl#getActor <em>Actor</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.AppointmentParticipantImpl#getRequired <em>Required</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.AppointmentParticipantImpl#getStatus <em>Status</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AppointmentParticipantImpl extends BackboneElementImpl implements AppointmentParticipant { |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected EList<CodeableConcept> type; |
| |
| /** |
| * 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 #getRequired() <em>Required</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRequired() |
| * @generated |
| * @ordered |
| */ |
| protected ParticipantRequired required; |
| |
| /** |
| * The cached value of the '{@link #getStatus() <em>Status</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStatus() |
| * @generated |
| * @ordered |
| */ |
| protected ParticipationStatus status; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AppointmentParticipantImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getAppointmentParticipant(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<CodeableConcept> getType() { |
| if (type == null) { |
| type = new EObjectContainmentEList<CodeableConcept>(CodeableConcept.class, this, FhirPackage.APPOINTMENT_PARTICIPANT__TYPE); |
| } |
| return type; |
| } |
| |
| /** |
| * <!-- 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.APPOINTMENT_PARTICIPANT__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.APPOINTMENT_PARTICIPANT__ACTOR, null, msgs); |
| if (newActor != null) |
| msgs = ((InternalEObject)newActor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.APPOINTMENT_PARTICIPANT__ACTOR, null, msgs); |
| msgs = basicSetActor(newActor, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.APPOINTMENT_PARTICIPANT__ACTOR, newActor, newActor)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ParticipantRequired getRequired() { |
| return required; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetRequired(ParticipantRequired newRequired, NotificationChain msgs) { |
| ParticipantRequired oldRequired = required; |
| required = newRequired; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED, oldRequired, newRequired); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRequired(ParticipantRequired newRequired) { |
| if (newRequired != required) { |
| NotificationChain msgs = null; |
| if (required != null) |
| msgs = ((InternalEObject)required).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED, null, msgs); |
| if (newRequired != null) |
| msgs = ((InternalEObject)newRequired).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED, null, msgs); |
| msgs = basicSetRequired(newRequired, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED, newRequired, newRequired)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ParticipationStatus getStatus() { |
| return status; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetStatus(ParticipationStatus newStatus, NotificationChain msgs) { |
| ParticipationStatus oldStatus = status; |
| status = newStatus; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.APPOINTMENT_PARTICIPANT__STATUS, oldStatus, newStatus); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStatus(ParticipationStatus newStatus) { |
| if (newStatus != status) { |
| NotificationChain msgs = null; |
| if (status != null) |
| msgs = ((InternalEObject)status).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.APPOINTMENT_PARTICIPANT__STATUS, null, msgs); |
| if (newStatus != null) |
| msgs = ((InternalEObject)newStatus).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.APPOINTMENT_PARTICIPANT__STATUS, null, msgs); |
| msgs = basicSetStatus(newStatus, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.APPOINTMENT_PARTICIPANT__STATUS, newStatus, newStatus)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.APPOINTMENT_PARTICIPANT__TYPE: |
| return ((InternalEList<?>)getType()).basicRemove(otherEnd, msgs); |
| case FhirPackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| return basicSetActor(null, msgs); |
| case FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| return basicSetRequired(null, msgs); |
| case FhirPackage.APPOINTMENT_PARTICIPANT__STATUS: |
| return basicSetStatus(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.APPOINTMENT_PARTICIPANT__TYPE: |
| return getType(); |
| case FhirPackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| return getActor(); |
| case FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| return getRequired(); |
| case FhirPackage.APPOINTMENT_PARTICIPANT__STATUS: |
| return getStatus(); |
| } |
| 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 FhirPackage.APPOINTMENT_PARTICIPANT__TYPE: |
| getType().clear(); |
| getType().addAll((Collection<? extends CodeableConcept>)newValue); |
| return; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| setActor((Reference)newValue); |
| return; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| setRequired((ParticipantRequired)newValue); |
| return; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__STATUS: |
| setStatus((ParticipationStatus)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.APPOINTMENT_PARTICIPANT__TYPE: |
| getType().clear(); |
| return; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| setActor((Reference)null); |
| return; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| setRequired((ParticipantRequired)null); |
| return; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__STATUS: |
| setStatus((ParticipationStatus)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.APPOINTMENT_PARTICIPANT__TYPE: |
| return type != null && !type.isEmpty(); |
| case FhirPackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| return actor != null; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| return required != null; |
| case FhirPackage.APPOINTMENT_PARTICIPANT__STATUS: |
| return status != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //AppointmentParticipantImpl |