/*******************************************************************************
 *  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 cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AnatomicPathologySpecimenTypes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BreastTissueSpecimenTypes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_AnatomicPathologySpecimenTypes;
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 AnatomicPathologySpecimenTypes CID8103
 */
public class AnatomicPathologySpecimenTypes_CID8103 {

	/**
	 * The Code Value for template.
	 */
	private String strCodeValue = null;
	/**
	 * Object of BreastTissueSpecimenTypes_CID8104
	 */
	private BreastTissueSpecimenTypes_CID8104 objBreastTissueSpecimenTypesCID8104;

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

	}

	/**
	 * 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 enumAnatomicPathologySpecimenTypes Object of EnumCM_AnatomicPathologySpecimenTypes represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_AnatomicPathologySpecimenTypes enumAnatomicPathologySpecimenTypes)
	{
		switch(enumAnatomicPathologySpecimenTypes)
		{
		case ENTIRE_BODY: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.ENTIRE_BODY_T_D0010.getValue(); break;
		case BODY_SUBSTANCE_SAMPLE: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.BODY_SUBSTANCE_SAMPLE_G_80A5.getValue(); break;
		case BODY_FLUID_SAMPLE: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.BODY_FLUID_SAMPLE_G_80A6.getValue(); break;
		case TISSUE_SPECIMEN: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.TISSUE_SPECIMEN_G_8300.getValue(); break;
		case GROSS_SPECIMEN: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.GROSS_SPECIMEN_G_843A.getValue(); break;
		case TISSUE_SECTION: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.TISSUE_SECTION_G_8439.getValue(); break;
		case CORE_SAMPLE_OF_TISSUE_BLOCK: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.CORE_SAMPLE_OF_TISSUE_BLOCK_G_843B.getValue(); break;
		case TISSUE_SPOT: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.TISSUE_SPOT_G_843C.getValue(); break;
		case SLIDE: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.SLIDE_G_81EA.getValue(); break;
		case SMEAR_SAMPLE: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.SMEAR_SAMPLE_G_803C.getValue(); break;
		case TOUCH_PREPARATION_CYTOLOGIC_MATERIAL: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.TOUCH_PREPARATION_CYTOLOGIC_MATERIAL_T_1A404.getValue(); break;
		case LIQUID_BASED_CYTOLOGIC_MATERIAL: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.LIQUID_BASED_CYTOLOGIC_MATERIAL_T_1A403.getValue(); break;
		case ASPIRATE: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.ASPIRATE_G_8003.getValue(); break;
		case GENETIC_SAMPLE: this.strCodeValue =EnumCV_AnatomicPathologySpecimenTypes.GENETIC_SAMPLE_G_81A0.getValue(); break;
		}
	}

	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumAnatomicPathologySpecimenTypes Object of EnumCM_AnatomicPathologySpecimenTypes represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_AnatomicPathologySpecimenTypes enumAnatomicPathologySpecimenTypes)
	{
		switch(enumAnatomicPathologySpecimenTypes)
		{
		case ENTIRE_BODY : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.ENTIRE_BODY.getSNOMEDCTID(); break;
		case BODY_SUBSTANCE_SAMPLE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.BODY_SUBSTANCE_SAMPLE.getSNOMEDCTID(); break;
		case BODY_FLUID_SAMPLE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.BODY_FLUID_SAMPLE.getSNOMEDCTID(); break;
		case TISSUE_SPECIMEN : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.TISSUE_SPECIMEN.getSNOMEDCTID(); break;
		case GROSS_SPECIMEN : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.GROSS_SPECIMEN.getSNOMEDCTID(); break;
		case TISSUE_SECTION : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.TISSUE_SECTION.getSNOMEDCTID(); break;
		case CORE_SAMPLE_OF_TISSUE_BLOCK : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.CORE_SAMPLE_OF_TISSUE_BLOCK.getSNOMEDCTID(); break;
		case TISSUE_SPOT : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.TISSUE_SPOT.getSNOMEDCTID(); break;
		case SLIDE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.SLIDE.getSNOMEDCTID(); break;
		case SMEAR_SAMPLE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.SMEAR_SAMPLE.getSNOMEDCTID(); break;
		case TOUCH_PREPARATION_CYTOLOGIC_MATERIAL : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.TOUCH_PREPARATION_CYTOLOGIC_MATERIAL.getSNOMEDCTID(); break;
		case LIQUID_BASED_CYTOLOGIC_MATERIAL : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.LIQUID_BASED_CYTOLOGIC_MATERIAL.getSNOMEDCTID(); break;
		case ASPIRATE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.ASPIRATE.getSNOMEDCTID(); break;
		case GENETIC_SAMPLE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.GENETIC_SAMPLE.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for AnatomicPathologySpecimenTypes
	 * @param enumAnatomicPathologySpecimenTypes Object of EnumCM_AnatomicPathologySpecimenTypes.
	 */
	public void setAnatomicPathologySpecimenTypes(Enum enumValue)
	{
		if(enumValue instanceof EnumCM_AnatomicPathologySpecimenTypes)
	{
		 /**
			 * Casting EnumValue to required Enum.
			 */
			EnumCM_AnatomicPathologySpecimenTypes new_enumAnatomicPathologySpecimenTypes = (EnumCM_AnatomicPathologySpecimenTypes)enumValue;
			
			this.strCodeMeaning = new_enumAnatomicPathologySpecimenTypes.getValue();
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
			/**
			 * set code Value
			 */
			setCodeValue(new_enumAnatomicPathologySpecimenTypes);

			/**
			 * set SNOMED-CT ID
			 */
			setSNOMEDCTID(new_enumAnatomicPathologySpecimenTypes);
	}
	 else if(enumValue instanceof EnumCM_BreastTissueSpecimenTypes)
		{
			/**
			 * Casting EnumValue to required Enum.
			 */
		 EnumCM_BreastTissueSpecimenTypes new_enumBreastTissueSpecimenTypes = (EnumCM_BreastTissueSpecimenTypes) enumValue;
			
			/**
			 * Creating object of require CID with respect to enum and setting value accordingly.
			 */
			if(null== this.objBreastTissueSpecimenTypesCID8104)
			this.objBreastTissueSpecimenTypesCID8104 = new BreastTissueSpecimenTypes_CID8104();
			this.objBreastTissueSpecimenTypesCID8104.setBreastTissueSpecimenTypes(new_enumBreastTissueSpecimenTypes);
			
			/**
			 * Retrieving attributes and setting it to member variables. 
			 */
			this.strCodeMeaning = objBreastTissueSpecimenTypesCID8104.getCodeMeaning();
			this.strCodeValue = objBreastTissueSpecimenTypesCID8104.getCodeValue();
			this.strCodingSchemeDesignator = objBreastTissueSpecimenTypesCID8104.getCodingSchemeDesignator();
			this.strSNOMEDCTID = objBreastTissueSpecimenTypesCID8104.getSNOMEDCTID();
		}	 
	else
	{
		if(DicomConfig.createInstance().isLoggingOn())
		{
			DicomLogger objDicomLogger = DicomLogger.getLogger();
			objDicomLogger.log(ResourceBundleWrapper.getValue("warning","InvalidEnumeratedValue",new Locale(DicomConfig.createInstance().getLocale())));
	}
}
	}
}
