/*******************************************************************************
 *  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_CTAndMRAnatomyImaged;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AssociationFibers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CommissuralFibers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SpinalCordFibers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CranialNerves;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_LimbicSystemTracts;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ProjectionandThalamicFibers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_FiberTractsInBrainstem;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RespiratoryStatus;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_TractographyAnatomicSites;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_TractographyAnatomicSites;
import cdac.medinfo.sdk.dcm30_04.templates.dicomsnomedmap.EnumAnatomicSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.templates.dicomsnomedmap.EnumDICOMSNOMEDMap;
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 TractographyAnatomicSites CID7710
 */
public class TractographyAnatomicSites_CID7710 {

	/**
	 * 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 FiberTractsInBrainstem_CID7701
	 */
	private FiberTractsInBrainstem_CID7701 objFiberTractsInBrainstemCID7701;
	/**
	 * Object of ProjectionandThalamicFibers_CID7702
	 */
	private ProjectionandThalamicFibers_CID7702 objProjectionandThalamicFibersCID7702;
	/**
	 * Object of AssociationFibers_CID7703
	 */
	private AssociationFibers_CID7703 objAssociationFibersCID7703;
	/**
	 * Object of LimbicSystemTracts_CID7704
	 */
	private LimbicSystemTracts_CID7704 objLimbicSystemTractsCID7704;
	/**
	 * Object of CommissuralFibers_CID7705
	 */
	private CommissuralFibers_CID7705 objCommissuralFibersCID7705;
	/**
	 * Object of CranialNerves_CID7706
	 */
	private CranialNerves_CID7706 objCranialNervesCID7706;
	/**
	 * Object of SpinalCordFibers_CID7707
	 */
	private SpinalCordFibers_CID7707 objSpinalCordFibersCID7707;
	/**
	 * Instantiates a new TractographyAnatomicSites_CID7710 Template 
	 */ 
	public TractographyAnatomicSites_CID7710()
	{

	}

