| /** |
| */ |
| 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.Coding; |
| import org.hl7.fhir.ExplanationOfBenefitCoverage; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.Reference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Explanation Of Benefit Coverage</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ExplanationOfBenefitCoverageImpl#getCoverage <em>Coverage</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ExplanationOfBenefitCoverageImpl#getRelationship <em>Relationship</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ExplanationOfBenefitCoverageImpl#getPreAuthRef <em>Pre Auth Ref</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ExplanationOfBenefitCoverageImpl extends BackboneElementImpl implements ExplanationOfBenefitCoverage { |
| /** |
| * The cached value of the '{@link #getCoverage() <em>Coverage</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCoverage() |
| * @generated |
| * @ordered |
| */ |
| protected Reference coverage; |
| |
| /** |
| * The cached value of the '{@link #getRelationship() <em>Relationship</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRelationship() |
| * @generated |
| * @ordered |
| */ |
| protected Coding relationship; |
| |
| /** |
| * The cached value of the '{@link #getPreAuthRef() <em>Pre Auth Ref</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPreAuthRef() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.hl7.fhir.String> preAuthRef; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ExplanationOfBenefitCoverageImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getExplanationOfBenefitCoverage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Reference getCoverage() { |
| return coverage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCoverage(Reference newCoverage, NotificationChain msgs) { |
| Reference oldCoverage = coverage; |
| coverage = newCoverage; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE, oldCoverage, newCoverage); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCoverage(Reference newCoverage) { |
| if (newCoverage != coverage) { |
| NotificationChain msgs = null; |
| if (coverage != null) |
| msgs = ((InternalEObject)coverage).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE, null, msgs); |
| if (newCoverage != null) |
| msgs = ((InternalEObject)newCoverage).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE, null, msgs); |
| msgs = basicSetCoverage(newCoverage, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE, newCoverage, newCoverage)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding getRelationship() { |
| return relationship; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetRelationship(Coding newRelationship, NotificationChain msgs) { |
| Coding oldRelationship = relationship; |
| relationship = newRelationship; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP, oldRelationship, newRelationship); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRelationship(Coding newRelationship) { |
| if (newRelationship != relationship) { |
| NotificationChain msgs = null; |
| if (relationship != null) |
| msgs = ((InternalEObject)relationship).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP, null, msgs); |
| if (newRelationship != null) |
| msgs = ((InternalEObject)newRelationship).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP, null, msgs); |
| msgs = basicSetRelationship(newRelationship, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP, newRelationship, newRelationship)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<org.hl7.fhir.String> getPreAuthRef() { |
| if (preAuthRef == null) { |
| preAuthRef = new EObjectContainmentEList<org.hl7.fhir.String>(org.hl7.fhir.String.class, this, FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF); |
| } |
| return preAuthRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| return basicSetCoverage(null, msgs); |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| return basicSetRelationship(null, msgs); |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| return ((InternalEList<?>)getPreAuthRef()).basicRemove(otherEnd, 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.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| return getCoverage(); |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| return getRelationship(); |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| return getPreAuthRef(); |
| } |
| 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.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| setCoverage((Reference)newValue); |
| return; |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| setRelationship((Coding)newValue); |
| return; |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| getPreAuthRef().clear(); |
| getPreAuthRef().addAll((Collection<? extends org.hl7.fhir.String>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| setCoverage((Reference)null); |
| return; |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| setRelationship((Coding)null); |
| return; |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| getPreAuthRef().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| return coverage != null; |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| return relationship != null; |
| case FhirPackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| return preAuthRef != null && !preAuthRef.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ExplanationOfBenefitCoverageImpl |