/*******************************************************************************
 *  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.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CardiacUltrasoundCommonLinearMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CardiacUltrasoundLinearValveMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_CardiacUltrasoundLinearValveMeasurements;
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 CardiacUltrasoundLinearValveMeasurements - CID12251
 */
public class CardiacUltrasoundLinearValveMeasurements_CID12251 
{
	
	/**
	 * 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 CardiacUltrasoundCommonLinearMeasurements_CID12250 
	 */
	private CardiacUltrasoundCommonLinearMeasurements_CID12250 objCardiacUltrasoundCommonLinearMeasurementsCID12250;

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

	}

	/**
	 * Retrieves the value for Code Meaning.
	 * @return String value for Code Meaning.
	 */
	public String getCodeMeaning()
	{
		return strCodeMeaning;
	}
	/**
	 * Retrieves the value for SNOMED-CT ID.
	 * @return String value for SNOMED-CT ID.
	 */
	public String getSNOMEDCTID() 
	{
		return strSNOMEDCTID;
	}
	/**
	 * 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;
	}

	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumCardiacUltrasoundLinearValveMeasurements Object of EnumCM_CardiacUltrasoundLinearValveMeasurements represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_CardiacUltrasoundLinearValveMeasurements enumCardiacUltrasoundLinearValveMeasurements)
	{
		switch(enumCardiacUltrasoundLinearValveMeasurements)
		{
		case D_E_EXCURSION: this.strCodeValue =EnumCV_CardiacUltrasoundLinearValveMeasurements.D_E_EXCURSION_59091_9.getValue(); break;
		case LEAFLET_SEPARATION: this.strCodeValue =EnumCV_CardiacUltrasoundLinearValveMeasurements.LEAFLET_SEPARATION_59091_10.getValue(); break;
		case LEAFLET_THICKNESS: this.strCodeValue =EnumCV_CardiacUltrasoundLinearValveMeasurements.LEAFLET_THICKNESS_59091_11.getValue(); break;
		case C_E_DISTANCE: this.strCodeValue =EnumCV_CardiacUltrasoundLinearValveMeasurements.C_E_DISTANCE_59091_12.getValue(); break;
		}
	}

	/**
	 * Sets the value for CardiacUltrasoundLinearValveMeasurements
	 * @param enumCardiacUltrasoundLinearValveMeasurements Object of EnumCM_CardiacUltrasoundLinearValveMeasurements.
	 */
		public void setCardiacUltrasoundLinearValveMeasurements(Enum enumValue)
		{
			if (enumValue instanceof EnumCM_CardiacUltrasoundLinearValveMeasurements) 
			{
				/**
				 * Casting EnumValue to required Enum.
				 */
				EnumCM_CardiacUltrasoundLinearValveMeasurements new_enumCardiacUltrasoundLinearValveMeasurements = (EnumCM_CardiacUltrasoundLinearValveMeasurements)enumValue;
				
				this.strCodeMeaning = new_enumCardiacUltrasoundLinearValveMeasurements.getValue();
				this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.LN.getValue();
				/**
				 * set code Value
				 */
				setCodeValue(new_enumCardiacUltrasoundLinearValveMeasurements);

			}
			else if(enumValue instanceof EnumCM_CardiacUltrasoundCommonLinearMeasurements)
			{
				/**
				 * Casting EnumValue to required Enum.
				 */
				EnumCM_CardiacUltrasoundCommonLinearMeasurements new_CardiacUltrasoundCommonLinearMeasurements = (EnumCM_CardiacUltrasoundCommonLinearMeasurements) enumValue;
				
				/**
				 * Creating object of require CID with respect to enum and setting value accordingly.
				 */
				if(null== this.objCardiacUltrasoundCommonLinearMeasurementsCID12250)
				this.objCardiacUltrasoundCommonLinearMeasurementsCID12250 = new CardiacUltrasoundCommonLinearMeasurements_CID12250();
				this.objCardiacUltrasoundCommonLinearMeasurementsCID12250.setCardiacUltrasoundCommonLinearMeasurements(new_CardiacUltrasoundCommonLinearMeasurements);
				
				/**
				 * Retrieving attributes and setting it to member variables. 
				 */
				this.strCodeMeaning = objCardiacUltrasoundCommonLinearMeasurementsCID12250.getCodeMeaning();
				this.strCodeValue = objCardiacUltrasoundCommonLinearMeasurementsCID12250.getCodeValue();
				this.strCodingSchemeDesignator = objCardiacUltrasoundCommonLinearMeasurementsCID12250.getCodingSchemeDesignator();
				this.strSNOMEDCTID = objCardiacUltrasoundCommonLinearMeasurementsCID12250.getSNOMEDCTID();
				
			}
			else
			{
				if(DicomConfig.createInstance().isLoggingOn())
				{
					DicomLogger objDicomLogger = DicomLogger.getLogger();
					objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",
					new Locale(DicomConfig.createInstance().getLocale())));
				}
			}
		
	}
}
