/*******************************************************************************
 *  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.dicomsnomedmap.EnumDICOMSNOMEDMap;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SizeDescriptor;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_SizeDescriptor;


/**
 * This class represents SizeDescriptor - CID6118
 */
public class SizeDescriptor_CID6118
{
	
	/**
	 * 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;
	
	/**
	 * Retrieves the value for SNOMED-CT ID.
	 * @return String value for SNOMED-CT ID.
	 */
	public String getSNOMEDCTID() 
	{
		return strSNOMEDCTID;
	}
	/**
	 * Instantiates a new SizeDescriptor_CID6118 Template 
	 */
	public SizeDescriptor_CID6118()
	{

	}

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

	/**
	 * Sets the Code Value according to Code Meaning.
	 * @param enumSizeDescriptor Object of EnumCM_SizeDescriptor represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_SizeDescriptor enumSizeDescriptor)
	{
		switch(enumSizeDescriptor)
		{
		case EXTREMELY_SMALL: this.strCodeValue = EnumCV_SizeDescriptor.EXTREMELY_SMALL_112131.getValue();break;
		case VERY_SMALL: this.strCodeValue = EnumCV_SizeDescriptor.VERY_SMALL_112132.getValue();break;
		case SMALL: this.strCodeValue = EnumCV_SizeDescriptor.SMALL_R_404A8.getValue();break;
		case MEDIUM: this.strCodeValue = EnumCV_SizeDescriptor.MEDIUM_R_404A9.getValue();break;
		case LARGE: this.strCodeValue = EnumCV_SizeDescriptor.LARGE_R_404AA.getValue();break;
		case ENLARGED: this.strCodeValue = EnumCV_SizeDescriptor.ENLARGED_R_40750.getValue();break;
		case TOO_SMALL: this.strCodeValue = EnumCV_SizeDescriptor.TOO_SMALL_112133.getValue();break;
		}
	}
	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumSizeDescriptor Object of EnumCM_SizeDescriptor represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_SizeDescriptor enumSizeDescriptor)
	{
		switch(enumSizeDescriptor)
		{
		
		case SMALL : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.SMALL.getSNOMEDCTID(); break;
		case MEDIUM : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.MEDIUM.getSNOMEDCTID(); break;
		case LARGE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.LARGE.getSNOMEDCTID(); break;
		case ENLARGED : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.ENLARGED.getSNOMEDCTID(); break;
		}
	}
	/**
	 * Sets the value for SizeDescriptor
	 * @param enumSizeDescriptor Object of EnumCM_SizeDescriptor.
	 */
	public void setSizeDescriptor(EnumCM_SizeDescriptor enumSizeDescriptor)
	{
		/**
		 * Retrieves the value for CodingSchemeDesignator, CodingSchemeVersion and Code Meaning and 
		 * sets the Code Value according to Code Meaning.
		 */
		this.strCodeMeaning = enumSizeDescriptor.getValue();
		if(strCodeMeaning.equalsIgnoreCase(EnumCM_SizeDescriptor.EXTREMELY_SMALL.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_SizeDescriptor.VERY_SMALL.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_SizeDescriptor.TOO_SMALL.getValue()))
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.DCM.getValue();
		else
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
		
		/**
		 * set code Value
		 */
		setCodeValue(enumSizeDescriptor);
		/**
		 * set SNOMED-CT ID
		 */
		setSNOMEDCTID(enumSizeDescriptor);
	}
}
