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

	public DocumentStatus()
	{
		super();
	}
	public DocumentStatus(int id)
	{
		super(id, "", true);
	}
	public DocumentStatus(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public DocumentStatus(int id, String text, boolean active, DocumentStatus parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public DocumentStatus(int id, String text, boolean active, DocumentStatus parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public DocumentStatus(int id, String text, boolean active, DocumentStatus parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static DocumentStatus buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new DocumentStatus(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (DocumentStatus)super.getParentInstance();
	}
	public DocumentStatus getParent()
	{
		return (DocumentStatus)super.getParentInstance();
	}
	public void setParent(DocumentStatus parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		DocumentStatus[] typedChildren = new DocumentStatus[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (DocumentStatus)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof DocumentStatus)
		{
			super.addChild((DocumentStatus)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof DocumentStatus)
		{
			super.removeChild((DocumentStatus)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		DocumentStatusCollection result = new DocumentStatusCollection();
		result.add(LETTERREQUIRED);
		result.add(NOLETTERREQUIRED);
		result.add(DICTATED);
		result.add(NOLETTERDICTATED);
		result.add(GENNOTPRINTED);
		result.add(PRINTEDNOSIGNATURE);
		result.add(SIGNED);
		result.add(SUPLEMENTRY);
		result.add(DRAFT);
		result.add(FINAL);
		result.add(FOR_REVIEW);
		result.add(FOR_UPDATE);
		result.add(READY_TO_SEND);
		result.add(COMPLETED);
		return result;
	}
	public static DocumentStatus[] getNegativeInstances()
	{
		DocumentStatus[] instances = new DocumentStatus[14];
		instances[0] = LETTERREQUIRED;
		instances[1] = NOLETTERREQUIRED;
		instances[2] = DICTATED;
		instances[3] = NOLETTERDICTATED;
		instances[4] = GENNOTPRINTED;
		instances[5] = PRINTEDNOSIGNATURE;
		instances[6] = SIGNED;
		instances[7] = SUPLEMENTRY;
		instances[8] = DRAFT;
		instances[9] = FINAL;
		instances[10] = FOR_REVIEW;
		instances[11] = FOR_UPDATE;
		instances[12] = READY_TO_SEND;
		instances[13] = COMPLETED;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[14];
		negativeInstances[0] = "LETTERREQUIRED";
		negativeInstances[1] = "NOLETTERREQUIRED";
		negativeInstances[2] = "DICTATED";
		negativeInstances[3] = "NOLETTERDICTATED";
		negativeInstances[4] = "GENNOTPRINTED";
		negativeInstances[5] = "PRINTEDNOSIGNATURE";
		negativeInstances[6] = "SIGNED";
		negativeInstances[7] = "SUPLEMENTRY";
		negativeInstances[8] = "DRAFT";
		negativeInstances[9] = "FINAL";
		negativeInstances[10] = "FOR_REVIEW";
		negativeInstances[11] = "FOR_UPDATE";
		negativeInstances[12] = "READY_TO_SEND";
		negativeInstances[13] = "COMPLETED";
		return negativeInstances;
	}
	public static DocumentStatus 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 DocumentStatus getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		DocumentStatus[] 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 = 1021127;
	public static final DocumentStatus LETTERREQUIRED = new DocumentStatus(-677, "Letter Required", true, null, new ims.framework.utils.ImagePath(111108, "Images/Correspondence/new.gif"), Color.Default);
	public static final DocumentStatus NOLETTERREQUIRED = new DocumentStatus(-557, "No Letter Required", true, null, new ims.framework.utils.ImagePath(111104, "Images/Correspondence/cancel.gif"), Color.Default);
	public static final DocumentStatus DICTATED = new DocumentStatus(-556, "Dictated", true, null, new ims.framework.utils.ImagePath(111102, "Images/Correspondence/Message.gif"), Color.Default);
	public static final DocumentStatus NOLETTERDICTATED = new DocumentStatus(-560, "No Letter Dictated", true, null, new ims.framework.utils.ImagePath(111103, "Images/Correspondence/Message-Delete.gif"), Color.Default);
	public static final DocumentStatus GENNOTPRINTED = new DocumentStatus(-558, "Generated and Not printed", true, null, new ims.framework.utils.ImagePath(111100, "Images/Correspondence/pdf.gif"), Color.Default);
	public static final DocumentStatus PRINTEDNOSIGNATURE = new DocumentStatus(-559, "Printed and awaiting signature", true, null, new ims.framework.utils.ImagePath(111101, "Images/Correspondence/Printer.gif"), Color.Default);
	public static final DocumentStatus SIGNED = new DocumentStatus(-555, "Signed", true, null, new ims.framework.utils.ImagePath(111107, "Images/Correspondence/Pencil.gif"), Color.Default);
	public static final DocumentStatus SUPLEMENTRY = new DocumentStatus(-590, "Supplementry", true, null, new ims.framework.utils.ImagePath(111109, "Images/Correspondence/Profile.gif"), Color.Default);
	public static final DocumentStatus DRAFT = new DocumentStatus(-2059, "Draft", true, null, null, Color.Default);
	public static final DocumentStatus FINAL = new DocumentStatus(-2060, "Final", true, null, null, Color.Default);
	public static final DocumentStatus FOR_REVIEW = new DocumentStatus(-2080, "For Review", true, null, null, Color.Default);
	public static final DocumentStatus FOR_UPDATE = new DocumentStatus(-2081, "For Update", true, null, null, Color.Default);
	public static final DocumentStatus READY_TO_SEND = new DocumentStatus(-2082, "Ready To Send", true, null, null, Color.Default);
	public static final DocumentStatus COMPLETED = new DocumentStatus(-2083, "Completed", true, null, null, Color.Default);
}