	/**
	 * 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 enumTractographyAnatomicSites Object of EnumCM_TractographyAnatomicSites represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_TractographyAnatomicSites enumTractographyAnatomicSites)
	{
		switch(enumTractographyAnatomicSites)
		{
		case CEREBELLAR_WHITE_MATTER: this.strCodeValue =EnumCV_TractographyAnatomicSites.CEREBELLAR_WHITE_MATTER_T_A6080.getValue(); break;
		case CEREBRAL_WHITE_MATTER: this.strCodeValue =EnumCV_TractographyAnatomicSites.CEREBRAL_WHITE_MATTER_T_A2030.getValue(); break;
		case SPINAL_CORD_WHITE_MATTER: this.strCodeValue =EnumCV_TractographyAnatomicSites.SPINAL_CORD_WHITE_MATTER_T_A7070.getValue(); break;
		case WHITE_MATTER_OF_BRAIN_AND_SPINAL_CORD: this.strCodeValue =EnumCV_TractographyAnatomicSites.WHITE_MATTER_OF_BRAIN_AND_SPINAL_CORD_T_A0095.getValue(); break;
		case PERILESIONAL_WHITE_MATTER: this.strCodeValue =EnumCV_TractographyAnatomicSites.PERILESIONAL_WHITE_MATTER_110706.getValue(); break;
		case PERIPHERAL_NERVE: this.strCodeValue =EnumCV_TractographyAnatomicSites.PERIPHERAL_NERVE_T_A0500.getValue(); break;
		case SKELETAL_MUSCLE: this.strCodeValue =EnumCV_TractographyAnatomicSites.SKELETAL_MUSCLE_T_D0684.getValue(); break;
		case CARDIAC_MUSCLE: this.strCodeValue =EnumCV_TractographyAnatomicSites.CARDIAC_MUSCLE_T_1300D.getValue(); break;
		case PHANTOM: this.strCodeValue =EnumCV_TractographyAnatomicSites.PHANTOM_113681.getValue(); break;
		}
	}

	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumTractographyAnatomicSites Object of EnumCM_TractographyAnatomicSites represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_TractographyAnatomicSites enumTractographyAnatomicSites)
	{
		switch(enumTractographyAnatomicSites)
		{
		case CEREBELLAR_WHITE_MATTER : this.strSNOMEDCTID =EnumAnatomicSNOMEDMap.CEREBELLAR_WHITE_MATTER.getSNOMEDCTID(); break;
		case CEREBRAL_WHITE_MATTER : this.strSNOMEDCTID =EnumAnatomicSNOMEDMap.CEREBRAL_WHITE_MATTER.getSNOMEDCTID(); break;
		case SPINAL_CORD_WHITE_MATTER : this.strSNOMEDCTID =EnumAnatomicSNOMEDMap.SPINAL_CORD_WHITE_MATTER.getSNOMEDCTID(); break;
		case WHITE_MATTER_OF_BRAIN_AND_SPINAL_CORD : this.strSNOMEDCTID =EnumAnatomicSNOMEDMap.WHITE_MATTER_OF_BRAIN_AND_SPINAL_CORD.getSNOMEDCTID(); break;
		case PERIPHERAL_NERVE : this.strSNOMEDCTID =EnumAnatomicSNOMEDMap.PERIPHERAL_NERVE.getSNOMEDCTID(); break;
		case SKELETAL_MUSCLE : this.strSNOMEDCTID =EnumAnatomicSNOMEDMap.SKELETAL_MUSCLE.getSNOMEDCTID(); break;
		case CARDIAC_MUSCLE : this.strSNOMEDCTID =EnumAnatomicSNOMEDMap.CARDIAC_MUSCLE.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for TractographyAnatomicSites
	 * @param enumTractographyAnatomicSites Object of EnumCM_TractographyAnatomicSites.
	 */
	public void setTractographyAnatomicSites(Enum enumValue)
	{
		
		if (enumValue instanceof EnumCM_TractographyAnatomicSites) 
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_TractographyAnatomicSites enumTractographyAnatomicSites = (EnumCM_TractographyAnatomicSites) enumValue;
			/**
			 * Retrieves the value for CodingSchemeDesignator, CodingSchemeVersion and Code Meaning and 
			 * sets the Code Value according to Code Meaning.
			 */
			this.strCodeMeaning = enumTractographyAnatomicSites.getValue();
			if(strCodeMeaning.equalsIgnoreCase(EnumCM_TractographyAnatomicSites.PHANTOM.getValue())||strCodeMeaning.equalsIgnoreCase(EnumCM_TractographyAnatomicSites.PERILESIONAL_WHITE_MATTER.getValue()))
				this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.DCM.getValue();
			else
				this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();			
			/**
			 * set code Value
			 */
			setCodeValue(enumTractographyAnatomicSites);

			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(enumTractographyAnatomicSites);
		}
		else if(enumValue instanceof EnumCM_FiberTractsInBrainstem)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_FiberTractsInBrainstem new_enumFiberTractsInBrainstem = (EnumCM_FiberTractsInBrainstem) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objFiberTractsInBrainstemCID7701)
	this.objFiberTractsInBrainstemCID7701 = new FiberTractsInBrainstem_CID7701();
			this.objFiberTractsInBrainstemCID7701.setFiberTractsInBrainstem(new_enumFiberTractsInBrainstem);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objFiberTractsInBrainstemCID7701.getCodeMeaning();
			this.strCodeValue = objFiberTractsInBrainstemCID7701.getCodeValue();
			this.strCodingSchemeDesignator = objFiberTractsInBrainstemCID7701.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_ProjectionandThalamicFibers)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_ProjectionandThalamicFibers new_enumProjectionandThalamicFibers = (EnumCM_ProjectionandThalamicFibers) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objProjectionandThalamicFibersCID7702)
	this.objProjectionandThalamicFibersCID7702 = new ProjectionandThalamicFibers_CID7702();
			this.objProjectionandThalamicFibersCID7702.setProjectionandThalamicFibers(new_enumProjectionandThalamicFibers);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objProjectionandThalamicFibersCID7702.getCodeMeaning();
			this.strCodeValue = objProjectionandThalamicFibersCID7702.getCodeValue();
			this.strCodingSchemeDesignator = objProjectionandThalamicFibersCID7702.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_AssociationFibers)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_AssociationFibers new_enumAssociationFibers = (EnumCM_AssociationFibers) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objAssociationFibersCID7703)
	this.objAssociationFibersCID7703 = new AssociationFibers_CID7703();
			this.objAssociationFibersCID7703.setAssociationFibers(new_enumAssociationFibers);
			
			/** 
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objAssociationFibersCID7703.getCodeMeaning();
			this.strCodeValue = objAssociationFibersCID7703.getCodeValue();
			this.strCodingSchemeDesignator = objAssociationFibersCID7703.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_LimbicSystemTracts)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_LimbicSystemTracts new_enumLimbicSystemTracts = (EnumCM_LimbicSystemTracts) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objLimbicSystemTractsCID7704)
	this.objLimbicSystemTractsCID7704 = new LimbicSystemTracts_CID7704();
			this.objLimbicSystemTractsCID7704.setLimbicSystemTracts(new_enumLimbicSystemTracts);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objLimbicSystemTractsCID7704.getCodeMeaning();
			this.strCodeValue = objLimbicSystemTractsCID7704.getCodeValue();
			this.strCodingSchemeDesignator = objLimbicSystemTractsCID7704.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_CommissuralFibers)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_CommissuralFibers new_enumCommissuralFibers = (EnumCM_CommissuralFibers) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objCommissuralFibersCID7705)
	this.objCommissuralFibersCID7705 = new CommissuralFibers_CID7705();
			this.objCommissuralFibersCID7705.setCommissuralFibers(new_enumCommissuralFibers);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objCommissuralFibersCID7705.getCodeMeaning();
			this.strCodeValue = objCommissuralFibersCID7705.getCodeValue();
			this.strCodingSchemeDesignator = objCommissuralFibersCID7705.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_CranialNerves)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_CranialNerves new_enumCranialNerves = (EnumCM_CranialNerves) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objCranialNervesCID7706)
	this.objCranialNervesCID7706 = new CranialNerves_CID7706();
			this.objCranialNervesCID7706.setCranialNerves(new_enumCranialNerves);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objCranialNervesCID7706.getCodeMeaning();
			this.strCodeValue = objCranialNervesCID7706.getCodeValue();
			this.strCodingSchemeDesignator = objCranialNervesCID7706.getCodingSchemeDesignator();
		}
		else if(enumValue instanceof EnumCM_SpinalCordFibers)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_SpinalCordFibers new_enumSpinalCordFibers = (EnumCM_SpinalCordFibers) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objSpinalCordFibersCID7707)
	this.objSpinalCordFibersCID7707 = new SpinalCordFibers_CID7707();
			this.objSpinalCordFibersCID7707.setSpinalCordFibers(new_enumSpinalCordFibers);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objSpinalCordFibersCID7707.getCodeMeaning();
			this.strCodeValue = objSpinalCordFibersCID7707.getCodeValue();
			this.strCodingSchemeDesignator = objSpinalCordFibersCID7707.getCodingSchemeDesignator();
		}
		else
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger objDicomLogger = DicomLogger.getLogger();
				objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
			}
		}
	}
}
