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

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.MyocardialWallSegments_CID3717;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MyocardiumWallMorphologyFindings_CID3704;
import cdac.medinfo.sdk.dcm30_04.templates.cid.UltrasoundProtocolStageTypes_CID12002;
import cdac.medinfo.sdk.dcm30_04.templates.cid.WallMotionScoringSchemes_CID12238;
import cdac.medinfo.sdk.dcm30_04.templates.cid.WallMotion_CID3703;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CathProcedureType;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DefinedTerms;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_EchocardiographyWallMotionAnalysis;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MyocardialWallSegments;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MyocardiumWallMorphologyFindings;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_UltrasoundProtocolStageTypes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_WallMotion;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_WallMotionScoringSchemes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_DefinedTerms;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_EchocardiographyWallMotionAnalysis;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents EchocardiographyWallMotionAnalysis - TID5204
 */
public class EchocardiographyWallMotionAnalysis_TID5204 extends Template
{
	/**
	 * Object of MyocardiumWallMorphologyFindings_CID3704
	 */
	private MyocardiumWallMorphologyFindings_CID3704 objWallMorphologyFindingsCID3704;

	/**
	 * Object of WallMotion_CID3703
	 */
	private WallMotion_CID3703 objWallMotionCID3703;

	/**
	 * Object of MyocardialWallSegments_CID3717
	 */
	private MyocardialWallSegments_CID3717 objMyocardialWallSegmentsCID3717;

	/**
	 * Object of WallMotionScoringSchemes_CID12238
	 */
	private WallMotionScoringSchemes_CID12238 objWallMotionScoringSchemesCID12238;

	/**
	 * Object of UltrasoundProtocolStageTypes_CID12002
	 */
	private UltrasoundProtocolStageTypes_CID12002 objUltrasoundProtocolStageTypesCID12002;

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

