blob: ae898642e8e71f2c2c6ffe3c6ffeed0acf2a89b8 [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.hl7.fhir.Coding;
import org.hl7.fhir.Decimal;
import org.hl7.fhir.ExplanationOfBenefitAdjudication;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Money;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Explanation Of Benefit Adjudication</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ExplanationOfBenefitAdjudicationImpl#getCategory <em>Category</em>}</li>
* <li>{@link org.hl7.fhir.impl.ExplanationOfBenefitAdjudicationImpl#getReason <em>Reason</em>}</li>
* <li>{@link org.hl7.fhir.impl.ExplanationOfBenefitAdjudicationImpl#getAmount <em>Amount</em>}</li>
* <li>{@link org.hl7.fhir.impl.ExplanationOfBenefitAdjudicationImpl#getValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class ExplanationOfBenefitAdjudicationImpl extends BackboneElementImpl implements ExplanationOfBenefitAdjudication {
/**
* The cached value of the '{@link #getCategory() <em>Category</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCategory()
* @generated
* @ordered
*/
protected Coding category;
/**
* The cached value of the '{@link #getReason() <em>Reason</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReason()
* @generated
* @ordered
*/
protected Coding reason;
/**
* The cached value of the '{@link #getAmount() <em>Amount</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAmount()
* @generated
* @ordered
*/
protected Money amount;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected Decimal value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ExplanationOfBenefitAdjudicationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getExplanationOfBenefitAdjudication();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Coding getCategory() {
return category;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCategory(Coding newCategory, NotificationChain msgs) {
Coding oldCategory = category;
category = newCategory;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY, oldCategory, newCategory);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCategory(Coding newCategory) {
if (newCategory != category) {
NotificationChain msgs = null;
if (category != null)
msgs = ((InternalEObject)category).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY, null, msgs);
if (newCategory != null)
msgs = ((InternalEObject)newCategory).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY, null, msgs);
msgs = basicSetCategory(newCategory, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY, newCategory, newCategory));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Coding getReason() {
return reason;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetReason(Coding newReason, NotificationChain msgs) {
Coding oldReason = reason;
reason = newReason;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON, oldReason, newReason);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReason(Coding newReason) {
if (newReason != reason) {
NotificationChain msgs = null;
if (reason != null)
msgs = ((InternalEObject)reason).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON, null, msgs);
if (newReason != null)
msgs = ((InternalEObject)newReason).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON, null, msgs);
msgs = basicSetReason(newReason, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON, newReason, newReason));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Money getAmount() {
return amount;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAmount(Money newAmount, NotificationChain msgs) {
Money oldAmount = amount;
amount = newAmount;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT, oldAmount, newAmount);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAmount(Money newAmount) {
if (newAmount != amount) {
NotificationChain msgs = null;
if (amount != null)
msgs = ((InternalEObject)amount).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT, null, msgs);
if (newAmount != null)
msgs = ((InternalEObject)newAmount).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT, null, msgs);
msgs = basicSetAmount(newAmount, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT, newAmount, newAmount));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Decimal getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetValue(Decimal newValue, NotificationChain msgs) {
Decimal oldValue = value;
value = newValue;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE, oldValue, newValue);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(Decimal newValue) {
if (newValue != value) {
NotificationChain msgs = null;
if (value != null)
msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE, null, msgs);
if (newValue != null)
msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE, null, msgs);
msgs = basicSetValue(newValue, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE, newValue, newValue));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY:
return basicSetCategory(null, msgs);
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON:
return basicSetReason(null, msgs);
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT:
return basicSetAmount(null, msgs);
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE:
return basicSetValue(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.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY:
return getCategory();
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON:
return getReason();
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT:
return getAmount();
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE:
return getValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY:
setCategory((Coding)newValue);
return;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON:
setReason((Coding)newValue);
return;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT:
setAmount((Money)newValue);
return;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE:
setValue((Decimal)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_ADJUDICATION__CATEGORY:
setCategory((Coding)null);
return;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON:
setReason((Coding)null);
return;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT:
setAmount((Money)null);
return;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE:
setValue((Decimal)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__CATEGORY:
return category != null;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__REASON:
return reason != null;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__AMOUNT:
return amount != null;
case FhirPackage.EXPLANATION_OF_BENEFIT_ADJUDICATION__VALUE:
return value != null;
}
return super.eIsSet(featureID);
}
} //ExplanationOfBenefitAdjudicationImpl