/*******************************************************************************
 *  Copyright 2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.templates.cid;


import java.util.Locale;

import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AngiographicInterventionalDevices;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalibrationObjects;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PhantomDevices;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
import cdac.medinfo.sdk.dcm30_04.utils.DicomLogger;
import cdac.medinfo.sdk.dcm30_04.utils.ResourceBundleWrapper;


/**
 * This class represents General Devices CID 4051
 */
public class GeneralDevices_CID4051 {
	/**
	 * The Code Value for template.
	 */
	private String strCodeValue = null;

	/**
	 * The Code Meaning for template.
	 */
	private String strCodeMeaning = null;

	/**
	 * The Coding Scheme Designator for template.
	 */
	private String strCodingSchemeDesignator;

	/**
	 * The SNOMED CT ID for template.
	 */
	private String strSNOMEDCTID = null;

	/**
	 * Object of AngiographicInterventionalDevices_CID8
	 */
	private AngiographicInterventionalDevices_CID8 objAngiographicInterventionalDevicesCID8;

	/**
	 * Object of CalibrationObjects_CID3451
	 */
	private CalibrationObjects_CID3451 objobjCalibrationObjectsCID3451;

	/**
	 * Object of PhantomDevices_CID4052
	 */
	private PhantomDevices_CID4052 objPhantomDevicesCID4052;

	/**
	 * Instantiates a new GeneralDevices_CID4051 Template 
	 */
	public GeneralDevices_CID4051()
	{

	}

	/**
	 * Retrieves the value for Code Meaning.
	 * @return String value for Code Meaning.
	 */
	public String getCodeMeaning()
	{
		return strCodeMeaning;
	}

	/**
	 * Retrieves the value for Code Value.
	 * @return String value for Code Value.
	 */
	public String getCodeValue() 
	{
		return strCodeValue;
	}

	/**
	 * Retrieves the value for Coding Scheme Designator.
	 * @return String value for Coding Scheme Designator.
	 */
	public String getCodingSchemeDesignator() 
	{
		return strCodingSchemeDesignator;
	}
	/**
	 * Retrieves the value for SNOMED-CT ID.
	 * @return String value for SNOMED-CT ID.
	 */
	public String getSNOMEDCTID() 
	{
		return strSNOMEDCTID;
	}
	/**
	 * Sets the value for CTAndMRAnatomyImaged
	 * @param enumValue This Enum value can be one of the following enums - EnumCM_CTAndMRAnatomyImaged, EnumCM_CalibrationObjects.
	 */
	public void setPrimaryAnatomicStructureForIntraOralAndCraniofacialRadiographyTeeth(Enum enumValue)
	{
		if (enumValue instanceof EnumCM_AngiographicInterventionalDevices) 
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_AngiographicInterventionalDevices enumAngiographicInterventionalDevices = (EnumCM_AngiographicInterventionalDevices)enumValue;
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objAngiographicInterventionalDevicesCID8)
				this.objAngiographicInterventionalDevicesCID8 = new AngiographicInterventionalDevices_CID8();
			this.objAngiographicInterventionalDevicesCID8.setAngiographicInterventionalDevices(enumAngiographicInterventionalDevices);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objAngiographicInterventionalDevicesCID8.getCodeMeaning();
			this.strCodeValue = objAngiographicInterventionalDevicesCID8.getCodeValue();
			this.strCodingSchemeDesignator = objAngiographicInterventionalDevicesCID8.getCodingSchemeDesignator();
			this.strSNOMEDCTID = objAngiographicInterventionalDevicesCID8.getSNOMEDCTID();

		}
		else if(enumValue instanceof EnumCM_CalibrationObjects)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_CalibrationObjects enumCalibrationObjects = (EnumCM_CalibrationObjects) enumValue;

			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objobjCalibrationObjectsCID3451)
				this.objobjCalibrationObjectsCID3451 = new CalibrationObjects_CID3451();
			this.objobjCalibrationObjectsCID3451.setCalibrationObjects(enumCalibrationObjects);

			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objobjCalibrationObjectsCID3451.getCodeMeaning();
			this.strCodeValue = objobjCalibrationObjectsCID3451.getCodeValue();
			this.strCodingSchemeDesignator = objobjCalibrationObjectsCID3451.getCodingSchemeDesignator();
			this.strSNOMEDCTID = objobjCalibrationObjectsCID3451.getSNOMEDCTID();
		}
		else if(enumValue instanceof EnumCM_PhantomDevices)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_PhantomDevices enumPhantomDevices = (EnumCM_PhantomDevices) enumValue;

			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objPhantomDevicesCID4052)
				this.objPhantomDevicesCID4052 = new PhantomDevices_CID4052();
			this.objPhantomDevicesCID4052.setPhantomDevices(enumPhantomDevices);

			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objPhantomDevicesCID4052.getCodeMeaning();
			this.strCodeValue = objPhantomDevicesCID4052.getCodeValue();
			this.strCodingSchemeDesignator = objPhantomDevicesCID4052.getCodingSchemeDesignator();
		}
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
			}
		}
	}

}
