/*******************************************************************************
 *  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.EnumCodingSchemeVersion;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CoronaryArteries;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CoronaryArterySegments;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_CoronaryArteries;
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 CoronaryArteries - CID3015
 */
public class CoronaryArteries_CID3015  
{
	
	/**
	 * The Code Value for template.
	 */
	private String strCodeValue = null;
	/**
	 * The SNOMED CT ID for template.
	 */
	private String strSNOMEDCTID = null;
	/**
	 * The Code Meaning for template.
	 */
	private String strCodeMeaning = null;
	
	/**
	 * The Coding Scheme Designator for template.
	 */
	private String strCodingSchemeDesignator;
	
	/**
	 * The Coding Scheme Version
	 */
	private String strCodingSchemeVersion = null;
	
	/**
	 * Object of CoronaryArterySegments_CID3014
	 */
	private CoronaryArterySegments_CID3014 objCoronaryArterySegments_CID3014 = null;
	
	/**
	 * Instantiates a new CoronaryArteries_CID3015 Template.
	 */
	public CoronaryArteries_CID3015() 
	{
		
	}
	
	/**
	 * Retrieves the value for CodeMeaning
	 * @return strCodeMeaning String value for CodeMeaning
	 */
	public String getCodeMeaning() {
		return strCodeMeaning;
	}

	/**
	 * Retrieves the value for CodeValue
	 * @return strCodeValue String value for CodeValue
	 */
	public String getCodeValue() {
		return strCodeValue;
	}
	/**
	 * Retrieves the value for SNOMED-CT ID.
	 * @return String value for SNOMED-CT ID.
	 */
	public String getSNOMEDCTID() 
	{
		return strSNOMEDCTID;
	}

	/**
	 * Retrieves the value for CodingSchemeDesignator
	 * @return strCodingSchemeDesignator String value for CodingSchemeDesignator
	 */
	public String getCodingSchemeDesignator() {
		return strCodingSchemeDesignator;
	}
	
	/**
	 * Retrieves the value for CodingSchemeVersion
	 * @return strCodingSchemeVersion String value for Coding Scheme Version
	 */
	public String getCodingSchemeVersion() {
		return strCodingSchemeVersion;
	}
	
