| /******************************************************************************* |
| * 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 org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| 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.ClaimPayee; |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| import org.eclipse.mdht.uml.fhir.core.resource.Organization; |
| import org.eclipse.mdht.uml.fhir.core.resource.Patient; |
| import org.eclipse.mdht.uml.fhir.core.resource.Practitioner; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Claim Payee</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ClaimPayeeImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ClaimPayeeImpl#getProvider <em>Provider</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ClaimPayeeImpl#getOrganization <em>Organization</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ClaimPayeeImpl#getPerson <em>Person</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ClaimPayeeImpl extends BackboneElementImpl implements ClaimPayee { |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected Coding type; |
| |
| /** |
| * The cached value of the '{@link #getProvider() <em>Provider</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProvider() |
| * @generated |
| * @ordered |
| */ |
| protected Practitioner provider; |
| |
| /** |
| * The cached value of the '{@link #getOrganization() <em>Organization</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrganization() |
| * @generated |
| * @ordered |
| */ |
| protected Organization organization; |
| |
| /** |
| * The cached value of the '{@link #getPerson() <em>Person</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPerson() |
| * @generated |
| * @ordered |
| */ |
| protected Patient person; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ClaimPayeeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getClaimPayee(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding getType() { |
| if (type != null && type.eIsProxy()) { |
| InternalEObject oldType = (InternalEObject)type; |
| type = (Coding)eResolveProxy(oldType); |
| if (type != oldType) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CLAIM_PAYEE__TYPE, oldType, type)); |
| } |
| } |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding basicGetType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setType(Coding newType) { |
| Coding oldType = type; |
| type = newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CLAIM_PAYEE__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Practitioner getProvider() { |
| if (provider != null && provider.eIsProxy()) { |
| InternalEObject oldProvider = (InternalEObject)provider; |
| provider = (Practitioner)eResolveProxy(oldProvider); |
| if (provider != oldProvider) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CLAIM_PAYEE__PROVIDER, oldProvider, provider)); |
| } |
| } |
| return provider; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Practitioner basicGetProvider() { |
| return provider; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProvider(Practitioner newProvider) { |
| Practitioner oldProvider = provider; |
| provider = newProvider; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CLAIM_PAYEE__PROVIDER, oldProvider, provider)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Organization getOrganization() { |
| if (organization != null && organization.eIsProxy()) { |
| InternalEObject oldOrganization = (InternalEObject)organization; |
| organization = (Organization)eResolveProxy(oldOrganization); |
| if (organization != oldOrganization) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CLAIM_PAYEE__ORGANIZATION, oldOrganization, organization)); |
| } |
| } |
| return organization; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Organization basicGetOrganization() { |
| return organization; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOrganization(Organization newOrganization) { |
| Organization oldOrganization = organization; |
| organization = newOrganization; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CLAIM_PAYEE__ORGANIZATION, oldOrganization, organization)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Patient getPerson() { |
| if (person != null && person.eIsProxy()) { |
| InternalEObject oldPerson = (InternalEObject)person; |
| person = (Patient)eResolveProxy(oldPerson); |
| if (person != oldPerson) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CLAIM_PAYEE__PERSON, oldPerson, person)); |
| } |
| } |
| return person; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Patient basicGetPerson() { |
| return person; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPerson(Patient newPerson) { |
| Patient oldPerson = person; |
| person = newPerson; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CLAIM_PAYEE__PERSON, oldPerson, person)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.CLAIM_PAYEE__TYPE: |
| if (resolve) return getType(); |
| return basicGetType(); |
| case FhirResourcePackage.CLAIM_PAYEE__PROVIDER: |
| if (resolve) return getProvider(); |
| return basicGetProvider(); |
| case FhirResourcePackage.CLAIM_PAYEE__ORGANIZATION: |
| if (resolve) return getOrganization(); |
| return basicGetOrganization(); |
| case FhirResourcePackage.CLAIM_PAYEE__PERSON: |
| if (resolve) return getPerson(); |
| return basicGetPerson(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirResourcePackage.CLAIM_PAYEE__TYPE: |
| setType((Coding)newValue); |
| return; |
| case FhirResourcePackage.CLAIM_PAYEE__PROVIDER: |
| setProvider((Practitioner)newValue); |
| return; |
| case FhirResourcePackage.CLAIM_PAYEE__ORGANIZATION: |
| setOrganization((Organization)newValue); |
| return; |
| case FhirResourcePackage.CLAIM_PAYEE__PERSON: |
| setPerson((Patient)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.CLAIM_PAYEE__TYPE: |
| setType((Coding)null); |
| return; |
| case FhirResourcePackage.CLAIM_PAYEE__PROVIDER: |
| setProvider((Practitioner)null); |
| return; |
| case FhirResourcePackage.CLAIM_PAYEE__ORGANIZATION: |
| setOrganization((Organization)null); |
| return; |
| case FhirResourcePackage.CLAIM_PAYEE__PERSON: |
| setPerson((Patient)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.CLAIM_PAYEE__TYPE: |
| return type != null; |
| case FhirResourcePackage.CLAIM_PAYEE__PROVIDER: |
| return provider != null; |
| case FhirResourcePackage.CLAIM_PAYEE__ORGANIZATION: |
| return organization != null; |
| case FhirResourcePackage.CLAIM_PAYEE__PERSON: |
| return person != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ClaimPayeeImpl |