/*******************************************************************************
 *  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.quantventricularanalysisrepsriodtemplates;

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.enums.EnumContinuityOfContent;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CalibrationMethods_CID3452;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CalibrationObjects_CID3451;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CatheterSizeUnits_CID3510;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalibrationMethods;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalibrationObjects;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalibrationTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CatheterSizeUnits;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_CalibrationTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Measurement_TID300;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents CalibrationTemplate - TID3205
 */
public class CalibrationTemplate_TID3205 extends Template
{
	/**
	 * Object of CalibrationMethods_CID3452
	 */
	private CalibrationMethods_CID3452 objCalibrationMethodsCID3452;

	/**
	 * Object of CalibrationObjects_CID3451
	 */
	private CalibrationObjects_CID3451 objCalibrationObjectsCID3451;

	/**
	 * Object of CatheterSizeUnits_CID3510
	 */
	private CatheterSizeUnits_CID3510 objCatheterSizeUnitsCID3510;
	/**
	 * Object of Measurement_TID300
	 */
	private Measurement_TID300 objMeasurementTID300;
	
	/**
	 * Instantiates CalibrationTemplate_TID3205 Template.
	 * @param objTree Object of SRTree.
	 */
	public CalibrationTemplate_TID3205(SRTree objTree)
	{
		super(objTree);
	}
	/**
	 * Retrieves Measurement 
	 * @return objMeasurementID300 Object of Measurement_TID300 
	 */
	public Measurement_TID300 getMeasurement() 
	{
		if(null == this.objMeasurementTID300)
			this.objMeasurementTID300 = new Measurement_TID300(getSRTree());
		return this.objMeasurementTID300;
	}
	/**
	 * Sets the value for Calibration
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setCalibration(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CalibrationTemplate.CALIBRATION.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.CALIBRATION_122505.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type UIDREF and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCodeMeaning, strCodeValue, strCSD, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Image View.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setImageView(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CalibrationTemplate.IMAGE_VIEW.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.IMAGE_VIEW_111031.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Algorithm Name
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strAlgorithmName String value for Algorithm Name.
	 */
	public void setAlgorithmName(int[] arrPosition, String strAlgorithmName)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CalibrationTemplate.ALGORITHM_NAME.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.ALGORITHM_NAME_111001.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type TEXT and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createTextNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strAlgorithmName);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Algorithm Version
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strAlgorithmVersion String value for Algorithm Version.
	 */
	public void setAlgorithmVersion(int[] arrPosition, String strAlgorithmVersion)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CalibrationTemplate.ALGORITHM_VERSION.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.ALGORITHM_VERSION_111003.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type TEXT and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createTextNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strAlgorithmVersion);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Algorithm Manufacturer
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strAlgorithmManufacturer String value for Algorithm Manufacturer.
	 */
	public void setAlgorithmManufacturer(int[] arrPosition, String strAlgorithmManufacturer)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CalibrationTemplate.ALGORITHM_MANUFACTURER.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.ALGORITHM_MANUFACTURER_122405.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type TEXT and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createTextNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strAlgorithmManufacturer);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Calibration Method.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCalibrationMethods Enumerated value for CalibrationMethods.
	 */
	public void setCalibrationMethod(int[] arrPosition, EnumCM_CalibrationMethods enumCalibrationMethods)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CalibrationTemplate.CALIBRATION_METHOD.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.CALIBRATION_METHOD_122422.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Normality Codes
		 */
		if(null== this.objCalibrationMethodsCID3452)
			this.objCalibrationMethodsCID3452 = new CalibrationMethods_CID3452();
		this.objCalibrationMethodsCID3452.setCalibrationMethods(enumCalibrationMethods);

		String strCM = objCalibrationMethodsCID3452.getCodeMeaning();
		String strCV = objCalibrationMethodsCID3452.getCodeValue();
		String strCSD = objCalibrationMethodsCID3452.getCodingSchemeDesignator();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, strCV, strCSD, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Calibration Object.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCalibrationObjects Enumerated value for CalibrationObjects.
	 */
	public void setCalibrationObject(int[] arrPosition, EnumCM_CalibrationObjects enumCalibrationObjects)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CalibrationTemplate.CALIBRATION_OBJECT.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.CALIBRATION_OBJECT_122421.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Normality Codes
		 */
		if(null== this.objCalibrationObjectsCID3451)
			this.objCalibrationObjectsCID3451 = new CalibrationObjects_CID3451();
		this.objCalibrationObjectsCID3451.setCalibrationObjects(enumCalibrationObjects);

		String strCM = objCalibrationObjectsCID3451.getCodeMeaning();
		String strCV = objCalibrationObjectsCID3451.getCodeValue();
		String strCSD = objCalibrationObjectsCID3451.getCodingSchemeDesignator();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, strCV, strCSD, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Calibration Object Size
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCatheterSizeUnits Enumerated value for Catheter Size Units
	 * @param arrNumericValue String array for Quatity Of Material
	 */
	public void setCalibrationObjectSize(int[] arrPosition,EnumCM_CatheterSizeUnits enumCatheterSizeUnits, String[] arrNumericValue)
	{
		String strCodeMeaning = EnumCM_CalibrationTemplate.CALIBRATION_OBJECT_SIZE.getValue();
		String strCodeValue = EnumCV_CalibrationTemplate.CALIBRATION_OBJECT_SIZE_122423.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objCatheterSizeUnitsCID3510)
			this.objCatheterSizeUnitsCID3510 = new CatheterSizeUnits_CID3510();
		this.objCatheterSizeUnitsCID3510.setCatheterSizeUnits(enumCatheterSizeUnits);

		String strCMUnit = objCatheterSizeUnitsCID3510.getCodeMeaning();
		String strCVUnit = objCatheterSizeUnitsCID3510.getCodeValue();
		String strCSDUnit = objCatheterSizeUnitsCID3510.getCodingSchemeDesignator();

		/**
		 * Creating a node of Value Type NUM and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVUnit,strCSDUnit,"",strCMUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
}
