This commit is contained in:
@@ -84,6 +84,7 @@ var orders_confirm_button: Button
|
|||||||
var orders_advance_button: Button
|
var orders_advance_button: Button
|
||||||
var orders_advance_option: OptionButton
|
var orders_advance_option: OptionButton
|
||||||
var orders_submit_final_button: Button
|
var orders_submit_final_button: Button
|
||||||
|
var orders_close_button: Button
|
||||||
var orders_status: Label
|
var orders_status: Label
|
||||||
var order_search_timer: Timer
|
var order_search_timer: Timer
|
||||||
var staged_order_codes: Array[String] = []
|
var staged_order_codes: Array[String] = []
|
||||||
@@ -362,8 +363,6 @@ func open_computer() -> void:
|
|||||||
func close_computer() -> bool:
|
func close_computer() -> bool:
|
||||||
if not computer_overlay.visible:
|
if not computer_overlay.visible:
|
||||||
return false
|
return false
|
||||||
if final_orders_mode:
|
|
||||||
return false
|
|
||||||
close_vitals()
|
close_vitals()
|
||||||
close_medical_history()
|
close_medical_history()
|
||||||
close_orders()
|
close_orders()
|
||||||
@@ -468,11 +467,11 @@ func _build_orders_window() -> void:
|
|||||||
title.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
title.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
title.add_theme_font_size_override("font_size", 30)
|
title.add_theme_font_size_override("font_size", 30)
|
||||||
header.add_child(title)
|
header.add_child(title)
|
||||||
var close := Button.new()
|
orders_close_button = Button.new()
|
||||||
close.text = "Close"
|
orders_close_button.text = "Close"
|
||||||
close.pressed.connect(close_orders)
|
orders_close_button.pressed.connect(close_orders)
|
||||||
header.add_child(close)
|
header.add_child(orders_close_button)
|
||||||
header.gui_input.connect(_on_computer_window_header_input.bind(orders_window, close))
|
header.gui_input.connect(_on_computer_window_header_input.bind(orders_window, orders_close_button))
|
||||||
orders_window.gui_input.connect(_on_computer_window_input.bind(orders_window))
|
orders_window.gui_input.connect(_on_computer_window_input.bind(orders_window))
|
||||||
orders_status = Label.new()
|
orders_status = Label.new()
|
||||||
orders_status.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
orders_status.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||||
@@ -577,8 +576,6 @@ func open_orders() -> void:
|
|||||||
func close_orders() -> bool:
|
func close_orders() -> bool:
|
||||||
if orders_window == null or not orders_window.visible:
|
if orders_window == null or not orders_window.visible:
|
||||||
return false
|
return false
|
||||||
if final_orders_mode:
|
|
||||||
return false
|
|
||||||
orders_window.visible = false
|
orders_window.visible = false
|
||||||
return true
|
return true
|
||||||
|
|
||||||
@@ -685,13 +682,14 @@ func configure_orders(attempt: Dictionary) -> void:
|
|||||||
orders_launcher.get_node("Label").text = "Orders •"
|
orders_launcher.get_node("Label").text = "Orders •"
|
||||||
known_order_result_count = result_count
|
known_order_result_count = result_count
|
||||||
final_orders_mode = str(attempt.get("state", "")) == "final_orders"
|
final_orders_mode = str(attempt.get("state", "")) == "final_orders"
|
||||||
|
orders_advance_button.disabled = false
|
||||||
|
orders_submit_final_button.disabled = false
|
||||||
orders_advance_button.visible = not final_orders_mode
|
orders_advance_button.visible = not final_orders_mode
|
||||||
orders_advance_option.visible = not final_orders_mode
|
orders_advance_option.visible = not final_orders_mode
|
||||||
orders_submit_final_button.visible = final_orders_mode
|
orders_submit_final_button.visible = final_orders_mode
|
||||||
|
orders_close_button.visible = true
|
||||||
if final_orders_mode:
|
if final_orders_mode:
|
||||||
var deadline := str(attempt.get("finalOrdersDeadlineUtc", ""))
|
orders_status.text = "FINAL STEP — Review your active orders. Add or cancel anything necessary, then select Submit Final Orders. Pending results do not need to return first."
|
||||||
orders_status.text = "FINAL ORDERS — Add or cancel orders, then submit to complete the case.%s" % [
|
|
||||||
" Deadline: %s" % deadline if not deadline.is_empty() else ""]
|
|
||||||
open_computer()
|
open_computer()
|
||||||
open_orders()
|
open_orders()
|
||||||
elif orders_status.text.begins_with("Submitting") or orders_status.text.begins_with("Cancelling") \
|
elif orders_status.text.begins_with("Submitting") or orders_status.text.begins_with("Cancelling") \
|
||||||
@@ -1445,7 +1443,7 @@ func _ensure_physical_exam_panel() -> void:
|
|||||||
physical_exam_status.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
physical_exam_status.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||||
actions.add_child(physical_exam_status)
|
actions.add_child(physical_exam_status)
|
||||||
physical_exam_finish_button = Button.new()
|
physical_exam_finish_button = Button.new()
|
||||||
physical_exam_finish_button.text = "Finish Case"
|
physical_exam_finish_button.text = "Review Final Orders"
|
||||||
physical_exam_finish_button.custom_minimum_size = Vector2(170.0, 48.0)
|
physical_exam_finish_button.custom_minimum_size = Vector2(170.0, 48.0)
|
||||||
physical_exam_finish_button.pressed.connect(func(): physical_exam_finish_requested.emit())
|
physical_exam_finish_button.pressed.connect(func(): physical_exam_finish_requested.emit())
|
||||||
actions.add_child(physical_exam_finish_button)
|
actions.add_child(physical_exam_finish_button)
|
||||||
|
|||||||
@@ -136,8 +136,13 @@ func _run() -> void:
|
|||||||
screen.active_scene.close_orders()
|
screen.active_scene.close_orders()
|
||||||
screen.active_scene.configure_orders({"state": "final_orders", "activeOrderCodes": [], "activeOrders": [], "chart": [], "finalOrdersDeadlineUtc": "2026-08-14T12:00:00Z"})
|
screen.active_scene.configure_orders({"state": "final_orders", "activeOrderCodes": [], "activeOrders": [], "chart": [], "finalOrdersDeadlineUtc": "2026-08-14T12:00:00Z"})
|
||||||
_assert(screen.active_scene.is_computer_open() and screen.active_scene.orders_window.visible, "final orders should automatically open the Orders app")
|
_assert(screen.active_scene.is_computer_open() and screen.active_scene.orders_window.visible, "final orders should automatically open the Orders app")
|
||||||
_assert(screen.active_scene.orders_submit_final_button.visible and not screen.active_scene.orders_advance_button.visible, "final orders should expose submission and lock time advancement")
|
_assert(screen.active_scene.orders_submit_final_button.visible and not screen.active_scene.orders_submit_final_button.disabled \
|
||||||
_assert(not screen.active_scene.close_orders(), "the Orders app should remain locked open during final orders")
|
and not screen.active_scene.orders_advance_button.visible, "final orders should expose an enabled submission while locking time advancement")
|
||||||
|
_assert(screen.active_scene.orders_status.text.contains("Pending results do not need to return"), "final review should clearly explain pending orders")
|
||||||
|
_assert(screen.active_scene.close_orders(), "the Orders app should remain closable during final review")
|
||||||
|
_assert(screen.active_scene.close_computer(), "the computer should remain closable during final review")
|
||||||
|
screen.active_scene.open_computer()
|
||||||
|
screen.active_scene.open_orders()
|
||||||
screen.active_scene.final_orders_mode = false
|
screen.active_scene.final_orders_mode = false
|
||||||
screen.active_scene.close_orders()
|
screen.active_scene.close_orders()
|
||||||
screen.active_scene.close_computer()
|
screen.active_scene.close_computer()
|
||||||
|
|||||||
Reference in New Issue
Block a user