| /** |
| */ |
| 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.Expression; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.MeasureComponent; |
| import org.hl7.fhir.MeasureStratifier; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Measure Stratifier</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.MeasureStratifierImpl#getCode <em>Code</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.MeasureStratifierImpl#getDescription <em>Description</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.MeasureStratifierImpl#getCriteria <em>Criteria</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.MeasureStratifierImpl#getComponent <em>Component</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class MeasureStratifierImpl extends BackboneElementImpl implements MeasureStratifier { |
| /** |
| * 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; |
| |
| /** |
| * The cached value of the '{@link #getDescription() <em>Description</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.String description; |
| |
| /** |
| * The cached value of the '{@link #getCriteria() <em>Criteria</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCriteria() |
| * @generated |
| * @ordered |
| */ |
| protected Expression criteria; |
| |
| /** |
| * The cached value of the '{@link #getComponent() <em>Component</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getComponent() |
| * @generated |
| * @ordered |
| */ |
| protected EList<MeasureComponent> component; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MeasureStratifierImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getMeasureStratifier(); |
| } |
| |
| /** |
| * <!-- 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.MEASURE_STRATIFIER__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.MEASURE_STRATIFIER__CODE, null, msgs); |
| if (newCode != null) |
| msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MEASURE_STRATIFIER__CODE, null, msgs); |
| msgs = basicSetCode(newCode, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MEASURE_STRATIFIER__CODE, newCode, newCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.String getDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetDescription(org.hl7.fhir.String newDescription, NotificationChain msgs) { |
| org.hl7.fhir.String oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MEASURE_STRATIFIER__DESCRIPTION, oldDescription, newDescription); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(org.hl7.fhir.String newDescription) { |
| if (newDescription != description) { |
| NotificationChain msgs = null; |
| if (description != null) |
| msgs = ((InternalEObject)description).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MEASURE_STRATIFIER__DESCRIPTION, null, msgs); |
| if (newDescription != null) |
| msgs = ((InternalEObject)newDescription).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MEASURE_STRATIFIER__DESCRIPTION, null, msgs); |
| msgs = basicSetDescription(newDescription, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MEASURE_STRATIFIER__DESCRIPTION, newDescription, newDescription)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Expression getCriteria() { |
| return criteria; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCriteria(Expression newCriteria, NotificationChain msgs) { |
| Expression oldCriteria = criteria; |
| criteria = newCriteria; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MEASURE_STRATIFIER__CRITERIA, oldCriteria, newCriteria); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCriteria(Expression newCriteria) { |
| if (newCriteria != criteria) { |
| NotificationChain msgs = null; |
| if (criteria != null) |
| msgs = ((InternalEObject)criteria).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MEASURE_STRATIFIER__CRITERIA, null, msgs); |
| if (newCriteria != null) |
| msgs = ((InternalEObject)newCriteria).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MEASURE_STRATIFIER__CRITERIA, null, msgs); |
| msgs = basicSetCriteria(newCriteria, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MEASURE_STRATIFIER__CRITERIA, newCriteria, newCriteria)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<MeasureComponent> getComponent() { |
| if (component == null) { |
| component = new EObjectContainmentEList<MeasureComponent>(MeasureComponent.class, this, FhirPackage.MEASURE_STRATIFIER__COMPONENT); |
| } |
| return component; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.MEASURE_STRATIFIER__CODE: |
| return basicSetCode(null, msgs); |
| case FhirPackage.MEASURE_STRATIFIER__DESCRIPTION: |
| return basicSetDescription(null, msgs); |
| case FhirPackage.MEASURE_STRATIFIER__CRITERIA: |
| return basicSetCriteria(null, msgs); |
| case FhirPackage.MEASURE_STRATIFIER__COMPONENT: |
| return ((InternalEList<?>)getComponent()).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.MEASURE_STRATIFIER__CODE: |
| return getCode(); |
| case FhirPackage.MEASURE_STRATIFIER__DESCRIPTION: |
| return getDescription(); |
| case FhirPackage.MEASURE_STRATIFIER__CRITERIA: |
| return getCriteria(); |
| case FhirPackage.MEASURE_STRATIFIER__COMPONENT: |
| return getComponent(); |
| } |
| 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.MEASURE_STRATIFIER__CODE: |
| setCode((CodeableConcept)newValue); |
| return; |
| case FhirPackage.MEASURE_STRATIFIER__DESCRIPTION: |
| setDescription((org.hl7.fhir.String)newValue); |
| return; |
| case FhirPackage.MEASURE_STRATIFIER__CRITERIA: |
| setCriteria((Expression)newValue); |
| return; |
| case FhirPackage.MEASURE_STRATIFIER__COMPONENT: |
| getComponent().clear(); |
| getComponent().addAll((Collection<? extends MeasureComponent>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.MEASURE_STRATIFIER__CODE: |
| setCode((CodeableConcept)null); |
| return; |
| case FhirPackage.MEASURE_STRATIFIER__DESCRIPTION: |
| setDescription((org.hl7.fhir.String)null); |
| return; |
| case FhirPackage.MEASURE_STRATIFIER__CRITERIA: |
| setCriteria((Expression)null); |
| return; |
| case FhirPackage.MEASURE_STRATIFIER__COMPONENT: |
| getComponent().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.MEASURE_STRATIFIER__CODE: |
| return code != null; |
| case FhirPackage.MEASURE_STRATIFIER__DESCRIPTION: |
| return description != null; |
| case FhirPackage.MEASURE_STRATIFIER__CRITERIA: |
| return criteria != null; |
| case FhirPackage.MEASURE_STRATIFIER__COMPONENT: |
| return component != null && !component.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //MeasureStratifierImpl |