Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/** * EmergencyTriage.java * Provided the necessary information here, * making sure to delete these lines. */ // This is the beginning of the source

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

/** * EmergencyTriage.java * Provided the necessary information here, * making sure to delete these lines. */

// This is the beginning of the source code to help you get started. // Do not change the following:

public class EmergencyTriage { private Heap waiting;

/** * The empty EmergencyTriage is initialized. */ public EmergencyTriage() { waiting = new Heap(); }

/** * Heap.java * Provide the necessary header information here, * making sure to delete these lines. */

import java.util.List; import java.util.ArrayList; import java.util.NoSuchElementException;

// This is the beginning of the source code to help you get started. // Do not change the following:

public class Heap> {

private ArrayList heap; private int size; private static final int CAPACITY = 100;

/** * Creates an empty heap. */ public Heap() { heap = new ArrayList(CAPACITY); for (int i=0; i

/** * NoSuchCategoryException.java */

/** * This exception indicates that the triage category for an ERPatient * not a valid category. * These categories are determined by the ERPatient class. */ public class NoSuchCategoryException extends RuntimeException { /** * Creates a new exception. * @param msg The error message. */ public NoSuchCategoryException(String msg) { super(msg); } /** * Creates a new exception. */ public NoSuchCategoryException() { super(); } }

/** * ERPatient.java */ /** * Class ERPatient represents the record of a patient presenting to an Emergency room. * Patients are assessed and registered by the triage nurse, who determines * their level or priority for detailed assessment and treatment in the Emergency Room. */ public class ERPatient implements Comparable {

private static int admissionNumber = 0; private int orderStamp; private String id; private String lastName; private String firstName; private int priorityNum;

protected final static String[] categories = {"Life-threatening","Major fracture","Acute","Chronic","Ambulatory"}; /** * Creates an ER record for the registered patient. * @param lastName The patient's last name. * @param firstName The patient's first and subsequent names. * @param triageCategory: This is the category given by the triage nurse after a preliminary assessment based on the patient's complaint and some vital signs. * The categories used, in order of priority are: *

*
Life-threatening
Needs to be treated immediately.
*
Major fracture
Needs splinting, support and possible surgery.
*
Acute
Symptoms that indicate an unknown and unfamiliar medical condition.
*
Chronic
Symptoms appear related to an exacerbation of a known condition.
*
Ambulatory
Does not need a bed; condition will not worsen with some waiting.
*
*/ public ERPatient(String lastName, String firstName, String triageCategory) { this.lastName = lastName; this.firstName = firstName; orderStamp = admissionNumber++; id = lastName+"_"+orderStamp++; priorityNum = verify_triageCategory(triageCategory); }

private int verify_triageCategory(String triageCategory) { for (int i=0; i

private static String categories() { StringBuilder sb = new StringBuilder(10*categories.length); sb.append("Acceptable category list: \t"); for (String s: categories) { sb.append(s+", "); } // the categories are never empty // remove the last comma and space sb.delete(sb.length()-2,sb.length()); return sb.toString(); } /** * Decides which patient has the highest priority level for admission to the * Emergency room. * Priority is determined first by the triage category, and then by the length of time waiting. * @param other The patient record being compared to this patient record. * @return a number 0 indicates that the other patient has higher priority. * If 0, then the two records belong to the same patient. * @throws NullPointerException if other is null. */ public int compareTo(ERPatient other) { if (other == null) { throw new NullPointerException("Cannot compare ERPatient to a null object"); } int triageOrder = priorityNum - other.priorityNum; if (triageOrder == 0) { triageOrder = orderStamp - other.orderStamp; } return triageOrder; }

/** * Equality of patient records is determined by id, which indicates that the records * belong to the same person. * @param other The patient record to compare. * @return true if the records are for the same patient; false otherwise. */ public boolean equals(ERPatient other) { return id.equals(other.id); }

/** * @return The id number of this patient. */ public String getId() { return id; }

/** * @return The priority level assigned the patient. Lower numbers have higher priority. */ public int getPriorityNum() { return priorityNum; }

/** * @return The actual triage category that was assigned the patient. */ public String getTriageCategory() { return categories[priorityNum-1]; }

/** * @return The patient record information. */ public String toString() { return lastName+", "+firstName+": order number: "+orderStamp+", triage category: "

Hospital Admission Information System Description. The local hospital Emergency Room (ER) admits and treats patients that present themselves for medical treatment. Each patient is assessed by a triage nurse, who performs a preliminary assessment to determine the priority level of the patient's presenting complaints. If the patient needs immediate attention, the triage nurse provides enough intervention to stabilize them. An ER patient record is initialized, containing the patients's name and complaint. A priority level is added to the record by the triage nurse. Patients are released from "triage" into the ER proper once there is an available Emergency Room Physician who can provide further assessment, treatment, is and referrals as needed. ER physicians treat patients in the order of the triage queue, which manages an orde determined firstly by the triage nurse's assessment and secondly by the amount of time that has passed since the patient registered. Hospital Admission Information System Description. The local hospital Emergency Room (ER) admits and treats patients that present themselves for medical treatment. Each patient is assessed by a triage nurse, who performs a preliminary assessment to determine the priority level of the patient's presenting complaints. If the patient needs immediate attention, the triage nurse provides enough intervention to stabilize them. An ER patient record is initialized, containing the patients's name and complaint. A priority level is added to the record by the triage nurse. Patients are released from "triage" into the ER proper once there is an available Emergency Room Physician who can provide further assessment, treatment, is and referrals as needed. ER physicians treat patients in the order of the triage queue, which manages an orde determined firstly by the triage nurse's assessment and secondly by the amount of time that has passed since the patient registered

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions