
/*******************************************************************************
 *  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_LanguageOfValue;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Languages;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_LanguageOfValue;


/**
 * This class represents LanguageDesignation_TID1200 TID1201
 */
public class LanguageDesignation_TID1200 extends Template{

	/**
	 * Object of Languages_CID5000
	 */
	private Languages_CID5000 objLanguages_CID5000;
	/**
	 * Object of Countries_CID5001
	 */
	private Countries_CID5001 objCountries_CID5001;
	
	public LanguageDesignation_TID1200(SRTree objTree) {
		super(objTree);
	}
	/**
	 * Sets value for LanguageOfValue.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumLanguages Enumvalue for LanguageOfValue Codes.
	 */
	public void setLanguageOfValue(int[] arrPosition, EnumCM_Languages enumLanguages)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LanguageOfValue.LANGUAGE_OF_VALUE.getValue();
		String strCodeValue = EnumCV_LanguageOfValue.LANGUAGE_OF_VALUE_121047.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for LanguageOfValue Codes
		 */
		if(null== this.objLanguages_CID5000)
			this.objLanguages_CID5000 = new Languages_CID5000();
		this.objLanguages_CID5000.setLanguages(enumLanguages);

		String strCM = objLanguages_CID5000.getCodeMeaning();
		String strCV = objLanguages_CID5000.getCodeValue();
		String strCSD = objLanguages_CID5000.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 Country of Language
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumLanguages Enumvalue for Country of Language Codes.
	 */
	public void setCountryOfLanguage(int[] arrPosition,EnumCM_Countries enumCountries)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LanguageOfValue.LANGUAGE_OF_VALUE.getValue();
		String strCodeValue = EnumCV_LanguageOfValue.LANGUAGE_OF_VALUE_121047.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for LanguageOfValue Codes
		 */
		if(null== this.objCountries_CID5001)
			this.objCountries_CID5001 = new Countries_CID5001();
		this.objCountries_CID5001.setCountries(enumCountries);

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