/*******************************************************************************
 *  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.dicomsnomedmap.EnumDICOMSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_IntravascularOCTFlushAgent;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RadiographicContrastAgent;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_IntravascularOCTFlushAgent;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RadiographicContrastAgent;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_IntravascularOCTFlushAgent;
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 Intravascular OCT Flush Agent CID3850
 */
public class IntravascularOCTFlushAgent_CID3850 {

	/**
	 * 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 RadiographicContrastAgent_CID12
	 */
	private RadiographicContrastAgent_CID12 objRadiographicContrastAgentCID12;
	
	/**
	 * Instantiates a new IntravascularOCTFlushAgent_CID3850 Template 
	 */
	public IntravascularOCTFlushAgent_CID3850()
	{

	}

	/**
	 * 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 enumIntravascularOCTFlushAgent Object of EnumCM_IntravascularOCTFlushAgent represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_IntravascularOCTFlushAgent enumIntravascularOCTFlushAgent)
	{
		switch(enumIntravascularOCTFlushAgent)
		{
		case DEXTRAN: this.strCodeValue = EnumCV_IntravascularOCTFlushAgent.DEXTRAN_C_7220.getValue();break;
		case LACTATED_RINGERS: this.strCodeValue = EnumCV_IntravascularOCTFlushAgent.LACTATED_RINGERS_C_70434.getValue();break;
		case SALINE: this.strCodeValue = EnumCV_IntravascularOCTFlushAgent.SALINE_C_70841.getValue();break;
		}
	}

	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumIntravascularOCTFlushAgent Object of EnumCM_IntravascularOCTFlushAgent represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_IntravascularOCTFlushAgent enumIntravascularOCTFlushAgent)
	{
		switch(enumIntravascularOCTFlushAgent)
		{
		case DEXTRAN: this.strSNOMEDCTID = EnumDICOMSNOMEDMap.DEXTRAN.getSNOMEDCTID();break;
		case LACTATED_RINGERS: this.strSNOMEDCTID = EnumDICOMSNOMEDMap.LACTATED_RINGERS.getSNOMEDCTID();break;
		case SALINE: this.strSNOMEDCTID = EnumDICOMSNOMEDMap.SALINE.getSNOMEDCTID();break;

		}
	}

	/**
	 * Sets the value for Intravascular OCT Flush Agent
	 * @param enumValue This Enum value can be one of the following enums - EnumCM_IntravascularOCTFlushAgent, EnumCM_RadiographicContrastAgent.
	 */
	public void setIntravascularOCTFlushAgent(Enum enumValue)
	{
		
		if (enumValue instanceof EnumCM_IntravascularOCTFlushAgent) 
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_IntravascularOCTFlushAgent enumIntravascularOCTFlushAgent = (EnumCM_IntravascularOCTFlushAgent)enumValue;
			/**
			 * Retrieves the value for CodingSchemeDesignator, CodingSchemeVersion and Code Meaning and 
			 * sets the Code Value according to Code Meaning.
			 */
			this.strCodeMeaning = enumIntravascularOCTFlushAgent.getValue();
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
			/**
			 * set code Value
			 */
			setCodeValue(enumIntravascularOCTFlushAgent);

			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(enumIntravascularOCTFlushAgent);
		}
		else if(enumValue instanceof EnumCM_RadiographicContrastAgent)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_RadiographicContrastAgent new_enumRadiographicContrastAgent = (EnumCM_RadiographicContrastAgent) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objRadiographicContrastAgentCID12)
	this.objRadiographicContrastAgentCID12 = new RadiographicContrastAgent_CID12();
			this.objRadiographicContrastAgentCID12.setRadiographicContrastAgent(new_enumRadiographicContrastAgent);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objRadiographicContrastAgentCID12.getCodeMeaning();
			this.strCodeValue = objRadiographicContrastAgentCID12.getCodeValue();
			this.strCodingSchemeDesignator = objRadiographicContrastAgentCID12.getCodingSchemeDesignator();
			this.strSNOMEDCTID = objRadiographicContrastAgentCID12.getSNOMEDCTID();

		}
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
			}
		}
	}
}
