/*******************************************************************************
 *  Copyright 2017-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 cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_StressProtocols;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_UltrasoundProtocolTypes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_UltrasoundProtocolTypes;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
import cdac.medinfo.sdk.dcm30_04.utils.DicomLogger;
import cdac.medinfo.sdk.dcm30_04.utils.ResourceBundleWrapper;

import java.util.Locale;

import cdac.medinfo.sdk.dcm30_04.templates.dicomsnomedmap.EnumChestCardiacSNOMEDMap;

/**
 * This class represents UltrasoundProtocolTypes CID12001
 */
public class UltrasoundProtocolTypes_CID12001 {

	/**
	 * The Code Value for template.
	 */
	private String strCodeValue = null;
	/**
	 * Object of StressProtocols_CID3261
	 */
	private StressProtocols_CID3261 objStressProtocolsCID3261;

	/**
	 * 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;
	/**
	 * Instantiates a new UltrasoundProtocolTypes_CID12001 Template 
	 */
	public UltrasoundProtocolTypes_CID12001()
	{

	}

	/**
	 * 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 Code Value according to Code Meaning.
	 * @param enumUltrasoundProtocolTypes Object of EnumCM_UltrasoundProtocolTypes represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_UltrasoundProtocolTypes enumUltrasoundProtocolTypes)
	{
		switch(enumUltrasoundProtocolTypes) 
		{
		case ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.ECHOCARDIOGRAPHY_P5_B3000.getValue(); break;
		case TRANSESOPHAGEAL_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.TRANSESOPHAGEAL_ECHOCARDIOGRAPHY_P5_B3002.getValue(); break;
		case TRANSTHORACIC_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.TRANSTHORACIC_ECHOCARDIOGRAPHY_P5_B3012.getValue(); break;
		case EPICARDIAL_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.EPICARDIAL_ECHOCARDIOGRAPHY_P0_05F95.getValue(); break;
		case INTRAVASCULAR_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.INTRAVASCULAR_ECHOCARDIOGRAPHY_P5_B3005.getValue(); break;
		case INTRACARDIAC_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.INTRACARDIAC_ECHOCARDIOGRAPHY_P5_B3006.getValue(); break;
		case EXERCISE_STRESS_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.EXERCISE_STRESS_ECHOCARDIOGRAPHY_P5_B3050.getValue(); break;
		case PEDIATRIC_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.PEDIATRIC_ECHOCARDIOGRAPHY_P5_B300F.getValue(); break;
		case INTRAOPERATIVE_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.INTRAOPERATIVE_ECHOCARDIOGRAPHY_P5_B300C.getValue(); break;
		case CONTRAST_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.CONTRAST_ECHOCARDIOGRAPHY_P5_B3090.getValue(); break;
		case FETAL_ECHOCARDIOGRAPHY: this.strCodeValue =EnumCV_UltrasoundProtocolTypes.FETAL_ECHOCARDIOGRAPHY_P5_B8215.getValue(); break;
		}
	}

	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumUltrasoundProtocolTypes Object of EnumCM_UltrasoundProtocolTypes represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_UltrasoundProtocolTypes enumUltrasoundProtocolTypes)
	{
		switch(enumUltrasoundProtocolTypes)
		{
		case ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case TRANSESOPHAGEAL_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.TRANSESOPHAGEAL_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case TRANSTHORACIC_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.TRANSTHORACIC_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case EPICARDIAL_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.EPICARDIAL_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case INTRAVASCULAR_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.INTRAVASCULAR_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case INTRACARDIAC_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.INTRACARDIAC_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case EXERCISE_STRESS_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.EXERCISE_STRESS_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case PEDIATRIC_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.PEDIATRIC_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case INTRAOPERATIVE_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.INTRAOPERATIVE_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case CONTRAST_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.CONTRAST_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		case FETAL_ECHOCARDIOGRAPHY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.FETAL_ECHOCARDIOGRAPHY.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for UltrasoundProtocolTypes
	 * @param enumUltrasoundProtocolTypes Object of EnumCM_UltrasoundProtocolTypes.
	 */
	public void setUltrasoundProtocolTypes(Enum enumValue)
	{ 
		if(enumValue instanceof EnumCM_UltrasoundProtocolTypes)
	{
		 /**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_UltrasoundProtocolTypes new_enumUltrasoundProtocolTypes = (EnumCM_UltrasoundProtocolTypes)enumValue;
			
			this.strCodeMeaning = new_enumUltrasoundProtocolTypes.getValue();
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
			/**
			 * set code Value
			 */
			setCodeValue(new_enumUltrasoundProtocolTypes);

			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(new_enumUltrasoundProtocolTypes);
	}
	 else if(enumValue instanceof EnumCM_StressProtocols)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
		 EnumCM_StressProtocols new_enumStressProtocols = (EnumCM_StressProtocols) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objStressProtocolsCID3261)
			this.objStressProtocolsCID3261 = new StressProtocols_CID3261();
			this.objStressProtocolsCID3261.setStressProtocols(new_enumStressProtocols);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objStressProtocolsCID3261.getCodeMeaning();
			this.strCodeValue = objStressProtocolsCID3261.getCodeValue();
			this.strCodingSchemeDesignator = objStressProtocolsCID3261.getCodingSchemeDesignator();
		} 
	else
	{
		if(DicomConfig.createInstance().isLoggingOn())
		{
			DicomLogger objDicomLogger = DicomLogger.getLogger();
			objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
		}
	}	
}
}
