/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/lookups/ResultValueType.java
//#############################################################################
//#                                                                           #
//#  Copyright (C) <2015>  <IMS MAXIMS>                                       #
//#                                                                           #
//#  This program is free software: you can redistribute it and/or modify     #
//#  it under the terms of the GNU Affero General Public License as           #
//#  published by the Free Software Foundation, either version 3 of the       #
//#  License, or (at your option) any later version.                          # 
//#                                                                           #
//#  This program is distributed in the hope that it will be useful,          #
//#  but WITHOUT ANY WARRANTY; without even the implied warranty of           #
//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
//#  GNU Affero General Public License for more details.                      #
//#                                                                           #
//#  You should have received a copy of the GNU Affero General Public License #
//#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
//#                                                                           #
//#  IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of    #
//#  this program.  Users of this software do so entirely at their own risk.  #
//#  IMS MAXIMS only ensures the Clinical Safety of unaltered run-time        #
//#  software that it builds, deploys and maintains.                          #
//#                                                                           #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file

package ims.ocrr.vo.lookups;

import ims.framework.cn.data.TreeNode;
import java.util.ArrayList;
import ims.framework.utils.Image;
import ims.framework.utils.Color;

public class ResultValueType extends ims.vo.LookupInstVo implements TreeNode
{
	private static final long serialVersionUID = 1L;

	public ResultValueType()
	{
		super();
	}
	public ResultValueType(int id)
	{
		super(id, "", true);
	}
	public ResultValueType(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public ResultValueType(int id, String text, boolean active, ResultValueType parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public ResultValueType(int id, String text, boolean active, ResultValueType parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public ResultValueType(int id, String text, boolean active, ResultValueType parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static ResultValueType buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new ResultValueType(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (ResultValueType)super.getParentInstance();
	}
	public ResultValueType getParent()
	{
		return (ResultValueType)super.getParentInstance();
	}
	public void setParent(ResultValueType parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		ResultValueType[] typedChildren = new ResultValueType[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (ResultValueType)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof ResultValueType)
		{
			super.addChild((ResultValueType)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof ResultValueType)
		{
			super.removeChild((ResultValueType)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		ResultValueTypeCollection result = new ResultValueTypeCollection();
		result.add(ST);
		result.add(FT);
		result.add(NM);
		result.add(AD);
		result.add(CE);
		result.add(CF);
		result.add(CK);
		result.add(CN);
		result.add(CP);
		result.add(CX);
		result.add(DT);
		result.add(ED);
		result.add(MO);
		result.add(PN);
		result.add(RP);
		result.add(SN);
		result.add(TM);
		result.add(TN);
		result.add(TS);
		result.add(TX);
		return result;
	}
	public static ResultValueType[] getNegativeInstances()
	{
		ResultValueType[] instances = new ResultValueType[20];
		instances[0] = ST;
		instances[1] = FT;
		instances[2] = NM;
		instances[3] = AD;
		instances[4] = CE;
		instances[5] = CF;
		instances[6] = CK;
		instances[7] = CN;
		instances[8] = CP;
		instances[9] = CX;
		instances[10] = DT;
		instances[11] = ED;
		instances[12] = MO;
		instances[13] = PN;
		instances[14] = RP;
		instances[15] = SN;
		instances[16] = TM;
		instances[17] = TN;
		instances[18] = TS;
		instances[19] = TX;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[20];
		negativeInstances[0] = "ST";
		negativeInstances[1] = "FT";
		negativeInstances[2] = "NM";
		negativeInstances[3] = "AD";
		negativeInstances[4] = "CE";
		negativeInstances[5] = "CF";
		negativeInstances[6] = "CK";
		negativeInstances[7] = "CN";
		negativeInstances[8] = "CP";
		negativeInstances[9] = "CX";
		negativeInstances[10] = "DT";
		negativeInstances[11] = "ED";
		negativeInstances[12] = "MO";
		negativeInstances[13] = "PN";
		negativeInstances[14] = "RP";
		negativeInstances[15] = "SN";
		negativeInstances[16] = "TM";
		negativeInstances[17] = "TN";
		negativeInstances[18] = "TS";
		negativeInstances[19] = "TX";
		return negativeInstances;
	}
	public static ResultValueType getNegativeInstance(String name)
	{
		if(name == null)
			return null;
		String[] negativeInstances = getNegativeInstanceNames();
		for (int i = 0; i < negativeInstances.length; i++)
		{
			if(negativeInstances[i].equals(name))
				return getNegativeInstances()[i];
		}
		return null;
	}
	public static ResultValueType getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		ResultValueType[] negativeInstances = getNegativeInstances();
		for (int i = 0; i < negativeInstances.length; i++)
		{
			if(negativeInstances[i].getID() == id)
				return negativeInstances[i];
		}
		return null;
	}
	public int getTypeId()
	{
		return TYPE_ID;
	}
	public static final int TYPE_ID = 1161032;
	public static final ResultValueType ST = new ResultValueType(-858, "Short Text", true, null, null, Color.Default);
	public static final ResultValueType FT = new ResultValueType(-859, "Formatted Text", true, null, null, Color.Default);
	public static final ResultValueType NM = new ResultValueType(-860, "Numeric", true, null, null, Color.Default);
	public static final ResultValueType AD = new ResultValueType(-1045, "Address", true, null, null, Color.Default);
	public static final ResultValueType CE = new ResultValueType(-1046, "Coded Entry", true, null, null, Color.Default);
	public static final ResultValueType CF = new ResultValueType(-1047, "Coded Elements With Formatted Values", true, null, null, Color.Default);
	public static final ResultValueType CK = new ResultValueType(-1048, "Composite ID With Check Digit", true, null, null, Color.Default);
	public static final ResultValueType CN = new ResultValueType(-1049, "Composite ID And Name", true, null, null, Color.Default);
	public static final ResultValueType CP = new ResultValueType(-1050, "Composite Price", true, null, null, Color.Default);
	public static final ResultValueType CX = new ResultValueType(-1051, "Extended Composite ID With Check Digit", true, null, null, Color.Default);
	public static final ResultValueType DT = new ResultValueType(-1052, "Date", true, null, null, Color.Default);
	public static final ResultValueType ED = new ResultValueType(-1053, "Encapsulated Data", true, null, null, Color.Default);
	public static final ResultValueType MO = new ResultValueType(-1054, "Money", true, null, null, Color.Default);
	public static final ResultValueType PN = new ResultValueType(-1055, "Person Name", true, null, null, Color.Default);
	public static final ResultValueType RP = new ResultValueType(-1056, "Reference Pointer", true, null, null, Color.Default);
	public static final ResultValueType SN = new ResultValueType(-1057, "Structured Numeric", true, null, null, Color.Default);
	public static final ResultValueType TM = new ResultValueType(-1058, "Time", true, null, null, Color.Default);
	public static final ResultValueType TN = new ResultValueType(-1059, "Telephone Number", true, null, null, Color.Default);
	public static final ResultValueType TS = new ResultValueType(-1060, "Time Stamp", true, null, null, Color.Default);
	public static final ResultValueType TX = new ResultValueType(-1061, "Text Data", true, null, null, Color.Default);
}
