| /** |
| */ |
| 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.CodeableConcept; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.PatientCommunication; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Patient Communication</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.PatientCommunicationImpl#getLanguage <em>Language</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.PatientCommunicationImpl#getPreferred <em>Preferred</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PatientCommunicationImpl extends BackboneElementImpl implements PatientCommunication { |
| /** |
| * The cached value of the '{@link #getLanguage() <em>Language</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLanguage() |
| * @generated |
| * @ordered |
| */ |
| protected CodeableConcept language; |
| |
| /** |
| * The cached value of the '{@link #getPreferred() <em>Preferred</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPreferred() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.Boolean preferred; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PatientCommunicationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getPatientCommunication(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CodeableConcept getLanguage() { |
| return language; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetLanguage(CodeableConcept newLanguage, NotificationChain msgs) { |
| CodeableConcept oldLanguage = language; |
| language = newLanguage; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PATIENT_COMMUNICATION__LANGUAGE, oldLanguage, newLanguage); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLanguage(CodeableConcept newLanguage) { |
| if (newLanguage != language) { |
| NotificationChain msgs = null; |
| if (language != null) |
| msgs = ((InternalEObject)language).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PATIENT_COMMUNICATION__LANGUAGE, null, msgs); |
| if (newLanguage != null) |
| msgs = ((InternalEObject)newLanguage).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PATIENT_COMMUNICATION__LANGUAGE, null, msgs); |
| msgs = basicSetLanguage(newLanguage, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PATIENT_COMMUNICATION__LANGUAGE, newLanguage, newLanguage)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.Boolean getPreferred() { |
| return preferred; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetPreferred(org.hl7.fhir.Boolean newPreferred, NotificationChain msgs) { |
| org.hl7.fhir.Boolean oldPreferred = preferred; |
| preferred = newPreferred; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PATIENT_COMMUNICATION__PREFERRED, oldPreferred, newPreferred); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPreferred(org.hl7.fhir.Boolean newPreferred) { |
| if (newPreferred != preferred) { |
| NotificationChain msgs = null; |
| if (preferred != null) |
| msgs = ((InternalEObject)preferred).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PATIENT_COMMUNICATION__PREFERRED, null, msgs); |
| if (newPreferred != null) |
| msgs = ((InternalEObject)newPreferred).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PATIENT_COMMUNICATION__PREFERRED, null, msgs); |
| msgs = basicSetPreferred(newPreferred, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PATIENT_COMMUNICATION__PREFERRED, newPreferred, newPreferred)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.PATIENT_COMMUNICATION__LANGUAGE: |
| return basicSetLanguage(null, msgs); |
| case FhirPackage.PATIENT_COMMUNICATION__PREFERRED: |
| return basicSetPreferred(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.PATIENT_COMMUNICATION__LANGUAGE: |
| return getLanguage(); |
| case FhirPackage.PATIENT_COMMUNICATION__PREFERRED: |
| return getPreferred(); |
| } |
| 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.PATIENT_COMMUNICATION__LANGUAGE: |
| setLanguage((CodeableConcept)newValue); |
| return; |
| case FhirPackage.PATIENT_COMMUNICATION__PREFERRED: |
| setPreferred((org.hl7.fhir.Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.PATIENT_COMMUNICATION__LANGUAGE: |
| setLanguage((CodeableConcept)null); |
| return; |
| case FhirPackage.PATIENT_COMMUNICATION__PREFERRED: |
| setPreferred((org.hl7.fhir.Boolean)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.PATIENT_COMMUNICATION__LANGUAGE: |
| return language != null; |
| case FhirPackage.PATIENT_COMMUNICATION__PREFERRED: |
| return preferred != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //PatientCommunicationImpl |