| /******************************************************************************* |
| * Copyright (c) 2016 David Carlson and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.mdht.uml.fhir.core.resource.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| 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.EObjectResolvingEList; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.Coding; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.Coverage; |
| import org.eclipse.mdht.uml.fhir.core.resource.ExplanationOfBenefitCoverage; |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| |
| /** |
| * <!-- 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.eclipse.mdht.uml.fhir.core.resource.impl.ExplanationOfBenefitCoverageImpl#getCoverage <em>Coverage</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ExplanationOfBenefitCoverageImpl#getRelationship <em>Relationship</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ExplanationOfBenefitCoverageImpl#getPreAuthRefs <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>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCoverage() |
| * @generated |
| * @ordered |
| */ |
| protected Coverage coverage; |
| |
| /** |
| * The cached value of the '{@link #getRelationship() <em>Relationship</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRelationship() |
| * @generated |
| * @ordered |
| */ |
| protected Coding relationship; |
| |
| /** |
| * The cached value of the '{@link #getPreAuthRefs() <em>Pre Auth Ref</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPreAuthRefs() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.eclipse.mdht.uml.fhir.core.datatype.String> preAuthRefs; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ExplanationOfBenefitCoverageImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getExplanationOfBenefitCoverage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coverage getCoverage() { |
| if (coverage != null && coverage.eIsProxy()) { |
| InternalEObject oldCoverage = (InternalEObject)coverage; |
| coverage = (Coverage)eResolveProxy(oldCoverage); |
| if (coverage != oldCoverage) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE, oldCoverage, coverage)); |
| } |
| } |
| return coverage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coverage basicGetCoverage() { |
| return coverage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCoverage(Coverage newCoverage) { |
| Coverage oldCoverage = coverage; |
| coverage = newCoverage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE, oldCoverage, coverage)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding getRelationship() { |
| if (relationship != null && relationship.eIsProxy()) { |
| InternalEObject oldRelationship = (InternalEObject)relationship; |
| relationship = (Coding)eResolveProxy(oldRelationship); |
| if (relationship != oldRelationship) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP, oldRelationship, relationship)); |
| } |
| } |
| return relationship; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding basicGetRelationship() { |
| return relationship; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRelationship(Coding newRelationship) { |
| Coding oldRelationship = relationship; |
| relationship = newRelationship; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP, oldRelationship, relationship)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<org.eclipse.mdht.uml.fhir.core.datatype.String> getPreAuthRefs() { |
| if (preAuthRefs == null) { |
| preAuthRefs = new EObjectResolvingEList<org.eclipse.mdht.uml.fhir.core.datatype.String>(org.eclipse.mdht.uml.fhir.core.datatype.String.class, this, FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF); |
| } |
| return preAuthRefs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| if (resolve) return getCoverage(); |
| return basicGetCoverage(); |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| if (resolve) return getRelationship(); |
| return basicGetRelationship(); |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| return getPreAuthRefs(); |
| } |
| 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 FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| setCoverage((Coverage)newValue); |
| return; |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| setRelationship((Coding)newValue); |
| return; |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| getPreAuthRefs().clear(); |
| getPreAuthRefs().addAll((Collection<? extends org.eclipse.mdht.uml.fhir.core.datatype.String>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| setCoverage((Coverage)null); |
| return; |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| setRelationship((Coding)null); |
| return; |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| getPreAuthRefs().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__COVERAGE: |
| return coverage != null; |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__RELATIONSHIP: |
| return relationship != null; |
| case FhirResourcePackage.EXPLANATION_OF_BENEFIT_COVERAGE__PRE_AUTH_REF: |
| return preAuthRefs != null && !preAuthRefs.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ExplanationOfBenefitCoverageImpl |