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

	public DocumentCategory()
	{
		super();
	}
	public DocumentCategory(int id)
	{
		super(id, "", true);
	}
	public DocumentCategory(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public DocumentCategory(int id, String text, boolean active, DocumentCategory parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public DocumentCategory(int id, String text, boolean active, DocumentCategory parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public DocumentCategory(int id, String text, boolean active, DocumentCategory parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static DocumentCategory buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new DocumentCategory(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (DocumentCategory)super.getParentInstance();
	}
	public DocumentCategory getParent()
	{
		return (DocumentCategory)super.getParentInstance();
	}
	public void setParent(DocumentCategory parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		DocumentCategory[] typedChildren = new DocumentCategory[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (DocumentCategory)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof DocumentCategory)
		{
			super.addChild((DocumentCategory)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof DocumentCategory)
		{
			super.removeChild((DocumentCategory)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		DocumentCategoryCollection result = new DocumentCategoryCollection();
		result.add(GPLETTER);
		result.add(RESULTREPORT);
		result.add(CATS_INTERIM_REPORT);
		result.add(CATS_FINAL_REPORT);
		result.add(PRESCRIPTIONS);
		result.add(REJECTIONS);
		result.add(LETTER_TO_PATIENT_DNA);
		result.add(DISCHARGE_SUMMARY);
		result.add(DISCHARGE_SUPPLEMENTARY);
		result.add(DISCHARGE_REPORTS);
		result.add(CORRESPONDANCE_NOTES);
		result.add(HISTORICAL);
		result.add(ASSESSMENT);
		result.add(RACPCSUMMARY);
		result.add(OPNOTES_REPORTS);
		result.add(ADHOC_DOCUMENT);
		result.add(INTERNAL_REFERRALS);
		result.add(CLINICAL_NOTES);
		return result;
	}
	public static DocumentCategory[] getNegativeInstances()
	{
		DocumentCategory[] instances = new DocumentCategory[18];
		instances[0] = GPLETTER;
		instances[1] = RESULTREPORT;
		instances[2] = CATS_INTERIM_REPORT;
		instances[3] = CATS_FINAL_REPORT;
		instances[4] = PRESCRIPTIONS;
		instances[5] = REJECTIONS;
		instances[6] = LETTER_TO_PATIENT_DNA;
		instances[7] = DISCHARGE_SUMMARY;
		instances[8] = DISCHARGE_SUPPLEMENTARY;
		instances[9] = DISCHARGE_REPORTS;
		instances[10] = CORRESPONDANCE_NOTES;
		instances[11] = HISTORICAL;
		instances[12] = ASSESSMENT;
		instances[13] = RACPCSUMMARY;
		instances[14] = OPNOTES_REPORTS;
		instances[15] = ADHOC_DOCUMENT;
		instances[16] = INTERNAL_REFERRALS;
		instances[17] = CLINICAL_NOTES;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[18];
		negativeInstances[0] = "GPLETTER";
		negativeInstances[1] = "RESULTREPORT";
		negativeInstances[2] = "CATS_INTERIM_REPORT";
		negativeInstances[3] = "CATS_FINAL_REPORT";
		negativeInstances[4] = "PRESCRIPTIONS";
		negativeInstances[5] = "REJECTIONS";
		negativeInstances[6] = "LETTER_TO_PATIENT_DNA";
		negativeInstances[7] = "DISCHARGE_SUMMARY";
		negativeInstances[8] = "DISCHARGE_SUPPLEMENTARY";
		negativeInstances[9] = "DISCHARGE_REPORTS";
		negativeInstances[10] = "CORRESPONDANCE_NOTES";
		negativeInstances[11] = "HISTORICAL";
		negativeInstances[12] = "ASSESSMENT";
		negativeInstances[13] = "RACPCSUMMARY";
		negativeInstances[14] = "OPNOTES_REPORTS";
		negativeInstances[15] = "ADHOC_DOCUMENT";
		negativeInstances[16] = "INTERNAL_REFERRALS";
		negativeInstances[17] = "CLINICAL_NOTES";
		return negativeInstances;
	}
	public static DocumentCategory 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 DocumentCategory getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		DocumentCategory[] 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 = 1021220;
	public static final DocumentCategory GPLETTER = new DocumentCategory(-1491, "Referral Letter", true, null, null, Color.Default);
	public static final DocumentCategory RESULTREPORT = new DocumentCategory(-1572, "Result Report", true, null, null, Color.Default);
	public static final DocumentCategory CATS_INTERIM_REPORT = new DocumentCategory(-1588, "CATS Interim Report", true, null, null, Color.Default);
	public static final DocumentCategory CATS_FINAL_REPORT = new DocumentCategory(-1589, "CATS Final Report", true, null, null, Color.Default);
	public static final DocumentCategory PRESCRIPTIONS = new DocumentCategory(-1594, "Prescriptions", true, null, null, Color.Default);
	public static final DocumentCategory REJECTIONS = new DocumentCategory(-1667, "REJECTIONS", true, null, null, Color.Default);
	public static final DocumentCategory LETTER_TO_PATIENT_DNA = new DocumentCategory(-1670, "Letter to patient DNA", true, null, null, Color.Default);
	public static final DocumentCategory DISCHARGE_SUMMARY = new DocumentCategory(-1726, "Discharge Summary", true, null, null, Color.Default);
	public static final DocumentCategory DISCHARGE_SUPPLEMENTARY = new DocumentCategory(-1823, "Discharge Supplementary", true, null, null, Color.Default);
	public static final DocumentCategory DISCHARGE_REPORTS = new DocumentCategory(-1868, "Discharge Reports", true, null, null, Color.Default);
	public static final DocumentCategory CORRESPONDANCE_NOTES = new DocumentCategory(-1899, "Correspondence Notes", true, null, null, Color.Default);
	public static final DocumentCategory HISTORICAL = new DocumentCategory(-1912, "Historical", true, null, null, Color.Default);
	public static final DocumentCategory ASSESSMENT = new DocumentCategory(-2145, "Assessment", true, null, null, Color.Default);
	public static final DocumentCategory RACPCSUMMARY = new DocumentCategory(-2182, "RACPC Summary", true, null, null, Color.Default);
	public static final DocumentCategory OPNOTES_REPORTS = new DocumentCategory(-2434, "eOpNotes Reports", true, null, null, Color.Default);
	public static final DocumentCategory ADHOC_DOCUMENT = new DocumentCategory(-2564, "Print dialog ad-hoc document", true, null, null, Color.Default);
	public static final DocumentCategory INTERNAL_REFERRALS = new DocumentCategory(-2723, "Internal Referrals", true, null, null, Color.Default);
	public static final DocumentCategory CLINICAL_NOTES = new DocumentCategory(-2822, "Clinical Notes", true, null, null, Color.Default);
}
