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

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.breastimagingreporttemplates.BreastImagingPathologyResults_TID4207;
import cdac.medinfo.sdk.dcm30_04.templates.cid.PersonRoles_CID7450;
import cdac.medinfo.sdk.dcm30_04.templates.cid.SeverityOfComplication_CID251;
import cdac.medinfo.sdk.dcm30_04.templates.cid.TimeIntervals_CID6164;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PreviousProcedure;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SeverityOfComplication;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_TimeIntervals;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_PreviousProcedure;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents PreviousProcedure - TID9003
 */
public class PreviousProcedure_TID9003 extends Template
{
	/**
	 * Object of BreastImagingPathologyResults_TID4207
	 */

	private BreastImagingPathologyResults_TID4207 objBreastImagingPathologyResultsTID4207;
	
	/**
	 * Object of TimeIntervals_CID6164
	 */

	private TimeIntervals_CID6164 objTimeIntervalsCID6164;

	/**
	 * Object of SeverityOfComplication_CID251
	 */
	private SeverityOfComplication_CID251 objSeverityOfComplicationCID251;

	/**
	 * Object of PersonRoles_CID7450
	 */
	private PersonRoles_CID7450 objPersonRolesCID7450;

	/**
	 * Instantiates PreviousProcedure_TID9003 Template.
	 * @param objTree Object of SRTree.
	 */
	public PreviousProcedure_TID9003(SRTree objTree)
	{
		super(objTree);
	}

	/**
	 * Retrieves the object of BreastImagingPathologyResults.
	 * @return objBreastImagingPathologyResultsTID4207 object of BreastImagingPathologyResults_TID4207
	 */
	public BreastImagingPathologyResults_TID4207 getBreastImagingPathologyResults() 
	{
		if(null == this.objBreastImagingPathologyResultsTID4207)
			this.objBreastImagingPathologyResultsTID4207 = new BreastImagingPathologyResults_TID4207(getSRTree());
		return this.objBreastImagingPathologyResultsTID4207;
	}

	/**
	 * Sets the value for Relevant Previous Procedures
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setRelevantPreviousProcedures(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.RELEVANT_PREVIOUS_PROCEDURES.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.RELEVANT_PREVIOUS_PROCEDURES_111513.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 Previous Procedures
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setPreviousProcedures(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.PREVIOUS_PROCEDURE.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.PREVIOUS_PROCEDURE_111531.getValue();
		String strCSD = 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, strCSD, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Procedure Modifier
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setProcedureModifier(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.PROCEDURE_MODIFIER.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.PROCEDURE_MODIFIER_111464.getValue();
		String strCSD = 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, strCSD, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Role of person reporting.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumValue This Enum value can be one of the following enums - EnumFamilyMember, EnumCM_PersonRoles,
	 * or EnumCM_OrganizationalRoles.
	 */
	public void setRoleOfPersonReporting(int[] arrPosition, Enum enumValue)
	{
		/**
		 * Sets the value for InterventionActionsAndStatus.
		 */
		if(null== this.objPersonRolesCID7450)
			this.objPersonRolesCID7450 = new PersonRoles_CID7450();
		this.objPersonRolesCID7450.setPersonRoles(enumValue);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = this.objPersonRolesCID7450.getCodeMeaning();
		String strCV = this.objPersonRolesCID7450.getCodeValue();
		String strCSD1 = this.objPersonRolesCID7450.getCodingSchemeDesignator();
		String strSNOMEDCTID = objPersonRolesCID7450.getSNOMEDCTID();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.ROLE_OF_PERSON_REPORTING.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.ROLE_OF_PERSON_REPORTING_111534.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, "", strCM,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Number of occurrences.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setNumberOfOccurrences(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.NOUNITS.getValue();
		String strCVForUnit = EnumCV_Unit.NOUNITS.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.NUMBER_OF_OCCURRENCES.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.NUMBER_OF_OCCURRENCES_R_42009.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for ProcedureResult.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setProcedureResult(int[] arrPosition,String[] arrNumericValue){

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.PROCEDURE_RESULT.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.PROCEDURE_RESULT_122177.getValue();
		String strCSD = 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, strCSD, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Complication of procedure.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setComplicationOfProceduret(int[] arrPosition,String[] arrNumericValue){

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.COMPLICATION_OF_PROCEDURE.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.COMPLICATION_OF_PROCEDURE_DD_60002.getValue();
		String strCSD = EnumCodingSchemeDesignator.SRT.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, strCSD, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Severity of Complication.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumSeverityOfComplication Enum value for enumSeverityOfComplication
	 */
	public void setSeverityOfComplication(int[] arrPosition, EnumCM_SeverityOfComplication enumSeverityOfComplication)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objSeverityOfComplicationCID251)
			this.objSeverityOfComplicationCID251 = new SeverityOfComplication_CID251();
		this.objSeverityOfComplicationCID251.setSeverityOfComplication(enumSeverityOfComplication);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = this.objSeverityOfComplicationCID251.getCodeMeaning();
		String strCV = this.objSeverityOfComplicationCID251.getCodeValue();
		String strCSD1 = this.objSeverityOfComplicationCID251.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.SEVERITY_OF_COMPLICATION.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.SEVERITY_OF_COMPLICATION_111466.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Estimated Timeframe.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumTimeIntervals Enum value for TimeIntervals
	 */
	public void setEstimatedTimeframe(int[] arrPosition, EnumCM_TimeIntervals enumTimeIntervals)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objTimeIntervalsCID6164)
			this.objTimeIntervalsCID6164 = new TimeIntervals_CID6164();
		this.objTimeIntervalsCID6164.setTimeIntervals(enumTimeIntervals);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = this.objTimeIntervalsCID6164.getCodeMeaning();
		String strCV = this.objTimeIntervalsCID6164.getCodeValue();
		String strCSD1 = this.objTimeIntervalsCID6164.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PreviousProcedure.ESTIMATED_TIMEFRAME.getValue();
		String strCodeValue = EnumCV_PreviousProcedure.ESTIMATED_TIMEFRAME_111395.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
}
