/*******************************************************************************
 *  Copyright 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.Countries_CID5001;
import cdac.medinfo.sdk.dcm30_04.templates.cid.Languages_CID5000;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Countries;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_LanguageOfContentItemAndDescendants;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Languages;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_LanguageOfContentItemAndDescendants;

/**
 * This class represents LanguageOfContentItemAndDescendants - TID1204
 */
public class LanguageOfContentItemAndDescendants_TID1204 extends Template{

	/**
	 * Object of Languages_CID5000
	 */
	private Languages_CID5000 objLanguagesCID5000;

	/**
	 * Object of Countries_CID5001
	 */
	private Countries_CID5001 objCountriesCID5001;

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

	/**
	 * Sets the value for LanguageOfContentItemAndDescendants
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumLanguages Enumerated Value for Languages.
	 */
	public void setLanguageOfContentItemAndDescendants(int[] arrPosition, EnumCM_Languages enumLanguages)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LanguageOfContentItemAndDescendants.LANGUAGE_OF_CONTENT_ITEM_AND_DESCENDANTS.getValue();
		String strCodeValue = EnumCV_LanguageOfContentItemAndDescendants.LANGUAGE_OF_CONTENT_ITEM_AND_DESCENDANTS_121049.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objLanguagesCID5000)
			this.objLanguagesCID5000 = new Languages_CID5000();
		this.objLanguagesCID5000.setLanguages(enumLanguages);

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

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

	/**
	 * Sets the value for LanguageOfContentItemAndDescendants
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCountries Enumerated Value for Countries.
	 */
	public void setCountryOfLanguage(int[] arrPosition, EnumCM_Countries enumCountries)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LanguageOfContentItemAndDescendants.COUNTRY_OF_LANGUAGE.getValue();
		String strCodeValue = EnumCV_LanguageOfContentItemAndDescendants.COUNTRY_OF_LANGUAGE_121046.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objCountriesCID5001)
			this.objCountriesCID5001 = new Countries_CID5001();
		this.objCountriesCID5001.setCountries(enumCountries);

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

}