	/**
	 * Sets the value for Findings
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setFindings(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.FINDINGS.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.FINDING_SITE_G_C0E3.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 Procedure Reported.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCathProcedureType Enumerated value for CathProcedureType
	 */
	public void setProcedureReported(int[] arrPosition, EnumCM_CathProcedureType enumCathProcedureType)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = EnumCM_DefinedTerms.ELECTROCARDIOGRAPHY_FOR_DETERMINING_VENTRICULAR_CONTRACTION.getValue();
		String strCV = EnumCV_DefinedTerms.ELECTROCARDIOGRAPHY_FOR_DETERMINING_VENTRICULAR_CONTRACTION_P5_B3121.getValue();
		String strCSD1 = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.PROCEDURE_REPORTED.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.PROCEDURE_REPORTED_121058.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 value for Stage.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumUltrasoundProtocolStageTypes Enumerated value for UltrasoundProtocolStageTypes
	 */
	public void setStage(int[] arrPosition, EnumCM_UltrasoundProtocolStageTypes enumUltrasoundProtocolStageTypes)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.STAGE.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.STAGE_18139_6.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.LN.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objUltrasoundProtocolStageTypesCID12002)
			this.objUltrasoundProtocolStageTypesCID12002 = new UltrasoundProtocolStageTypes_CID12002();
		this.objUltrasoundProtocolStageTypesCID12002.setUltrasoundProtocolStageTypes(enumUltrasoundProtocolStageTypes);

		String strCM = objUltrasoundProtocolStageTypesCID12002.getCodeMeaning();
		String strCV = objUltrasoundProtocolStageTypesCID12002.getCodeValue();
		String strCSD = objUltrasoundProtocolStageTypesCID12002.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 Illustration of Finding
	 * @param arrPosition identifier which shows the position of the node in the SR Tree.
	 *@param strRefSOPClassUIDForCORefMacro Reference SOP Class UID for Composite Object Reference Macro.
	 * @param strRefSOPInstanceUIDForCORefMacro Reference SOP Instance UID for Composite Object Reference Macro.
	 * @param arrStrReferencedFrameNumber String Array of Referenced Frame Number.
	 * @param strRefSOPClassUID Referenced SOP Class UID.
	 * @param strRefSOPInstanceUID Referenced SOP Instance UID.
	 */
	public void setIllustrationOfFinding(int[] arrPosition, String strRefSOPClassUIDForCORefMacro, String strRefSOPInstanceUIDForCORefMacro, String[] arrStrReferencedFrameNumber, String strRefSOPClassUID, String strRefSOPInstanceUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.ILLUSTRATION_OF_FINDING.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.ILLUSTRATION_OF_FINDING_125201.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().createImageNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strRefSOPClassUIDForCORefMacro, strRefSOPInstanceUIDForCORefMacro, arrStrReferencedFrameNumber, strRefSOPClassUID, strRefSOPInstanceUID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for LV Wall Motion Segmental Findings
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strLVWallMotionSegmentalFindings String value for LV Wall Motion Segmental Findings.
	 */
	public void setLVWallMotionSegmentalFindings(int[] arrPosition, String strLVWallMotionSegmentalFindings)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.LV_WALL_MOTION_SEGMENTAL_FINDINGS.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.LV_WALL_MOTION_SEGMENTAL_FINDINGS_18118_0.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, strLVWallMotionSegmentalFindings);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for LV Wall Motion Score Index.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setLVWallMotionScoreIndex(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.LV_WALL_MOTION_SCORE_INDEX.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.LV_WALL_MOTION_SCORE_INDEX_125202.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,"","","","","","","","");
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Assessment Scale.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumWallMotionScoringSchemes Enumerated value for WallMotionScoringSchemes
	 */
	public void setAssessmentScale(int[] arrPosition, EnumCM_WallMotionScoringSchemes enumWallMotionScoringSchemes)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.ASSESSMENT_SCALE.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.ASSESSMENT_SCALE_G_E048.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objWallMotionScoringSchemesCID12238)
			this.objWallMotionScoringSchemesCID12238 = new WallMotionScoringSchemes_CID12238();
		this.objWallMotionScoringSchemesCID12238.setWallMotionScoringSchemes(enumWallMotionScoringSchemes);

		String strCM = objWallMotionScoringSchemesCID12238.getCodeMeaning();
		String strCV = objWallMotionScoringSchemesCID12238.getCodeValue();
		String strCSD = objWallMotionScoringSchemesCID12238.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 Finding Site.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setFindingSite(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.FINDING_SITE.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.FINDING_SITE_G_C0E3.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Arterial Lesion Location
		 */
		String strCM = EnumCM_DefinedTerms.MYOCARDIAL_WALL.getValue();
		String strCV = EnumCV_DefinedTerms.MYOCARDIAL_WALL_T_D0772.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, strCSDesg, strCV, strCSD, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Wall Segment.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumMyocardialWallSegments Enumerated value for value for MyocardialWallSegments
	 */
	public void setWallSegment(int[] arrPosition, EnumCM_MyocardialWallSegments enumMyocardialWallSegments)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objMyocardialWallSegmentsCID3717)
			this.objMyocardialWallSegmentsCID3717 = new MyocardialWallSegments_CID3717();
		this.objMyocardialWallSegmentsCID3717.setMyocardialWallSegments(enumMyocardialWallSegments);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.WALL_SEGMENT.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.WALL_SEGMENT_18179_2.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.LN.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 Cardiac Wall Motion.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumWallMotion Enumerated value for value for WallMotion
	 */
	public void setCardiacWallMotion(int[] arrPosition, EnumCM_WallMotion enumWallMotion)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objWallMotionCID3703)
			this.objWallMotionCID3703 = new WallMotion_CID3703();
		this.objWallMotionCID3703.setWallMotion(enumWallMotion);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.CARDIAC_WALL_MOTION.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.CARDIAC_WALL_MOTION_F_32050.getValue();
		String strCSD2 = 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 , strCSD2, strCV, strCSD1, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Associated Morphology.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumMyocardiumWallMorphologyFindings Enumerated value for value for MyocardiumWallMorphologyFindings
	 */
	public void setAssociatedMorphology(int[] arrPosition, EnumCM_MyocardiumWallMorphologyFindings enumMyocardiumWallMorphologyFindings)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objWallMorphologyFindingsCID3704)
			this.objWallMorphologyFindingsCID3704 = new MyocardiumWallMorphologyFindings_CID3704();
		this.objWallMorphologyFindingsCID3704.setMyocardiumWallMorphologyFindings(enumMyocardiumWallMorphologyFindings);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.ASSOCIATED_MORPHOLOGY.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.ASSOCIATED_MORPHOLOGY_G_C504.getValue();
		String strCSD2 = 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 , strCSD2, strCV, strCSD1, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Score.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setScore(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchocardiographyWallMotionAnalysis.SCORE.getValue();
		String strCodeValue = EnumCV_EchocardiographyWallMotionAnalysis.SCORE_G_C1E3.getValue();
		String strCSD = EnumCodingSchemeDesignator.SRT.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,"","","","","","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
}
