/*******************************************************************************
 *  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_CatheterizationProcedurePhase;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ImagingProcedures;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_NonCoronaryTranscatheterInterventions;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ProcedureActionValues;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ProcedureActionValues;
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.EnumDICOMSNOMEDMap;

/**
 * This class represents ProcedureActionValues CID3405
 */
public class ProcedureActionValues_CID3405 {

	/**
	 * The Code Value for template.
	 */
	private String strCodeValue = null;
	/**
	 * Object of CatheterizationProcedurePhase_CID3250
	 */
	private CatheterizationProcedurePhase_CID3250 objCatheterizationProcedurePhaseCID3250;
	/**
	 * Object of NonCoronaryTranscatheterInterventions_CID3406
	 */
	private NonCoronaryTranscatheterInterventions_CID3406 objNonCoronaryTranscatheterInterventionsCID3406;
	/**
	 * Object of ImagingProcedures_CID3428
	 */
	private ImagingProcedures_CID3428 objImagingProcedures_CID3428;

	/**
	 * 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 ProcedureActionValues_CID3405 Template 
	 */
	public ProcedureActionValues_CID3405()
	{

	}

	/**
	 * 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 enumProcedureActionValues Object of EnumCM_ProcedureActionValues represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_ProcedureActionValues enumProcedureActionValues)
	{
		switch(enumProcedureActionValues)
		{
		case ATHERECTOMY: this.strCodeValue =EnumCV_ProcedureActionValues.ATHERECTOMY_P1_30350.getValue(); break;
		case ATHERECTOMY_BY_ROTARY_CUTTER: this.strCodeValue =EnumCV_ProcedureActionValues.ATHERECTOMY_BY_ROTARY_CUTTER_P1_30351.getValue(); break;
		case ATHERECTOMY_BY_LASER: this.strCodeValue =EnumCV_ProcedureActionValues.ATHERECTOMY_BY_LASER_P1_30352.getValue(); break;
		case SELECTIVE_EMBOLIZATION_OF_ARTERY: this.strCodeValue =EnumCV_ProcedureActionValues.SELECTIVE_EMBOLIZATION_OF_ARTERY_P1_30530.getValue(); break;
		case PERCUTANEOUS_TRANSLUMINAL_BALLOON_ANGIOPLASTY: this.strCodeValue =EnumCV_ProcedureActionValues.PERCUTANEOUS_TRANSLUMINAL_BALLOON_ANGIOPLASTY_P5_31500.getValue(); break;
		case TRANSCATHETER_THERAPY_FOR_EMBOLIZATION: this.strCodeValue =EnumCV_ProcedureActionValues.TRANSCATHETER_THERAPY_FOR_EMBOLIZATION_P5_39010.getValue(); break;
		case PERCUTANEOUSRETRIEVALOFINTRAVASCULAR_FOREIGNBODY: this.strCodeValue =EnumCV_ProcedureActionValues.PERCUTANEOUSRETRIEVALOFINTRAVASCULAR_FOREIGNBODY_P5_39050.getValue(); break;
		case STENT_PLACEMENT: this.strCodeValue =EnumCV_ProcedureActionValues.STENT_PLACEMENT_P1_05550.getValue(); break;
		case TRANSCATHETER_DEPLOYMENT_OF_DETACHABLE_BALLOON: this.strCodeValue =EnumCV_ProcedureActionValues.TRANSCATHETER_DEPLOYMENT_OF_DETACHABLE_BALLOON_P5_39015.getValue(); break;
		case PERCUTANEOUSINSERTIONOFINTRAVASCULAR_FILTER: this.strCodeValue =EnumCV_ProcedureActionValues.PERCUTANEOUSINSERTIONOFINTRAVASCULAR_FILTER_P5_39191.getValue(); break;
		}
	}

	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumProcedureActionValues Object of EnumCM_ProcedureActionValues represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_ProcedureActionValues enumProcedureActionValues)
	{
		switch(enumProcedureActionValues)
		{
		case ATHERECTOMY : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.ATHERECTOMY.getSNOMEDCTID(); break;
		case ATHERECTOMY_BY_ROTARY_CUTTER : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.ATHERECTOMY_BY_ROTARY_CUTTER.getSNOMEDCTID(); break;
		case ATHERECTOMY_BY_LASER : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.ATHERECTOMY_BY_LASER.getSNOMEDCTID(); break;
		case SELECTIVE_EMBOLIZATION_OF_ARTERY : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.SELECTIVE_EMBOLIZATION_OF_ARTERY.getSNOMEDCTID(); break;
		case PERCUTANEOUS_TRANSLUMINAL_BALLOON_ANGIOPLASTY : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.PERCUTANEOUS_TRANSLUMINAL_BALLOON_ANGIOPLASTY.getSNOMEDCTID(); break;
		case TRANSCATHETER_THERAPY_FOR_EMBOLIZATION : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.TRANSCATHETER_THERAPY_FOR_EMBOLIZATION.getSNOMEDCTID(); break;
		case PERCUTANEOUSRETRIEVALOFINTRAVASCULAR_FOREIGNBODY : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.PERCUTANEOUSRETRIEVALOFINTRAVASCULAR_FOREIGNBODY.getSNOMEDCTID(); break;
		case STENT_PLACEMENT : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.STENT_PLACEMENT.getSNOMEDCTID(); break;
		case TRANSCATHETER_DEPLOYMENT_OF_DETACHABLE_BALLOON : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.TRANSCATHETER_DEPLOYMENT_OF_DETACHABLE_BALLOON.getSNOMEDCTID(); break;
		case PERCUTANEOUSINSERTIONOFINTRAVASCULAR_FILTER : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.PERCUTANEOUSINSERTIONOFINTRAVASCULAR_FILTER.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for ProcedureActionValues
	 * @param enumProcedureActionValues Object of EnumCM_ProcedureActionValues.
	 */
	public void setProcedureActionValues(Enum enumValue)
	{
		if(enumValue instanceof EnumCM_ProcedureActionValues)
		{
			 /**
				 * Casting EnumValue to required Enum.
				 */
			EnumCM_ProcedureActionValues new_enumProcedureActionValues = (EnumCM_ProcedureActionValues)enumValue;
				
				this.strCodeMeaning = new_enumProcedureActionValues.getValue();
				this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
			
				/**
				 * set code Value
				 */
				setCodeValue(new_enumProcedureActionValues);

				/**
				 * set SNOMED-CT ID
				 */
				setSNOMEDCTID(new_enumProcedureActionValues);
		}
		 else if(enumValue instanceof EnumCM_CatheterizationProcedurePhase)
			{
				/**
				 * Casting EnumValue to required Enum.
				 */
			 EnumCM_CatheterizationProcedurePhase new_enumCatheterizationProcedurePhase = (EnumCM_CatheterizationProcedurePhase) enumValue;
				
				/**
				 * Creating object of require CID with respect to enum and setting value accordingly.
				 */
				if(null== this.objCatheterizationProcedurePhaseCID3250)
				this.objCatheterizationProcedurePhaseCID3250 = new CatheterizationProcedurePhase_CID3250();
				this.objCatheterizationProcedurePhaseCID3250.setCatheterizationProcedurePhase(new_enumCatheterizationProcedurePhase);
				
				/**
				 * Retrieving attributes and setting it to member variables. 
				 */
				this.strCodeMeaning = objCatheterizationProcedurePhaseCID3250.getCodeMeaning();
				this.strCodeValue = objCatheterizationProcedurePhaseCID3250.getCodeValue();
				this.strCodingSchemeDesignator = objCatheterizationProcedurePhaseCID3250.getCodingSchemeDesignator();
				this.strSNOMEDCTID = objCatheterizationProcedurePhaseCID3250.getSNOMEDCTID();
			}	 
		 else if(enumValue instanceof EnumCM_NonCoronaryTranscatheterInterventions)
			{
				/**
				 * Casting EnumValue to required Enum.
				 */
			 EnumCM_NonCoronaryTranscatheterInterventions new_enumNonCoronaryTranscatheterInterventions = (EnumCM_NonCoronaryTranscatheterInterventions) enumValue;
				
				/**
				 * Creating object of require CID with respect to enum and setting value accordingly.
				 */
				if(null== this.objNonCoronaryTranscatheterInterventionsCID3406)
				this.objNonCoronaryTranscatheterInterventionsCID3406 = new NonCoronaryTranscatheterInterventions_CID3406();
				this.objNonCoronaryTranscatheterInterventionsCID3406.setNonCoronaryTranscatheterInterventions(new_enumNonCoronaryTranscatheterInterventions);
				
				/**
				 * Retrieving attributes and setting it to member variables. 
				 */
				this.strCodeMeaning = objNonCoronaryTranscatheterInterventionsCID3406.getCodeMeaning();
				this.strCodeValue = objNonCoronaryTranscatheterInterventionsCID3406.getCodeValue();
				this.strCodingSchemeDesignator = objNonCoronaryTranscatheterInterventionsCID3406.getCodingSchemeDesignator();
			}	 
		 else if(enumValue instanceof EnumCM_ImagingProcedures)
			{
				/**
				 * Casting EnumValue to required Enum.
				 */
			 EnumCM_ImagingProcedures new_enumImagingProcedures = (EnumCM_ImagingProcedures) enumValue;
				
				/**
				 * Creating object of require CID with respect to enum and setting value accordingly.
				 */
				if(null== this.objImagingProcedures_CID3428)
				this.objImagingProcedures_CID3428 = new ImagingProcedures_CID3428();
				this.objImagingProcedures_CID3428.setImagingProcedures(new_enumImagingProcedures);
				
				/**
				 * Retrieving attributes and setting it to member variables. 
				 */
				this.strCodeMeaning = objImagingProcedures_CID3428.getCodeMeaning();
				this.strCodeValue = objImagingProcedures_CID3428.getCodeValue();
				this.strCodingSchemeDesignator = objImagingProcedures_CID3428.getCodingSchemeDesignator();
				this.strSNOMEDCTID = objImagingProcedures_CID3428.getSNOMEDCTID();
			}	 
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
		}
	}
	}
}
