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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.DeviceParticipatingRoles_CID7445;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DeviceObserverIdentifyingAttribute;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DeviceParticipatingRoles;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_DeviceObserverIdentifyingAttribute;

/**
 * TID 1004 Device Observer Identifying Attributes
 * This template (derived from the DICOM General Equipment Module of PS3.3) contains identifying (and
 * optionally descriptive) attributes of devices that are observers.
 */
/**
 * This class represents DeviceObserverIdentifyingAttributes - TID1004
 */
public class DeviceObserverIdentifyingAttributes_TID1004 extends Template
{
	/**
	 * Object of NormalityCodes_CID222
	 */
	private DeviceParticipatingRoles_CID7445 objDeviceParticipatingRoles_CID7445;
	/**
	 * Instantiates a new DeviceObserverIdentifyingAttributes_TID1004 Template.
	 * @param objTree Object of SRTree.
	 */
	public DeviceObserverIdentifyingAttributes_TID1004(SRTree objTree)
	{
		super(objTree);
	}
	
	/**
	 * Sets the value for DeviceObserverUID
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDeviceObserverUID String value for DeviceObserverUID.
	 */
	public void setDeviceObserverUID(int[] arrPosition, String strDeviceObserverUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_UID.getValue();
		String strCodeValue = EnumCV_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_UID_121012.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().createUIDREFNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strDeviceObserverUID);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for DeviceObserverName
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDeviceObserverName String value for DeviceObserverName.
	 */
	public void setDeviceObserverName(int[] arrPosition, String strDeviceObserverName)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_NAME.getValue();
		String strCodeValue = EnumCV_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_NAME_121013.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, strDeviceObserverName);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for DeviceObserverManufacturer
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDeviceObserverManufacturer String value for DeviceObserverManufacturer.
	 */
	public void setDeviceObserverManufacturer(int[] arrPosition, String strDeviceObserverManufacturer)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_MANUFACTURER.getValue();
		String strCodeValue = EnumCV_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_MANUFACTURER_121014.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, strDeviceObserverManufacturer);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for DeviceObserverModelName
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDeviceObserverModelName String value for DeviceObserverModelName.
	 */
	public void setDeviceObserverModelName(int[] arrPosition, String strDeviceObserverModelName)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_MODEL_NAME.getValue();
		String strCodeValue = EnumCV_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_MODEL_NAME_121015.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, strDeviceObserverModelName);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for DeviceObserverSerialNumber
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDeviceObserverSerialNumber String value for DeviceObserverSerialNumber.
	 */
	public void setDeviceObserverSerialNumber(int[] arrPosition, String strDeviceObserverSerialNumber)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_SERIAL_NUMBER.getValue();
		String strCodeValue = EnumCV_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_SERIAL_NUMBER_121016.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, strDeviceObserverSerialNumber);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for DeviceObserverPhysicalLocation
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDeviceObserverPhysicalLocation String value for DeviceObserverPhysicalLocation.
	 */
	public void setDeviceObserverPhysicalLocation(int[] arrPosition, String strDeviceObserverPhysicalLocation)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_PHYSICAL_LOCATION.getValue();
		String strCodeValue = EnumCV_DeviceObserverIdentifyingAttribute.DEVICE_OBSERVER_PHYSICAL_LOCATION_121017.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, strDeviceObserverPhysicalLocation);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for Normality.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumNormalityCodes Enumvalue for Normality Codes.
	 */
	public void setDeviceRoleInProcedure(int[] arrPosition, EnumCM_DeviceParticipatingRoles enumDeviceParticipatingRoles)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DeviceObserverIdentifyingAttribute.DEVICE_ROLE_IN_PROCEDURE.getValue();
		String strCodeValue = EnumCV_DeviceObserverIdentifyingAttribute.DEVICE_ROLE_IN_PROCEDURE_113876.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Normality Codes
		 */
		if(null== this.objDeviceParticipatingRoles_CID7445)
			this.objDeviceParticipatingRoles_CID7445 = new DeviceParticipatingRoles_CID7445();
		this.objDeviceParticipatingRoles_CID7445.setDeviceParticipatingRoles(enumDeviceParticipatingRoles);

		String strCM = objDeviceParticipatingRoles_CID7445.getCodeMeaning();
		String strCV = objDeviceParticipatingRoles_CID7445.getCodeValue();
		String strCSD = objDeviceParticipatingRoles_CID7445.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);
	}

}
