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

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.Sex_CID7455;
import cdac.medinfo.sdk.dcm30_04.templates.cid.UnitsOfMeasureForAge_CID7456;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_NumericValueQualifier;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Sex;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_UnitsOfMeasure;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_VascularPatientCharacteristics;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_VascularPatientCharacteristics;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents VascularPatientCharacteristics - TID5101
 */
public class VascularPatientCharacteristics_TID5101 extends Template
{
	/**
	 * Object of UnitsOfMeasureForAge_CID7456. 
	 */
	private UnitsOfMeasureForAge_CID7456 objUnitsOfMeasureForAge;
	
	/**
	 * Object of Sex_CID7455. 
	 */
	private Sex_CID7455 objSex;
	
	/**
	 * Instantiates VascularPatientCharacteristics_TID5101 Template.
	 * @param objTree Object of SRTree.
	 */
	public VascularPatientCharacteristics_TID5101(SRTree objTree)
	{
		super(objTree);
	}
	
	/**
	 * Sets the value for Patient Characteristics
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setPatientCharacteristics(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VascularPatientCharacteristics.PATIENT_CHARACTERISTICS.getValue();
		String strCodeValue = EnumCV_VascularPatientCharacteristics.PATIENT_CHARACTERISTICS_121118.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type CONTAINER and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCodeMeaning, strCodeValue, strCSD, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Subject Age.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumUnitsOfMeasureForAge Object of EnumUnitsOfMeasureForAge
	 * @param arrNumericValue String array for Numeric Value.
	 * @param enumNumericValueQualifier Object of EnumCM_NumericValueQualifier
	 */
	public void setSubjectAge(int[] arrPosition,EnumCM_UnitsOfMeasure enumUnitsOfMeasureForAge, String[] arrNumericValue, EnumCM_NumericValueQualifier enumNumericValueQualifier)
	{
		/**
		 * Sets the value for Units Of Measure For Age which follows the template CID7456 
		 */
		if(null== this.objUnitsOfMeasureForAge)
	this.objUnitsOfMeasureForAge = new UnitsOfMeasureForAge_CID7456();
		this.objUnitsOfMeasureForAge.setUnitsOfMeasureForAge(enumUnitsOfMeasureForAge);
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator For Unit of Age.
		 */
		String strCMForUnit = objUnitsOfMeasureForAge.getCodeMeaning();
		String strCVForUnit = objUnitsOfMeasureForAge.getCodeValue();
		String strCSDForUnit = objUnitsOfMeasureForAge.getCodingSchemeDesignator();
		String strCSVForUnit = objUnitsOfMeasureForAge.getCodingSchemeVersion();
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VascularPatientCharacteristics.SUBJECT_AGE.getValue();
		String strCodeValue = EnumCV_VascularPatientCharacteristics.SUBJECT_AGE_121033.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();
		
		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,strCSVForUnit,strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Subject Sex.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumSex value for Sex
	 * @param strCodingSchemeVersionForCode CodingSchemeVersion 
	 */
	public void setSubjectSex(int[] arrPosition, EnumCM_Sex enumSex,String strCodingSchemeVersionForCode)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objSex)
	this.objSex = new Sex_CID7455();
		this.objSex.setSex(enumSex);
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objSex.getCodeMeaning();
		String strCV = objSex.getCodeValue();
		String strCSD1 = objSex.getCodingSchemeDesignator();
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VascularPatientCharacteristics.SUBJECT_SEX.getValue();
		String strCodeValue = EnumCV_VascularPatientCharacteristics.SUBJECT_SEX_121032.getValue();
		String strCSD2 = 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 , strCSD2, strCV, strCSD1, strCodingSchemeVersionForCode, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Heart Rate.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setHeartRate(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.BEATSPERMIN.getValue();
		String strCVForUnit = EnumCV_Unit.BEATSPERMIN.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VascularPatientCharacteristics.HEART_RATE.getValue();
		String strCodeValue = EnumCV_VascularPatientCharacteristics.HEART_RATE_8867_4.getValue();
		String strCSD = EnumCodingSchemeDesignator.LN.getValue();
		
		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Systolic Blood Pressure.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setSystolicBloodPressure(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VascularPatientCharacteristics.SYSTOLIC_BLOOD_PRESSURE.getValue();
		String strCodeValue = EnumCV_VascularPatientCharacteristics.SYSTOLIC_BLOOD_PRESSURE_F_008EC.getValue();
		String strCSD = EnumCodingSchemeDesignator.SRT.getValue();
		
		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,"","","","","","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Diastolic Blood Pressure.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setDiastolicBloodPressure(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VascularPatientCharacteristics.DIASTOLIC_BLOOD_PRESSURE.getValue();
		String strCodeValue = EnumCV_VascularPatientCharacteristics.DIASTOLIC_BLOOD_PRESSURE_F_008ED.getValue();
		String strCSD = EnumCodingSchemeDesignator.SRT.getValue();
		
		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,"","","","","","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
}
