blob: 79910469d818b1df0cc7abeaf41015ca531534d1 [file] [log] [blame]
/*******************************************************************************
* 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.DateTime;
import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
import org.eclipse.mdht.uml.fhir.core.resource.MedicationProductBatch;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Medication Product Batch</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MedicationProductBatchImpl#getLotNumber <em>Lot Number</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MedicationProductBatchImpl#getExpirationDate <em>Expiration Date</em>}</li>
* </ul>
*
* @generated
*/
public class MedicationProductBatchImpl extends BackboneElementImpl implements MedicationProductBatch {
/**
* The cached value of the '{@link #getLotNumber() <em>Lot Number</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLotNumber()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String lotNumber;
/**
* The cached value of the '{@link #getExpirationDate() <em>Expiration Date</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExpirationDate()
* @generated
* @ordered
*/
protected DateTime expirationDate;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MedicationProductBatchImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getMedicationProductBatch();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getLotNumber() {
if (lotNumber != null && lotNumber.eIsProxy()) {
InternalEObject oldLotNumber = (InternalEObject)lotNumber;
lotNumber = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldLotNumber);
if (lotNumber != oldLotNumber) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MEDICATION_PRODUCT_BATCH__LOT_NUMBER, oldLotNumber, lotNumber));
}
}
return lotNumber;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetLotNumber() {
return lotNumber;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLotNumber(org.eclipse.mdht.uml.fhir.core.datatype.String newLotNumber) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldLotNumber = lotNumber;
lotNumber = newLotNumber;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MEDICATION_PRODUCT_BATCH__LOT_NUMBER, oldLotNumber, lotNumber));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DateTime getExpirationDate() {
if (expirationDate != null && expirationDate.eIsProxy()) {
InternalEObject oldExpirationDate = (InternalEObject)expirationDate;
expirationDate = (DateTime)eResolveProxy(oldExpirationDate);
if (expirationDate != oldExpirationDate) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MEDICATION_PRODUCT_BATCH__EXPIRATION_DATE, oldExpirationDate, expirationDate));
}
}
return expirationDate;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DateTime basicGetExpirationDate() {
return expirationDate;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExpirationDate(DateTime newExpirationDate) {
DateTime oldExpirationDate = expirationDate;
expirationDate = newExpirationDate;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MEDICATION_PRODUCT_BATCH__EXPIRATION_DATE, oldExpirationDate, expirationDate));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.MEDICATION_PRODUCT_BATCH__LOT_NUMBER:
if (resolve) return getLotNumber();
return basicGetLotNumber();
case FhirResourcePackage.MEDICATION_PRODUCT_BATCH__EXPIRATION_DATE:
if (resolve) return getExpirationDate();
return basicGetExpirationDate();
}
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.MEDICATION_PRODUCT_BATCH__LOT_NUMBER:
setLotNumber((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.MEDICATION_PRODUCT_BATCH__EXPIRATION_DATE:
setExpirationDate((DateTime)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.MEDICATION_PRODUCT_BATCH__LOT_NUMBER:
setLotNumber((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.MEDICATION_PRODUCT_BATCH__EXPIRATION_DATE:
setExpirationDate((DateTime)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.MEDICATION_PRODUCT_BATCH__LOT_NUMBER:
return lotNumber != null;
case FhirResourcePackage.MEDICATION_PRODUCT_BATCH__EXPIRATION_DATE:
return expirationDate != null;
}
return super.eIsSet(featureID);
}
} //MedicationProductBatchImpl