/*******************************************************************************
 *  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.EnumCodingSchemeVersion;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_LinearMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_LinearMeasurements;


/**
 * This class represents LinearMeasurements - CID7470
 */
public class LinearMeasurements_CID7470 
{
	
	/**
	 * 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 Coding Scheme Version
	 */
	private String strCodingSchemeVersion = null;
	
	/**
	 * The SNOMED CT ID for template.
	 */
	private String strSNOMEDCTID = null;
	/**

	/**
	 * Instantiates a new LinearMeasurements_CID7470 Template.
	 */
	public LinearMeasurements_CID7470() 
	{

	}

	/**
	 * 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 CodingSchemeDesignator
	 * @return strCodingSchemeDesignator String value for CodingSchemeDesignator
	 */
	public String getCodingSchemeDesignator()
	{
		return strCodingSchemeDesignator;
	}

	/**
	 * Retrieves the value for CodingSchemeVersion
	 * @return
	 */
	public String getCodingSchemeVersion() {
		return strCodingSchemeVersion;
	}

	/**
	 * 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 enumLinearMeasurements Object of EnumCM_LinearMeasurements represents Code Meaning.
	 */
	private void setCodeValue(EnumCM_LinearMeasurements enumLinearMeasurements)
	{
		switch(enumLinearMeasurements)
		{
		case LENGTH: this.strCodeValue = EnumCV_LinearMeasurements.LENGTH_G_A22A.getValue();break;
		case PATH_LENGTH: this.strCodeValue = EnumCV_LinearMeasurements.PATH_LENGTH_121211.getValue();break;
		case DISTANCE: this.strCodeValue = EnumCV_LinearMeasurements.DISTANCE_121206.getValue();break;
		case WIDTH: this.strCodeValue = EnumCV_LinearMeasurements.WIDTH_G_A220.getValue();break;
		case DEPTH: this.strCodeValue = EnumCV_LinearMeasurements.DEPTH_G_D785.getValue();break;
		case DIAMETER: this.strCodeValue = EnumCV_LinearMeasurements.DIAMETER_M_02550.getValue();break;
		case LONG_AXIS: this.strCodeValue = EnumCV_LinearMeasurements.LONG_AXIS_G_A185.getValue();break;
		case SHORT_AXIS: this.strCodeValue = EnumCV_LinearMeasurements.SHORT_AXIS_G_A186.getValue();break;
		case MAJOR_AXIS: this.strCodeValue = EnumCV_LinearMeasurements.MAJOR_AXIS_G_A193.getValue();break;
		case MINOR_AXIS: this.strCodeValue = EnumCV_LinearMeasurements.MINOR_AXIS_G_A194.getValue();break;
		case PERPENDICULAR_AXIS: this.strCodeValue = EnumCV_LinearMeasurements.PERPENDICULAR_AXIS_G_A195.getValue();break;
		case RADIUS: this.strCodeValue = EnumCV_LinearMeasurements.RADIUS_G_A196.getValue();break;
		case PERIMETER: this.strCodeValue = EnumCV_LinearMeasurements.PERIMETER_G_A197.getValue();break;
		case CIRCUMFERENCE: this.strCodeValue = EnumCV_LinearMeasurements.CIRCUMFERENCE_M_02560.getValue();break;
		case DIAMETER_OF_CIRCUMSCRIBED_CIRCLE: this.strCodeValue = EnumCV_LinearMeasurements.DIAMETER_OF_CIRCUMSCRIBED_CIRCLE_G_A198.getValue();break;
		}
	}
	/**
	 * Sets the SNOMED-CT ID.
	 * @param enumLinearMeasurements Object of EnumCM_LinearMeasurements represents Code Meaning.
	 */
	private void setSNOMEDCTID(EnumCM_LinearMeasurements enumLinearMeasurements)
	{
		switch(enumLinearMeasurements)
		{
		case LENGTH : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.LENGTH.getSNOMEDCTID(); break;
		case WIDTH : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.WIDTH.getSNOMEDCTID(); break;
		case DEPTH : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.DEPTH.getSNOMEDCTID(); break;
		case DIAMETER : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.DIAMETER.getSNOMEDCTID(); break;
		case LONG_AXIS : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.LONG_AXIS.getSNOMEDCTID(); break;
		case SHORT_AXIS : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.SHORT_AXIS.getSNOMEDCTID(); break;
		case MAJOR_AXIS : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.MAJOR_AXIS.getSNOMEDCTID(); break;
		case MINOR_AXIS : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.MINOR_AXIS.getSNOMEDCTID(); break;
		case PERPENDICULAR_AXIS : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.PERPENDICULAR_AXIS.getSNOMEDCTID(); break;
		case RADIUS : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.RADIUS.getSNOMEDCTID(); break;
		case PERIMETER : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.PERIMETER.getSNOMEDCTID(); break;
		case CIRCUMFERENCE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.CIRCUMFERENCE.getSNOMEDCTID(); break;
		case DIAMETER_OF_CIRCUMSCRIBED_CIRCLE : this.strSNOMEDCTID =EnumDICOMSNOMEDMap.DIAMETER_OF_CIRCUMSCRIBED_CIRCLE.getSNOMEDCTID(); break;
		}
	}

	/**
	 * Sets the value for LinearMeasurements
	 * @param enumLinearMeasurements Enum for LinearMeasurements
	 */
	public void setLinearMeasurements(EnumCM_LinearMeasurements enumLinearMeasurements)
	{
		/**
		 * Retrieves the value for CodingSchemeDesignator, CodingSchemeVersion and Code Meaning and 
		 * sets the Code Value according to Code Meaning.
		 */
		this.strCodeMeaning = enumLinearMeasurements.getValue();
		if(strCodeMeaning.equalsIgnoreCase(EnumCM_LinearMeasurements.PATH_LENGTH.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_LinearMeasurements.DISTANCE.getValue())
				|| strCodeMeaning.equalsIgnoreCase(EnumCM_LinearMeasurements.HEIGHT.getValue()))
		{
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.DCM.getValue();
			this.strCodingSchemeVersion = EnumCodingSchemeVersion.NO_VALUE.getValue();
		}
		else
		{
			this.strCodingSchemeDesignator = EnumCodingSchemeDesignator.SRT.getValue();
		}
		
		/**
		 * set code Value
		 */
		setCodeValue(enumLinearMeasurements);
		
		/**
		 * set SNOMED-CT ID
		 */
		setSNOMEDCTID(enumLinearMeasurements);
	}
}
