/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/admin/vo/lookups/HardCodedEvents.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.admin.vo.lookups;

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

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

	public HardCodedEvents()
	{
		super();
	}
	public HardCodedEvents(int id)
	{
		super(id, "", true);
	}
	public HardCodedEvents(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public HardCodedEvents(int id, String text, boolean active, HardCodedEvents parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public HardCodedEvents(int id, String text, boolean active, HardCodedEvents parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public HardCodedEvents(int id, String text, boolean active, HardCodedEvents parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static HardCodedEvents buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new HardCodedEvents(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (HardCodedEvents)super.getParentInstance();
	}
	public HardCodedEvents getParent()
	{
		return (HardCodedEvents)super.getParentInstance();
	}
	public void setParent(HardCodedEvents parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		HardCodedEvents[] typedChildren = new HardCodedEvents[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (HardCodedEvents)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof HardCodedEvents)
		{
			super.addChild((HardCodedEvents)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof HardCodedEvents)
		{
			super.removeChild((HardCodedEvents)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		HardCodedEventsCollection result = new HardCodedEventsCollection();
		result.add(FIRSTDEFINITIVETREATMENTEVENT);
		result.add(APPOINTMENTBOOKED);
		result.add(APPOINTMENTCANCELLED);
		result.add(APPOINTMENTATTENDED);
		result.add(APPOINTMENTDNA);
		result.add(APPOINTMENTUNDNA);
		result.add(PATHWAYPAUSED);
		result.add(PATHWAYUNPAUSED);
		result.add(APPOINTMENTUNARRIVED);
		result.add(REFERRALREJECTED);
		return result;
	}
	public static HardCodedEvents[] getNegativeInstances()
	{
		HardCodedEvents[] instances = new HardCodedEvents[10];
		instances[0] = FIRSTDEFINITIVETREATMENTEVENT;
		instances[1] = APPOINTMENTBOOKED;
		instances[2] = APPOINTMENTCANCELLED;
		instances[3] = APPOINTMENTATTENDED;
		instances[4] = APPOINTMENTDNA;
		instances[5] = APPOINTMENTUNDNA;
		instances[6] = PATHWAYPAUSED;
		instances[7] = PATHWAYUNPAUSED;
		instances[8] = APPOINTMENTUNARRIVED;
		instances[9] = REFERRALREJECTED;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[10];
		negativeInstances[0] = "FIRSTDEFINITIVETREATMENTEVENT";
		negativeInstances[1] = "APPOINTMENTBOOKED";
		negativeInstances[2] = "APPOINTMENTCANCELLED";
		negativeInstances[3] = "APPOINTMENTATTENDED";
		negativeInstances[4] = "APPOINTMENTDNA";
		negativeInstances[5] = "APPOINTMENTUNDNA";
		negativeInstances[6] = "PATHWAYPAUSED";
		negativeInstances[7] = "PATHWAYUNPAUSED";
		negativeInstances[8] = "APPOINTMENTUNARRIVED";
		negativeInstances[9] = "REFERRALREJECTED";
		return negativeInstances;
	}
	public static HardCodedEvents 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 HardCodedEvents getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		HardCodedEvents[] 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 = 1031032;
	public static final HardCodedEvents FIRSTDEFINITIVETREATMENTEVENT = new HardCodedEvents(-2942, "First Definitive Treatment Event", true, null, null, Color.Default);
	public static final HardCodedEvents APPOINTMENTBOOKED = new HardCodedEvents(-2986, "Appointment Booked", true, null, null, Color.Default);
	public static final HardCodedEvents APPOINTMENTCANCELLED = new HardCodedEvents(-2987, "Appointment Cancelled", true, null, null, Color.Default);
	public static final HardCodedEvents APPOINTMENTATTENDED = new HardCodedEvents(-2988, "Appointment Attended", true, null, null, Color.Default);
	public static final HardCodedEvents APPOINTMENTDNA = new HardCodedEvents(-2989, "Appointment DNA", true, null, null, Color.Default);
	public static final HardCodedEvents APPOINTMENTUNDNA = new HardCodedEvents(-2990, "Appointment UN-DNA", true, null, null, Color.Default);
	public static final HardCodedEvents PATHWAYPAUSED = new HardCodedEvents(-2991, "Pathway Paused", true, null, null, Color.Default);
	public static final HardCodedEvents PATHWAYUNPAUSED = new HardCodedEvents(-2992, "Pathway Unpaused ", true, null, null, Color.Default);
	public static final HardCodedEvents APPOINTMENTUNARRIVED = new HardCodedEvents(-3005, "Appointment Un-Arrived", true, null, null, Color.Default);
	public static final HardCodedEvents REFERRALREJECTED = new HardCodedEvents(-3289, "Referral Rejected", true, null, null, Color.Default);
}