	/**
	 * Retrieves the value for CodingSchemeVersion
	 * @return strCodingSchemeVersion String value for Coding Scheme Version
	 */
	public CoronaryArterySegments_CID3014 getCoronaryArterySegments_CID3014() 
	{
		if(null == this.objCoronaryArterySegments_CID3014)
this.objCoronaryArterySegments_CID3014 = new CoronaryArterySegments_CID3014();
return this.objCoronaryArterySegments_CID3014;
	}
	
	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumCoronaryArteries Object of EnumCM_CoronaryArteries represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_CoronaryArteries enumCoronaryArteries)
	{
		switch(enumCoronaryArteries)
		{
		case LEFT_ANTERIOR_DESCENDING_CORONARY_ARTERY: this.strCodeValue =EnumCV_CoronaryArteries.LEFT_ANTERIOR_DESCENDING_CORONARY_ARTERY_T_43110.getValue(); break;
		case RIGHT_CORONARY_ARTERY: this.strCodeValue =EnumCV_CoronaryArteries.RIGHT_CORONARY_ARTERY_T_43200.getValue(); break;
		case CIRCUMFLEX_CORONARY_ARTERY: this.strCodeValue =EnumCV_CoronaryArteries.CIRCUMFLEX_CORONARY_ARTERY_T_43120.getValue(); break;
		case LEFT_POSTEROLATERAL_CIRCUMFLEX_CORONARY_ARTERY: this.strCodeValue =EnumCV_CoronaryArteries.LEFT_POSTEROLATERAL_CIRCUMFLEX_CORONARY_ARTERY_T_43125.getValue(); break;
		case LEFTPOSTERIORDESCENDINGCIRCUMFLEX_CORONARYARTERY: this.strCodeValue =EnumCV_CoronaryArteries.LEFTPOSTERIORDESCENDINGCIRCUMFLEX_CORONARYARTERY_T_4312E.getValue(); break;
		case CORONARY_ARTERY_GRAFT: this.strCodeValue =EnumCV_CoronaryArteries.CORONARY_ARTERY_GRAFT_T_41065.getValue(); break;
		}
	}
	
	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumCoronaryArteries Object of EnumCM_CoronaryArteries represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_CoronaryArteries enumCoronaryArteries)
	{
		switch(enumCoronaryArteries)
		{
		case LEFT_ANTERIOR_DESCENDING_CORONARY_ARTERY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.LEFT_ANTERIOR_DESCENDING_CORONARY_ARTERY.getSNOMEDCTID(); break;
		case RIGHT_CORONARY_ARTERY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.RIGHT_CORONARY_ARTERY.getSNOMEDCTID(); break;
		case CIRCUMFLEX_CORONARY_ARTERY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.CIRCUMFLEX_CORONARY_ARTERY.getSNOMEDCTID(); break;
		case LEFT_POSTEROLATERAL_CIRCUMFLEX_CORONARY_ARTERY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.LEFT_POSTEROLATERAL_CIRCUMFLEX_CORONARY_ARTERY.getSNOMEDCTID(); break;
		case LEFTPOSTERIORDESCENDINGCIRCUMFLEX_CORONARYARTERY : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.LEFTPOSTERIORDESCENDINGCIRCUMFLEX_CORONARYARTERY.getSNOMEDCTID(); break;
		case CORONARY_ARTERY_GRAFT : this.strSNOMEDCTID =EnumChestCardiacSNOMEDMap.CORONARY_ARTERY_GRAFT.getSNOMEDCTID(); break;
		}
	}
	/**
	 * Sets the value for ArterialLesionLocation with Coronary Artery.
	 * @param enumValue Enumerated value cabe one of EnumCM_CoronaryArteries,EnumCM_CoronaryArterySegments.
	 */
	public void setCoronaryArteryOrSegment(Enum enumValue)
	{
//		this.strCodeMeaning = enumCoronaryArteries.getValue();
//		this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SNM3.getValue();
//		setCodeValue(enumCoronaryArteries);
		
		if (enumValue instanceof EnumCM_CoronaryArteries) 
		{
			EnumCM_CoronaryArteries new_enumCoronaryArteries = (EnumCM_CoronaryArteries) enumValue;
			this.strCodeMeaning = new_enumCoronaryArteries.getValue();
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
			this.strCodingSchemeVersion = EnumCodingSchemeVersion.NO_VALUE.getValue();
			setCodeValue(new_enumCoronaryArteries);

			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(new_enumCoronaryArteries);
		}
		else if(enumValue instanceof EnumCM_CoronaryArterySegments)
		{
			if(null== this.objCoronaryArterySegments_CID3014)
	this.objCoronaryArterySegments_CID3014 = new CoronaryArterySegments_CID3014();
			
			EnumCM_CoronaryArterySegments new_enumCoronaryArterySegments = (EnumCM_CoronaryArterySegments) enumValue;
			objCoronaryArterySegments_CID3014.setCoronaryArterySegments(new_enumCoronaryArterySegments);
			
			this.strCodeMeaning = objCoronaryArterySegments_CID3014.getCodeMeaning();
			this.strCodeValue = objCoronaryArterySegments_CID3014.getCodeValue();
			this.strCodingSchemeDesignator = objCoronaryArterySegments_CID3014.getCodingSchemeDesignator();
			this.strCodingSchemeVersion = objCoronaryArterySegments_CID3014.getCodingSchemeVersion();
			this.strSNOMEDCTID = objCoronaryArterySegments_CID3014.getSNOMEDCTID();
		}
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
			}
		}
	}

	
	
	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumCoronaryArterySegments Object of EnumCM_CoronaryArterySegments represents Code Meaning.
	 */
//	private void setCodeValue(EnumCM_CoronaryArterySegments enumCoronaryArterySegments)
//	{
//		objCoronaryArterySegments_CID3014.setCodeValue(enumCoronaryArterySegments);
//	}
	
	
	/**
	 * Sets the value for ArterialLesionLocation with Coronary Artery Segments
	 * @param enumCoronaryArterySegments Object of EnumCM_CoronaryArterySegments.
	 */
//	public void setCoronaryArtery(EnumCM_CoronaryArterySegments enumCoronaryArterySegments)
//	{
//		this.strCodeMeaning = enumCoronaryArterySegments.getValue();
//		this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.BARI.getValue();
//		setCodeValue(enumCoronaryArterySegments);
//	}
}
