blob: 2e606221b9c41f077bbd6249685bb727cc80055d [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.EncounterLocation;
import org.hl7.fhir.EncounterLocationStatus;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Period;
import org.hl7.fhir.Reference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Encounter Location</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.EncounterLocationImpl#getLocation <em>Location</em>}</li>
* <li>{@link org.hl7.fhir.impl.EncounterLocationImpl#getStatus <em>Status</em>}</li>
* <li>{@link org.hl7.fhir.impl.EncounterLocationImpl#getPeriod <em>Period</em>}</li>
* </ul>
*
* @generated
*/
public class EncounterLocationImpl extends BackboneElementImpl implements EncounterLocation {
/**
* The cached value of the '{@link #getLocation() <em>Location</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLocation()
* @generated
* @ordered
*/
protected Reference location;
/**
* The cached value of the '{@link #getStatus() <em>Status</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStatus()
* @generated
* @ordered
*/
protected EncounterLocationStatus status;
/**
* The cached value of the '{@link #getPeriod() <em>Period</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPeriod()
* @generated
* @ordered
*/
protected Period period;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EncounterLocationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getEncounterLocation();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Reference getLocation() {
return location;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLocation(Reference newLocation, NotificationChain msgs) {
Reference oldLocation = location;
location = newLocation;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ENCOUNTER_LOCATION__LOCATION, oldLocation, newLocation);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLocation(Reference newLocation) {
if (newLocation != location) {
NotificationChain msgs = null;
if (location != null)
msgs = ((InternalEObject)location).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ENCOUNTER_LOCATION__LOCATION, null, msgs);
if (newLocation != null)
msgs = ((InternalEObject)newLocation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ENCOUNTER_LOCATION__LOCATION, null, msgs);
msgs = basicSetLocation(newLocation, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ENCOUNTER_LOCATION__LOCATION, newLocation, newLocation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EncounterLocationStatus getStatus() {
return status;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStatus(EncounterLocationStatus newStatus, NotificationChain msgs) {
EncounterLocationStatus oldStatus = status;
status = newStatus;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ENCOUNTER_LOCATION__STATUS, oldStatus, newStatus);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStatus(EncounterLocationStatus newStatus) {
if (newStatus != status) {
NotificationChain msgs = null;
if (status != null)
msgs = ((InternalEObject)status).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ENCOUNTER_LOCATION__STATUS, null, msgs);
if (newStatus != null)
msgs = ((InternalEObject)newStatus).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ENCOUNTER_LOCATION__STATUS, null, msgs);
msgs = basicSetStatus(newStatus, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ENCOUNTER_LOCATION__STATUS, newStatus, newStatus));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Period getPeriod() {
return period;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPeriod(Period newPeriod, NotificationChain msgs) {
Period oldPeriod = period;
period = newPeriod;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ENCOUNTER_LOCATION__PERIOD, oldPeriod, newPeriod);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPeriod(Period newPeriod) {
if (newPeriod != period) {
NotificationChain msgs = null;
if (period != null)
msgs = ((InternalEObject)period).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ENCOUNTER_LOCATION__PERIOD, null, msgs);
if (newPeriod != null)
msgs = ((InternalEObject)newPeriod).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ENCOUNTER_LOCATION__PERIOD, null, msgs);
msgs = basicSetPeriod(newPeriod, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ENCOUNTER_LOCATION__PERIOD, newPeriod, newPeriod));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.ENCOUNTER_LOCATION__LOCATION:
return basicSetLocation(null, msgs);
case FhirPackage.ENCOUNTER_LOCATION__STATUS:
return basicSetStatus(null, msgs);
case FhirPackage.ENCOUNTER_LOCATION__PERIOD:
return basicSetPeriod(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.ENCOUNTER_LOCATION__LOCATION:
return getLocation();
case FhirPackage.ENCOUNTER_LOCATION__STATUS:
return getStatus();
case FhirPackage.ENCOUNTER_LOCATION__PERIOD:
return getPeriod();
}
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.ENCOUNTER_LOCATION__LOCATION:
setLocation((Reference)newValue);
return;
case FhirPackage.ENCOUNTER_LOCATION__STATUS:
setStatus((EncounterLocationStatus)newValue);
return;
case FhirPackage.ENCOUNTER_LOCATION__PERIOD:
setPeriod((Period)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.ENCOUNTER_LOCATION__LOCATION:
setLocation((Reference)null);
return;
case FhirPackage.ENCOUNTER_LOCATION__STATUS:
setStatus((EncounterLocationStatus)null);
return;
case FhirPackage.ENCOUNTER_LOCATION__PERIOD:
setPeriod((Period)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.ENCOUNTER_LOCATION__LOCATION:
return location != null;
case FhirPackage.ENCOUNTER_LOCATION__STATUS:
return status != null;
case FhirPackage.ENCOUNTER_LOCATION__PERIOD:
return period != null;
}
return super.eIsSet(featureID);
}
} //EncounterLocationImpl