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

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

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

	public CaseNoteRequestCancellationReason()
	{
		super();
	}
	public CaseNoteRequestCancellationReason(int id)
	{
		super(id, "", true);
	}
	public CaseNoteRequestCancellationReason(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public CaseNoteRequestCancellationReason(int id, String text, boolean active, CaseNoteRequestCancellationReason parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public CaseNoteRequestCancellationReason(int id, String text, boolean active, CaseNoteRequestCancellationReason parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public CaseNoteRequestCancellationReason(int id, String text, boolean active, CaseNoteRequestCancellationReason parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static CaseNoteRequestCancellationReason buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new CaseNoteRequestCancellationReason(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (CaseNoteRequestCancellationReason)super.getParentInstance();
	}
	public CaseNoteRequestCancellationReason getParent()
	{
		return (CaseNoteRequestCancellationReason)super.getParentInstance();
	}
	public void setParent(CaseNoteRequestCancellationReason parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		CaseNoteRequestCancellationReason[] typedChildren = new CaseNoteRequestCancellationReason[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (CaseNoteRequestCancellationReason)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof CaseNoteRequestCancellationReason)
		{
			super.addChild((CaseNoteRequestCancellationReason)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof CaseNoteRequestCancellationReason)
		{
			super.removeChild((CaseNoteRequestCancellationReason)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		CaseNoteRequestCancellationReasonCollection result = new CaseNoteRequestCancellationReasonCollection();
		result.add(CASENOTE_DESTROYED);
		result.add(CASENOTE_ARCHIVED);
		result.add(CASENOTE_SCANNED);
		result.add(REQ_PROCESSING_TIMEFRAME_EXCEEDED);
		result.add(TCI_CANCELLED);
		result.add(APPOINTMENT_CANCELLED);
		result.add(CANCELLED_BY_USER);
		return result;
	}
	public static CaseNoteRequestCancellationReason[] getNegativeInstances()
	{
		CaseNoteRequestCancellationReason[] instances = new CaseNoteRequestCancellationReason[7];
		instances[0] = CASENOTE_DESTROYED;
		instances[1] = CASENOTE_ARCHIVED;
		instances[2] = CASENOTE_SCANNED;
		instances[3] = REQ_PROCESSING_TIMEFRAME_EXCEEDED;
		instances[4] = TCI_CANCELLED;
		instances[5] = APPOINTMENT_CANCELLED;
		instances[6] = CANCELLED_BY_USER;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[7];
		negativeInstances[0] = "CASENOTE_DESTROYED";
		negativeInstances[1] = "CASENOTE_ARCHIVED";
		negativeInstances[2] = "CASENOTE_SCANNED";
		negativeInstances[3] = "REQ_PROCESSING_TIMEFRAME_EXCEEDED";
		negativeInstances[4] = "TCI_CANCELLED";
		negativeInstances[5] = "APPOINTMENT_CANCELLED";
		negativeInstances[6] = "CANCELLED_BY_USER";
		return negativeInstances;
	}
	public static CaseNoteRequestCancellationReason 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 CaseNoteRequestCancellationReason getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		CaseNoteRequestCancellationReason[] 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 = 1021316;
	public static final CaseNoteRequestCancellationReason CASENOTE_DESTROYED = new CaseNoteRequestCancellationReason(-2919, "Case Note Folder Record Destroyed", true, null, null, Color.Default);
	public static final CaseNoteRequestCancellationReason CASENOTE_ARCHIVED = new CaseNoteRequestCancellationReason(-2931, "Case Note Folder Record Archived", true, null, null, Color.Default);
	public static final CaseNoteRequestCancellationReason CASENOTE_SCANNED = new CaseNoteRequestCancellationReason(-2932, "Case Note Folder Record Scanned", true, null, null, Color.Default);
	public static final CaseNoteRequestCancellationReason REQ_PROCESSING_TIMEFRAME_EXCEEDED = new CaseNoteRequestCancellationReason(-2941, "Case Note Request Was Not Addressed in a Reasonable Time Period", true, null, null, Color.Default);
	public static final CaseNoteRequestCancellationReason TCI_CANCELLED = new CaseNoteRequestCancellationReason(-3310, "Request cancelled as a result of TCI cancellation", true, null, null, Color.Default);
	public static final CaseNoteRequestCancellationReason APPOINTMENT_CANCELLED = new CaseNoteRequestCancellationReason(-3328, "Request cancelled as a result of appointment cancellation", true, null, null, Color.Default);
	public static final CaseNoteRequestCancellationReason CANCELLED_BY_USER = new CaseNoteRequestCancellationReason(-3329, "Request cancelled by user", true, null, null, Color.Default);
}
