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

	public LocationType()
	{
		super();
	}
	public LocationType(int id)
	{
		super(id, "", true);
	}
	public LocationType(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public LocationType(int id, String text, boolean active, LocationType parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public LocationType(int id, String text, boolean active, LocationType parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public LocationType(int id, String text, boolean active, LocationType parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static LocationType buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new LocationType(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (LocationType)super.getParentInstance();
	}
	public LocationType getParent()
	{
		return (LocationType)super.getParentInstance();
	}
	public void setParent(LocationType parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		LocationType[] typedChildren = new LocationType[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (LocationType)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof LocationType)
		{
			super.addChild((LocationType)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof LocationType)
		{
			super.removeChild((LocationType)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		LocationTypeCollection result = new LocationTypeCollection();
		result.add(HOSP);
		result.add(WARD);
		result.add(CLINIC);
		result.add(UNKNOWN_TYPE);
		result.add(PATHOLOGYLABORATORY);
		result.add(CLINICALIMAGINGDEPARTMENT);
		result.add(DEPT);
		result.add(SURGERY);
		result.add(OUTPATIENT_DEPT);
		result.add(ANE);
		result.add(CCA);
		result.add(SECTOR);
		result.add(PHN_DISTRICT);
		result.add(CLINICAL);
		result.add(BUILDING);
		result.add(BAY);
		result.add(THEATRE);
		result.add(PROCEDURE_ROOM);
		result.add(CASE_NOTE_FOLDER_LOCATION);
		result.add(MEDICAL_RECORDS);
		return result;
	}
	public static LocationType[] getNegativeInstances()
	{
		LocationType[] instances = new LocationType[20];
		instances[0] = HOSP;
		instances[1] = WARD;
		instances[2] = CLINIC;
		instances[3] = UNKNOWN_TYPE;
		instances[4] = PATHOLOGYLABORATORY;
		instances[5] = CLINICALIMAGINGDEPARTMENT;
		instances[6] = DEPT;
		instances[7] = SURGERY;
		instances[8] = OUTPATIENT_DEPT;
		instances[9] = ANE;
		instances[10] = CCA;
		instances[11] = SECTOR;
		instances[12] = PHN_DISTRICT;
		instances[13] = CLINICAL;
		instances[14] = BUILDING;
		instances[15] = BAY;
		instances[16] = THEATRE;
		instances[17] = PROCEDURE_ROOM;
		instances[18] = CASE_NOTE_FOLDER_LOCATION;
		instances[19] = MEDICAL_RECORDS;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[20];
		negativeInstances[0] = "HOSP";
		negativeInstances[1] = "WARD";
		negativeInstances[2] = "CLINIC";
		negativeInstances[3] = "UNKNOWN_TYPE";
		negativeInstances[4] = "PATHOLOGYLABORATORY";
		negativeInstances[5] = "CLINICALIMAGINGDEPARTMENT";
		negativeInstances[6] = "DEPT";
		negativeInstances[7] = "SURGERY";
		negativeInstances[8] = "OUTPATIENT_DEPT";
		negativeInstances[9] = "ANE";
		negativeInstances[10] = "CCA";
		negativeInstances[11] = "SECTOR";
		negativeInstances[12] = "PHN_DISTRICT";
		negativeInstances[13] = "CLINICAL";
		negativeInstances[14] = "BUILDING";
		negativeInstances[15] = "BAY";
		negativeInstances[16] = "THEATRE";
		negativeInstances[17] = "PROCEDURE_ROOM";
		negativeInstances[18] = "CASE_NOTE_FOLDER_LOCATION";
		negativeInstances[19] = "MEDICAL_RECORDS";
		return negativeInstances;
	}
	public static LocationType 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 LocationType getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		LocationType[] 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 = 1021069;
	public static final LocationType HOSP = new LocationType(-84, "Hospital", true, null, null, Color.Black);
	public static final LocationType WARD = new LocationType(-85, "Ward", true, null, null, Color.Black);
	public static final LocationType CLINIC = new LocationType(-307, "Clinic", true, null, null, Color.Default);
	public static final LocationType UNKNOWN_TYPE = new LocationType(-484, "Unknown", true, null, null, Color.Default);
	public static final LocationType PATHOLOGYLABORATORY = new LocationType(-588, "Pathology Laboratory", true, null, null, Color.Default);
	public static final LocationType CLINICALIMAGINGDEPARTMENT = new LocationType(-589, "Radiology", true, null, null, Color.Default);
	public static final LocationType DEPT = new LocationType(-626, "Department", true, null, null, Color.Default);
	public static final LocationType SURGERY = new LocationType(-853, "Surgery", true, null, null, Color.Default);
	public static final LocationType OUTPATIENT_DEPT = new LocationType(-1173, "Outpatient Dept.", true, null, null, Color.Default);
	public static final LocationType ANE = new LocationType(-1186, "Emergency Dept", true, null, null, Color.Default);
	public static final LocationType CCA = new LocationType(-1419, "CCA", true, null, null, Color.Default);
	public static final LocationType SECTOR = new LocationType(-1420, "Sector", true, null, null, Color.Default);
	public static final LocationType PHN_DISTRICT = new LocationType(-1421, "PHN District", true, null, null, Color.Default);
	public static final LocationType CLINICAL = new LocationType(-1595, "Clinical Diagnostics Provider", true, null, null, Color.Default);
	public static final LocationType BUILDING = new LocationType(-3044, "Building", true, null, null, Color.Default);
	public static final LocationType BAY = new LocationType(-1611, "Bay", true, null, null, Color.Default);
	public static final LocationType THEATRE = new LocationType(-1738, "Theatre", true, null, null, Color.Default);
	public static final LocationType PROCEDURE_ROOM = new LocationType(-3042, "Procedure Room", true, null, null, Color.Default);
	public static final LocationType CASE_NOTE_FOLDER_LOCATION = new LocationType(-2918, "Case Note Folder Location", true, null, null, Color.Default);
	public static final LocationType MEDICAL_RECORDS = new LocationType(-2940, "Medical Records", true, null, null, Color.Default);
}
