| /** |
| */ |
| 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.CodeableConcept; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.Flag; |
| import org.hl7.fhir.FlagStatus; |
| import org.hl7.fhir.Identifier; |
| import org.hl7.fhir.Period; |
| import org.hl7.fhir.Reference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Flag</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getIdentifier <em>Identifier</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getCategory <em>Category</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getStatus <em>Status</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getPeriod <em>Period</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getSubject <em>Subject</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getEncounter <em>Encounter</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getAuthor <em>Author</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.FlagImpl#getCode <em>Code</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class FlagImpl extends DomainResourceImpl implements Flag { |
| /** |
| * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIdentifier() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Identifier> identifier; |
| |
| /** |
| * The cached value of the '{@link #getCategory() <em>Category</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCategory() |
| * @generated |
| * @ordered |
| */ |
| protected CodeableConcept category; |
| |
| /** |
| * The cached value of the '{@link #getStatus() <em>Status</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStatus() |
| * @generated |
| * @ordered |
| */ |
| protected FlagStatus status; |
| |
| /** |
| * The cached value of the '{@link #getPeriod() <em>Period</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPeriod() |
| * @generated |
| * @ordered |
| */ |
| protected Period period; |
| |
| /** |
| * The cached value of the '{@link #getSubject() <em>Subject</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSubject() |
| * @generated |
| * @ordered |
| */ |
| protected Reference subject; |
| |
| /** |
| * The cached value of the '{@link #getEncounter() <em>Encounter</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEncounter() |
| * @generated |
| * @ordered |
| */ |
| protected Reference encounter; |
| |
| /** |
| * The cached value of the '{@link #getAuthor() <em>Author</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAuthor() |
| * @generated |
| * @ordered |
| */ |
| protected Reference author; |
| |
| /** |
| * The cached value of the '{@link #getCode() <em>Code</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCode() |
| * @generated |
| * @ordered |
| */ |
| protected CodeableConcept code; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected FlagImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getFlag(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Identifier> getIdentifier() { |
| if (identifier == null) { |
| identifier = new EObjectContainmentEList<Identifier>(Identifier.class, this, FhirPackage.FLAG__IDENTIFIER); |
| } |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CodeableConcept getCategory() { |
| return category; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCategory(CodeableConcept newCategory, NotificationChain msgs) { |
| CodeableConcept oldCategory = category; |
| category = newCategory; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__CATEGORY, oldCategory, newCategory); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCategory(CodeableConcept newCategory) { |
| if (newCategory != category) { |
| NotificationChain msgs = null; |
| if (category != null) |
| msgs = ((InternalEObject)category).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__CATEGORY, null, msgs); |
| if (newCategory != null) |
| msgs = ((InternalEObject)newCategory).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__CATEGORY, null, msgs); |
| msgs = basicSetCategory(newCategory, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__CATEGORY, newCategory, newCategory)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FlagStatus getStatus() { |
| return status; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetStatus(FlagStatus newStatus, NotificationChain msgs) { |
| FlagStatus oldStatus = status; |
| status = newStatus; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__STATUS, oldStatus, newStatus); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStatus(FlagStatus newStatus) { |
| if (newStatus != status) { |
| NotificationChain msgs = null; |
| if (status != null) |
| msgs = ((InternalEObject)status).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__STATUS, null, msgs); |
| if (newStatus != null) |
| msgs = ((InternalEObject)newStatus).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__STATUS, null, msgs); |
| msgs = basicSetStatus(newStatus, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__STATUS, newStatus, newStatus)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Period getPeriod() { |
| return period; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetPeriod(Period newPeriod, NotificationChain msgs) { |
| Period oldPeriod = period; |
| period = newPeriod; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__PERIOD, oldPeriod, newPeriod); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPeriod(Period newPeriod) { |
| if (newPeriod != period) { |
| NotificationChain msgs = null; |
| if (period != null) |
| msgs = ((InternalEObject)period).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__PERIOD, null, msgs); |
| if (newPeriod != null) |
| msgs = ((InternalEObject)newPeriod).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__PERIOD, null, msgs); |
| msgs = basicSetPeriod(newPeriod, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__PERIOD, newPeriod, newPeriod)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Reference getSubject() { |
| return subject; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetSubject(Reference newSubject, NotificationChain msgs) { |
| Reference oldSubject = subject; |
| subject = newSubject; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__SUBJECT, oldSubject, newSubject); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSubject(Reference newSubject) { |
| if (newSubject != subject) { |
| NotificationChain msgs = null; |
| if (subject != null) |
| msgs = ((InternalEObject)subject).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__SUBJECT, null, msgs); |
| if (newSubject != null) |
| msgs = ((InternalEObject)newSubject).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__SUBJECT, null, msgs); |
| msgs = basicSetSubject(newSubject, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__SUBJECT, newSubject, newSubject)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Reference getEncounter() { |
| return encounter; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetEncounter(Reference newEncounter, NotificationChain msgs) { |
| Reference oldEncounter = encounter; |
| encounter = newEncounter; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__ENCOUNTER, oldEncounter, newEncounter); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEncounter(Reference newEncounter) { |
| if (newEncounter != encounter) { |
| NotificationChain msgs = null; |
| if (encounter != null) |
| msgs = ((InternalEObject)encounter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__ENCOUNTER, null, msgs); |
| if (newEncounter != null) |
| msgs = ((InternalEObject)newEncounter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__ENCOUNTER, null, msgs); |
| msgs = basicSetEncounter(newEncounter, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__ENCOUNTER, newEncounter, newEncounter)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Reference getAuthor() { |
| return author; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetAuthor(Reference newAuthor, NotificationChain msgs) { |
| Reference oldAuthor = author; |
| author = newAuthor; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__AUTHOR, oldAuthor, newAuthor); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAuthor(Reference newAuthor) { |
| if (newAuthor != author) { |
| NotificationChain msgs = null; |
| if (author != null) |
| msgs = ((InternalEObject)author).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__AUTHOR, null, msgs); |
| if (newAuthor != null) |
| msgs = ((InternalEObject)newAuthor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__AUTHOR, null, msgs); |
| msgs = basicSetAuthor(newAuthor, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__AUTHOR, newAuthor, newAuthor)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CodeableConcept getCode() { |
| return code; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCode(CodeableConcept newCode, NotificationChain msgs) { |
| CodeableConcept oldCode = code; |
| code = newCode; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__CODE, oldCode, newCode); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCode(CodeableConcept newCode) { |
| if (newCode != code) { |
| NotificationChain msgs = null; |
| if (code != null) |
| msgs = ((InternalEObject)code).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__CODE, null, msgs); |
| if (newCode != null) |
| msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.FLAG__CODE, null, msgs); |
| msgs = basicSetCode(newCode, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.FLAG__CODE, newCode, newCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.FLAG__IDENTIFIER: |
| return ((InternalEList<?>)getIdentifier()).basicRemove(otherEnd, msgs); |
| case FhirPackage.FLAG__CATEGORY: |
| return basicSetCategory(null, msgs); |
| case FhirPackage.FLAG__STATUS: |
| return basicSetStatus(null, msgs); |
| case FhirPackage.FLAG__PERIOD: |
| return basicSetPeriod(null, msgs); |
| case FhirPackage.FLAG__SUBJECT: |
| return basicSetSubject(null, msgs); |
| case FhirPackage.FLAG__ENCOUNTER: |
| return basicSetEncounter(null, msgs); |
| case FhirPackage.FLAG__AUTHOR: |
| return basicSetAuthor(null, msgs); |
| case FhirPackage.FLAG__CODE: |
| return basicSetCode(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.FLAG__IDENTIFIER: |
| return getIdentifier(); |
| case FhirPackage.FLAG__CATEGORY: |
| return getCategory(); |
| case FhirPackage.FLAG__STATUS: |
| return getStatus(); |
| case FhirPackage.FLAG__PERIOD: |
| return getPeriod(); |
| case FhirPackage.FLAG__SUBJECT: |
| return getSubject(); |
| case FhirPackage.FLAG__ENCOUNTER: |
| return getEncounter(); |
| case FhirPackage.FLAG__AUTHOR: |
| return getAuthor(); |
| case FhirPackage.FLAG__CODE: |
| return getCode(); |
| } |
| 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.FLAG__IDENTIFIER: |
| getIdentifier().clear(); |
| getIdentifier().addAll((Collection<? extends Identifier>)newValue); |
| return; |
| case FhirPackage.FLAG__CATEGORY: |
| setCategory((CodeableConcept)newValue); |
| return; |
| case FhirPackage.FLAG__STATUS: |
| setStatus((FlagStatus)newValue); |
| return; |
| case FhirPackage.FLAG__PERIOD: |
| setPeriod((Period)newValue); |
| return; |
| case FhirPackage.FLAG__SUBJECT: |
| setSubject((Reference)newValue); |
| return; |
| case FhirPackage.FLAG__ENCOUNTER: |
| setEncounter((Reference)newValue); |
| return; |
| case FhirPackage.FLAG__AUTHOR: |
| setAuthor((Reference)newValue); |
| return; |
| case FhirPackage.FLAG__CODE: |
| setCode((CodeableConcept)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.FLAG__IDENTIFIER: |
| getIdentifier().clear(); |
| return; |
| case FhirPackage.FLAG__CATEGORY: |
| setCategory((CodeableConcept)null); |
| return; |
| case FhirPackage.FLAG__STATUS: |
| setStatus((FlagStatus)null); |
| return; |
| case FhirPackage.FLAG__PERIOD: |
| setPeriod((Period)null); |
| return; |
| case FhirPackage.FLAG__SUBJECT: |
| setSubject((Reference)null); |
| return; |
| case FhirPackage.FLAG__ENCOUNTER: |
| setEncounter((Reference)null); |
| return; |
| case FhirPackage.FLAG__AUTHOR: |
| setAuthor((Reference)null); |
| return; |
| case FhirPackage.FLAG__CODE: |
| setCode((CodeableConcept)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.FLAG__IDENTIFIER: |
| return identifier != null && !identifier.isEmpty(); |
| case FhirPackage.FLAG__CATEGORY: |
| return category != null; |
| case FhirPackage.FLAG__STATUS: |
| return status != null; |
| case FhirPackage.FLAG__PERIOD: |
| return period != null; |
| case FhirPackage.FLAG__SUBJECT: |
| return subject != null; |
| case FhirPackage.FLAG__ENCOUNTER: |
| return encounter != null; |
| case FhirPackage.FLAG__AUTHOR: |
| return author != null; |
| case FhirPackage.FLAG__CODE: |
| return code != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //FlagImpl |