/*******************************************************************************
 *  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 java.util.Locale;

import cdac.medinfo.sdk.dcm30_04.templates.dicomsnomedmap.EnumChestCardiacSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CardiacOutputProperties;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_EchocardiographyCommonMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_EchocardiographyMitralValve;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_OrificeFlowProperties;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_EchocardiographyMitralValve;
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 EchocardiographyMitralValve - CID12207
 */
public class EchocardiographyMitralValve_CID12207 
{
	
	/**
	 * The Code Value for template.
	 */
	private String strCodeValue = null;

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

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

	/**
	 * Object of EchocardiographyCommonMeasurements_CID12220
	 */
	private EchocardiographyCommonMeasurements_CID12220 objCommonMeasurementsCID12220;
	
	/**
	 * Object of OrificeFlowProperties_CID12222
	 */
	private OrificeFlowProperties_CID12222 objOrificeFlowPropertiesCID12222;
	
	/**
	 * Object of CardiacOutputProperties_CID12239
	 */
	private CardiacOutputProperties_CID12239 objCardiacOutputPropertiesCID12239;

	/**
	 * 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;
	}
	

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

	}

	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumEchocardiographyMitralValve Object of EnumCM_EchocardiographyMitralValve represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_EchocardiographyMitralValve enumEchocardiographyMitralValve)
	{
		switch(enumEchocardiographyMitralValve)
		{
		case MITRAL_VALVE_A_WAVE_PEAK_VELOCITY: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_A_WAVE_PEAK_VELOCITY_17978_8.getValue();break;
		case MITRAL_VALVE_E_WAVE_PEAK_VELOCITY: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_E_WAVE_PEAK_VELOCITY_18037_2.getValue();break;
		case MITRAL_VALVE_E_TO_A_RATIO: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_E_TO_A_RATIO_18038_0.getValue();break;
		case MITRAL_VALVE_AT_DT_RATIO: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_AT_DT_RATIO_G_0386.getValue();break;
		case MITRAL_VALVE_E_WAVE_DECELERATION_TIME: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_E_WAVE_DECELERATION_TIME_G_0384.getValue();break;
		case MITRAL_VALVE_E_F_SLOPE_BY_M_MODE: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_E_F_SLOPE_BY_M_MODE_18040_6.getValue();break;
		case MITRAL_VALVE_EPSS_E_WAVE: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_EPSS_E_WAVE_18036_4.getValue();break;
		case MITRAL_VALVE_A_WAVE_DURATION: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_A_WAVE_DURATION_G_0385.getValue();break;
		case MITRAL_VALVE_DIASTOLIC_PEAK_INSTANTANEOUS_GRADIENT: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_DIASTOLIC_PEAK_INSTANTANEOUS_GRADIENT_18057_0.getValue();break;
		case MITRAL_VALVE_CLOSURE_TO_OPENING_TIME: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_VALVE_CLOSURE_TO_OPENING_TIME_G_0387.getValue();break;
		case MITRAL_REGURGITATION_DP_DT_DERIVED_FROM_MITRAL_REGURGITATION_VELOCITY: this.strCodeValue = EnumCV_EchocardiographyMitralValve.MITRAL_REGURGITATION_DP_DT_DERIVED_FROM_MITRAL_REGURGITATION_VELOCITY_18035_6.getValue();break;
		}
	}
	
	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumEchocardiographyMitralValve Object of EnumCM_EchocardiographyMitralValve represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_EchocardiographyMitralValve enumEchocardiographyMitralValve)
	{
		switch(enumEchocardiographyMitralValve)
		{
		case MITRAL_VALVE_AT_DT_RATIO : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.MITRAL_VALVE_AT_DT_RATIO.getSNOMEDCTID(); break;
		case MITRAL_VALVE_E_WAVE_DECELERATION_TIME : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.MITRAL_VALVE_E_WAVE_DECELERATION_TIME.getSNOMEDCTID(); break;
		case MITRAL_VALVE_A_WAVE_DURATION : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.MITRAL_VALVE_A_WAVE_DURATION.getSNOMEDCTID(); break;
		case MITRAL_VALVE_CLOSURE_TO_OPENING_TIME : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.MITRAL_VALVE_CLOSURE_TO_OPENING_TIME.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for EchocardiographyMitralValve
	 * @param enumValue This Enum value can be one of the following enums - EnumEchocardiographyCommonMeasurements, EnumCM_EchocardiographyMitralValve,
	 * or EnumCM_OrificeFlowProperties.
	 */
	public void setEchocardiographyMitralValve(Enum enumValue)
	{
		if (enumValue instanceof EnumCM_EchocardiographyMitralValve) 
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_EchocardiographyMitralValve new_enumEchocardiographyMitralValve = (EnumCM_EchocardiographyMitralValve)enumValue;
			
			this.strCodeMeaning = new_enumEchocardiographyMitralValve.getValue();
			if(this.strCodeMeaning.equalsIgnoreCase(EnumCM_EchocardiographyMitralValve.MITRAL_VALVE_AT_DT_RATIO.getValue())
					|| this.strCodeMeaning.equalsIgnoreCase(EnumCM_EchocardiographyMitralValve.MITRAL_VALVE_E_WAVE_DECELERATION_TIME.getValue())
					|| this.strCodeMeaning.equalsIgnoreCase(EnumCM_EchocardiographyMitralValve.MITRAL_VALVE_A_WAVE_DURATION.getValue())
					|| this.strCodeMeaning.equalsIgnoreCase(EnumCM_EchocardiographyMitralValve.MITRAL_VALVE_CLOSURE_TO_OPENING_TIME.getValue()))
				this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
			else
				this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.LN.getValue();
			/**
			 * set code Value
			 */
			setCodeValue(new_enumEchocardiographyMitralValve);
			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(new_enumEchocardiographyMitralValve);
		}
		else if(enumValue instanceof EnumCM_EchocardiographyCommonMeasurements)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_EchocardiographyCommonMeasurements new_enumEchocardiographyCommonMeasurements = (EnumCM_EchocardiographyCommonMeasurements) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objCommonMeasurementsCID12220)
			this.objCommonMeasurementsCID12220 = new EchocardiographyCommonMeasurements_CID12220();
			this.objCommonMeasurementsCID12220.setEchocardiographyCommonMeasurements(new_enumEchocardiographyCommonMeasurements);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objCommonMeasurementsCID12220.getCodeMeaning();
			this.strCodeValue = objCommonMeasurementsCID12220.getCodeValue();
			this.strCodingSchemeDesignator = objCommonMeasurementsCID12220.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_OrificeFlowProperties)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_OrificeFlowProperties new_enumOrificeFlowProperties = (EnumCM_OrificeFlowProperties) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objOrificeFlowPropertiesCID12222)
			this.objOrificeFlowPropertiesCID12222 = new OrificeFlowProperties_CID12222();
			this.objOrificeFlowPropertiesCID12222.setOrificeFlowProperties(new_enumOrificeFlowProperties);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objOrificeFlowPropertiesCID12222.getCodeMeaning();
			this.strCodeValue = objOrificeFlowPropertiesCID12222.getCodeValue();
			this.strCodingSchemeDesignator = objOrificeFlowPropertiesCID12222.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_CardiacOutputProperties)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_CardiacOutputProperties new_enumCardiacOutputProperties = (EnumCM_CardiacOutputProperties) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objCardiacOutputPropertiesCID12239)
			this.objCardiacOutputPropertiesCID12239 = new CardiacOutputProperties_CID12239();
			this.objCardiacOutputPropertiesCID12239.setCardiacOutputProperties(new_enumCardiacOutputProperties);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objCardiacOutputPropertiesCID12239.getCodeMeaning();
			this.strCodeValue = objCardiacOutputPropertiesCID12239.getCodeValue();
			this.strCodingSchemeDesignator = objCardiacOutputPropertiesCID12239.getCodingSchemeDesignator();
		}
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
			}
		}
	}
}
