/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/lookups/NormalcyStatus.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 NormalcyStatus extends ims.vo.LookupInstVo implements TreeNode
{
	private static final long serialVersionUID = 1L;

	public NormalcyStatus()
	{
		super();
	}
	public NormalcyStatus(int id)
	{
		super(id, "", true);
	}
	public NormalcyStatus(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public NormalcyStatus(int id, String text, boolean active, NormalcyStatus parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public NormalcyStatus(int id, String text, boolean active, NormalcyStatus parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public NormalcyStatus(int id, String text, boolean active, NormalcyStatus parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static NormalcyStatus buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new NormalcyStatus(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (NormalcyStatus)super.getParentInstance();
	}
	public NormalcyStatus getParent()
	{
		return (NormalcyStatus)super.getParentInstance();
	}
	public void setParent(NormalcyStatus parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		NormalcyStatus[] typedChildren = new NormalcyStatus[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (NormalcyStatus)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof NormalcyStatus)
		{
			super.addChild((NormalcyStatus)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof NormalcyStatus)
		{
			super.removeChild((NormalcyStatus)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		NormalcyStatusCollection result = new NormalcyStatusCollection();
		result.add(N);
		result.add(L);
		result.add(H);
		result.add(LL);
		result.add(HH);
		result.add(A);
		result.add(AA);
		result.add(U);
		result.add(D);
		result.add(B);
		result.add(W);
		result.add(S);
		result.add(R);
		result.add(I);
		result.add(MS);
		result.add(VS);
		result.add(LT);
		result.add(GT);
		return result;
	}
	public static NormalcyStatus[] getNegativeInstances()
	{
		NormalcyStatus[] instances = new NormalcyStatus[18];
		instances[0] = N;
		instances[1] = L;
		instances[2] = H;
		instances[3] = LL;
		instances[4] = HH;
		instances[5] = A;
		instances[6] = AA;
		instances[7] = U;
		instances[8] = D;
		instances[9] = B;
		instances[10] = W;
		instances[11] = S;
		instances[12] = R;
		instances[13] = I;
		instances[14] = MS;
		instances[15] = VS;
		instances[16] = LT;
		instances[17] = GT;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[18];
		negativeInstances[0] = "N";
		negativeInstances[1] = "L";
		negativeInstances[2] = "H";
		negativeInstances[3] = "LL";
		negativeInstances[4] = "HH";
		negativeInstances[5] = "A";
		negativeInstances[6] = "AA";
		negativeInstances[7] = "U";
		negativeInstances[8] = "D";
		negativeInstances[9] = "B";
		negativeInstances[10] = "W";
		negativeInstances[11] = "S";
		negativeInstances[12] = "R";
		negativeInstances[13] = "I";
		negativeInstances[14] = "MS";
		negativeInstances[15] = "VS";
		negativeInstances[16] = "LT";
		negativeInstances[17] = "GT";
		return negativeInstances;
	}
	public static NormalcyStatus 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 NormalcyStatus getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		NormalcyStatus[] 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 = 1161037;
	public static final NormalcyStatus N = new NormalcyStatus(-900, "Normal", true, null, null, Color.Default);
	public static final NormalcyStatus L = new NormalcyStatus(-1062, "Below low normal", true, null, null, Color.Default);
	public static final NormalcyStatus H = new NormalcyStatus(-1063, "Above high normal", true, null, null, Color.Default);
	public static final NormalcyStatus LL = new NormalcyStatus(-1064, "Below lower panic limits", true, null, null, Color.Default);
	public static final NormalcyStatus HH = new NormalcyStatus(-1065, "Above upper panic limits", true, null, null, Color.Default);
	public static final NormalcyStatus A = new NormalcyStatus(-1066, "Abnormal", true, null, null, Color.Default);
	public static final NormalcyStatus AA = new NormalcyStatus(-1067, "Very abnormal", true, null, null, Color.Default);
	public static final NormalcyStatus U = new NormalcyStatus(-1068, "Significant change up", true, null, null, Color.Default);
	public static final NormalcyStatus D = new NormalcyStatus(-1069, "Significant change down", true, null, null, Color.Default);
	public static final NormalcyStatus B = new NormalcyStatus(-1070, "Better", true, null, null, Color.Default);
	public static final NormalcyStatus W = new NormalcyStatus(-1071, "Worse", true, null, null, Color.Default);
	public static final NormalcyStatus S = new NormalcyStatus(-1072, "Susceptible", true, null, null, Color.Default);
	public static final NormalcyStatus R = new NormalcyStatus(-1073, "Resistant", true, null, null, Color.Default);
	public static final NormalcyStatus I = new NormalcyStatus(-1074, "Intermediate", true, null, null, Color.Default);
	public static final NormalcyStatus MS = new NormalcyStatus(-1075, "Moderately susceptible", true, null, null, Color.Default);
	public static final NormalcyStatus VS = new NormalcyStatus(-1076, "Very susceptible", true, null, null, Color.Default);
	public static final NormalcyStatus LT = new NormalcyStatus(-1077, "Below absolute low-off instrument scale", true, null, null, Color.Default);
	public static final NormalcyStatus GT = new NormalcyStatus(-1078, "Above absolute high-off instrument scale", true, null, null, Color.Default);
}
