Add graphical CCS orders and finalization
This commit is contained in:
@@ -3,6 +3,11 @@ extends Control
|
||||
signal choice_selected(choice_id: String)
|
||||
signal physical_exam_selected(exam_code: String)
|
||||
signal physical_exam_finish_requested
|
||||
signal order_search_requested(query: String)
|
||||
signal orders_submit_requested(codes: Array)
|
||||
signal order_cancel_requested(code: String)
|
||||
signal time_advance_requested(minutes: int)
|
||||
signal final_orders_submit_requested
|
||||
signal debrief_return_requested
|
||||
signal debrief_repeat_requested
|
||||
|
||||
@@ -45,6 +50,7 @@ const DIALOGUE_BUBBLE_VERTICAL_CHROME := 95.0
|
||||
@onready var medical_history_header: HBoxContainer = $ComputerOverlay/MedicalHistoryWindow/Margin/Content/Header
|
||||
@onready var medical_history_close_button: Button = $ComputerOverlay/MedicalHistoryWindow/Margin/Content/Header/Close
|
||||
@onready var medical_history_text: Label = $ComputerOverlay/MedicalHistoryWindow/Margin/Content/Text
|
||||
@onready var orders_launcher: Button = $ComputerOverlay/OrdersLauncher
|
||||
|
||||
var blink_tween: Tween
|
||||
var dialogue_tween: Tween
|
||||
@@ -67,6 +73,23 @@ var medical_history_exam_text: RichTextLabel
|
||||
var medical_history_exam_scroll: ScrollContainer
|
||||
var medical_history_tab_button: Button
|
||||
var physical_exam_tab_button: Button
|
||||
var orders_window: PanelContainer
|
||||
var orders_search: LineEdit
|
||||
var orders_search_results: VBoxContainer
|
||||
var orders_staged: VBoxContainer
|
||||
var orders_active: VBoxContainer
|
||||
var orders_results: RichTextLabel
|
||||
var orders_tabs: TabContainer
|
||||
var orders_confirm_button: Button
|
||||
var orders_advance_button: Button
|
||||
var orders_advance_option: OptionButton
|
||||
var orders_submit_final_button: Button
|
||||
var orders_status: Label
|
||||
var staged_order_codes: Array[String] = []
|
||||
var order_names := {}
|
||||
var final_orders_mode := false
|
||||
var active_order_codes: Array = []
|
||||
var known_order_result_count := -1
|
||||
var experience_mode := "management"
|
||||
var pending_choices: Array = []
|
||||
var available_choices: Array = []
|
||||
@@ -93,6 +116,7 @@ func _ready() -> void:
|
||||
vitals_close_button.pressed.connect(close_vitals)
|
||||
medical_history_launcher.pressed.connect(open_medical_history)
|
||||
medical_history_close_button.pressed.connect(close_medical_history)
|
||||
orders_launcher.pressed.connect(open_orders)
|
||||
vitals_header.gui_input.connect(_on_computer_window_header_input.bind(vitals_window, vitals_close_button))
|
||||
medical_history_header.gui_input.connect(_on_computer_window_header_input.bind(
|
||||
medical_history_window, medical_history_close_button))
|
||||
@@ -103,7 +127,9 @@ func _ready() -> void:
|
||||
_style_computer_window(medical_history_window)
|
||||
_style_desktop_shortcut(vitals_launcher)
|
||||
_style_desktop_shortcut(medical_history_launcher)
|
||||
_style_desktop_shortcut(orders_launcher)
|
||||
_build_medical_history_tabs()
|
||||
_build_orders_window()
|
||||
_resize_computer_windows()
|
||||
_update_clock()
|
||||
_schedule_patient_blink()
|
||||
@@ -325,8 +351,11 @@ func open_computer() -> void:
|
||||
func close_computer() -> bool:
|
||||
if not computer_overlay.visible:
|
||||
return false
|
||||
if final_orders_mode:
|
||||
return false
|
||||
close_vitals()
|
||||
close_medical_history()
|
||||
close_orders()
|
||||
computer_overlay.visible = false
|
||||
computer_launcher.visible = computer_available
|
||||
if dialogue_tween and dialogue_tween.is_valid():
|
||||
@@ -352,6 +381,8 @@ func close_transient_overlay() -> bool:
|
||||
return close_vitals()
|
||||
if top_window == medical_history_window:
|
||||
return close_medical_history()
|
||||
if top_window == orders_window:
|
||||
return close_orders()
|
||||
return close_computer()
|
||||
|
||||
|
||||
@@ -397,6 +428,278 @@ func is_medical_history_open() -> bool:
|
||||
return medical_history_window.visible
|
||||
|
||||
|
||||
func _build_orders_window() -> void:
|
||||
orders_window = PanelContainer.new()
|
||||
orders_window.name = "OrdersWindow"
|
||||
orders_window.visible = false
|
||||
orders_window.z_index = 2
|
||||
orders_window.size = Vector2(1040.0, 700.0)
|
||||
orders_window.position = Vector2(280.0, 100.0)
|
||||
_style_computer_window(orders_window)
|
||||
computer_overlay.add_child(orders_window)
|
||||
var margin := MarginContainer.new()
|
||||
margin.add_theme_constant_override("margin_left", 28)
|
||||
margin.add_theme_constant_override("margin_top", 22)
|
||||
margin.add_theme_constant_override("margin_right", 28)
|
||||
margin.add_theme_constant_override("margin_bottom", 24)
|
||||
orders_window.add_child(margin)
|
||||
var content := VBoxContainer.new()
|
||||
content.add_theme_constant_override("separation", 12)
|
||||
margin.add_child(content)
|
||||
var header := HBoxContainer.new()
|
||||
header.mouse_default_cursor_shape = Control.CURSOR_MOVE
|
||||
content.add_child(header)
|
||||
var title := Label.new()
|
||||
title.text = "Orders"
|
||||
title.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
title.add_theme_font_size_override("font_size", 30)
|
||||
header.add_child(title)
|
||||
var close := Button.new()
|
||||
close.text = "Close"
|
||||
close.pressed.connect(close_orders)
|
||||
header.add_child(close)
|
||||
header.gui_input.connect(_on_computer_window_header_input.bind(orders_window, close))
|
||||
orders_window.gui_input.connect(_on_computer_window_input.bind(orders_window))
|
||||
orders_status = Label.new()
|
||||
orders_status.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
content.add_child(orders_status)
|
||||
orders_tabs = TabContainer.new()
|
||||
orders_tabs.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
content.add_child(orders_tabs)
|
||||
_build_order_search_tab()
|
||||
_build_active_orders_tab()
|
||||
_build_order_results_tab()
|
||||
var actions := HBoxContainer.new()
|
||||
actions.alignment = BoxContainer.ALIGNMENT_END
|
||||
content.add_child(actions)
|
||||
orders_advance_option = OptionButton.new()
|
||||
for item in [["10 minutes", 10], ["1 hour", 60], ["4 hours", 240], ["1 day", 1440]]:
|
||||
orders_advance_option.add_item(item[0])
|
||||
orders_advance_option.set_item_metadata(orders_advance_option.item_count - 1, item[1])
|
||||
actions.add_child(orders_advance_option)
|
||||
orders_advance_button = Button.new()
|
||||
orders_advance_button.text = "Obtain Results"
|
||||
orders_advance_button.pressed.connect(func(): time_advance_requested.emit(
|
||||
int(orders_advance_option.get_item_metadata(orders_advance_option.selected))))
|
||||
actions.add_child(orders_advance_button)
|
||||
orders_submit_final_button = Button.new()
|
||||
orders_submit_final_button.text = "Submit Final Orders"
|
||||
orders_submit_final_button.visible = false
|
||||
orders_submit_final_button.pressed.connect(func(): final_orders_submit_requested.emit())
|
||||
actions.add_child(orders_submit_final_button)
|
||||
|
||||
|
||||
func _build_order_search_tab() -> void:
|
||||
var page := VBoxContainer.new()
|
||||
page.name = "Search"
|
||||
page.add_theme_constant_override("separation", 8)
|
||||
orders_tabs.add_child(page)
|
||||
var row := HBoxContainer.new()
|
||||
page.add_child(row)
|
||||
orders_search = LineEdit.new()
|
||||
orders_search.placeholder_text = "Search tests, medications, treatments, and procedures"
|
||||
orders_search.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
orders_search.text_submitted.connect(func(_value): _request_order_search())
|
||||
row.add_child(orders_search)
|
||||
var search_button := Button.new()
|
||||
search_button.text = "Search"
|
||||
search_button.pressed.connect(_request_order_search)
|
||||
row.add_child(search_button)
|
||||
var search_scroll := ScrollContainer.new()
|
||||
search_scroll.custom_minimum_size.y = 170.0
|
||||
search_scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
page.add_child(search_scroll)
|
||||
orders_search_results = VBoxContainer.new()
|
||||
orders_search_results.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
search_scroll.add_child(orders_search_results)
|
||||
page.add_child(Label.new())
|
||||
page.get_child(page.get_child_count() - 1).text = "Orders awaiting confirmation"
|
||||
orders_staged = VBoxContainer.new()
|
||||
page.add_child(orders_staged)
|
||||
orders_confirm_button = Button.new()
|
||||
orders_confirm_button.text = "Confirm Orders"
|
||||
orders_confirm_button.disabled = true
|
||||
orders_confirm_button.pressed.connect(_confirm_staged_orders)
|
||||
page.add_child(orders_confirm_button)
|
||||
|
||||
|
||||
func _build_active_orders_tab() -> void:
|
||||
var page := VBoxContainer.new()
|
||||
page.name = "Active Orders"
|
||||
orders_tabs.add_child(page)
|
||||
var scroll := ScrollContainer.new()
|
||||
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
page.add_child(scroll)
|
||||
orders_active = VBoxContainer.new()
|
||||
orders_active.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
scroll.add_child(orders_active)
|
||||
|
||||
|
||||
func _build_order_results_tab() -> void:
|
||||
var page := VBoxContainer.new()
|
||||
page.name = "Results"
|
||||
orders_tabs.add_child(page)
|
||||
orders_results = RichTextLabel.new()
|
||||
orders_results.bbcode_enabled = true
|
||||
orders_results.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
page.add_child(orders_results)
|
||||
|
||||
|
||||
func open_orders() -> void:
|
||||
if not computer_overlay.visible:
|
||||
return
|
||||
orders_window.visible = true
|
||||
orders_launcher.get_node("Label").text = "Orders"
|
||||
_bring_computer_window_to_front(orders_window)
|
||||
orders_search.grab_focus()
|
||||
|
||||
|
||||
func close_orders() -> bool:
|
||||
if orders_window == null or not orders_window.visible:
|
||||
return false
|
||||
if final_orders_mode:
|
||||
return false
|
||||
orders_window.visible = false
|
||||
return true
|
||||
|
||||
|
||||
func _request_order_search() -> void:
|
||||
var query := orders_search.text.strip_edges()
|
||||
if query.length() < 2:
|
||||
orders_status.text = "Enter at least two characters to search."
|
||||
return
|
||||
orders_status.text = "Searching..."
|
||||
order_search_requested.emit(query)
|
||||
|
||||
|
||||
func render_order_search(rows: Array) -> void:
|
||||
_clear_dynamic_children(orders_search_results)
|
||||
orders_status.text = "" if not rows.is_empty() else "No matching orders found."
|
||||
for raw_order in rows:
|
||||
var order: Dictionary = raw_order
|
||||
var code := str(order.get("code", ""))
|
||||
order_names[code] = str(order.get("canonicalName", code.capitalize()))
|
||||
var button := Button.new()
|
||||
button.text = "%s · %s" % [order_names[code], str(order.get("category", "")).capitalize()]
|
||||
button.alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||
button.disabled = code in staged_order_codes or code in active_order_codes
|
||||
button.pressed.connect(_stage_order.bind(code))
|
||||
orders_search_results.add_child(button)
|
||||
|
||||
|
||||
func _stage_order(code: String) -> void:
|
||||
if code.is_empty() or code in staged_order_codes:
|
||||
return
|
||||
staged_order_codes.append(code)
|
||||
_render_staged_orders()
|
||||
|
||||
|
||||
func _render_staged_orders() -> void:
|
||||
_clear_dynamic_children(orders_staged)
|
||||
for code in staged_order_codes:
|
||||
var row := HBoxContainer.new()
|
||||
orders_staged.add_child(row)
|
||||
var label := Label.new()
|
||||
label.text = str(order_names.get(code, code.capitalize()))
|
||||
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
row.add_child(label)
|
||||
var remove := Button.new()
|
||||
remove.text = "Remove"
|
||||
remove.pressed.connect(_remove_staged_order.bind(code))
|
||||
row.add_child(remove)
|
||||
orders_confirm_button.disabled = staged_order_codes.is_empty()
|
||||
|
||||
|
||||
func _remove_staged_order(code: String) -> void:
|
||||
staged_order_codes.erase(code)
|
||||
_render_staged_orders()
|
||||
|
||||
|
||||
func _confirm_staged_orders() -> void:
|
||||
if staged_order_codes.is_empty():
|
||||
return
|
||||
orders_submit_requested.emit(staged_order_codes.duplicate())
|
||||
|
||||
|
||||
func configure_orders(attempt: Dictionary) -> void:
|
||||
if orders_window == null:
|
||||
return
|
||||
active_order_codes = attempt.get("activeOrderCodes", []).duplicate()
|
||||
for code in attempt.get("activeOrderCodes", []):
|
||||
staged_order_codes.erase(str(code))
|
||||
_render_staged_orders()
|
||||
_render_active_orders(attempt.get("activeOrders", []))
|
||||
_render_order_results(attempt.get("chart", []))
|
||||
var result_count := _order_result_count(attempt.get("chart", []))
|
||||
if known_order_result_count >= 0 and result_count > known_order_result_count and not orders_window.visible:
|
||||
orders_launcher.get_node("Label").text = "Orders •"
|
||||
known_order_result_count = result_count
|
||||
final_orders_mode = str(attempt.get("state", "")) == "final_orders"
|
||||
orders_advance_button.visible = not final_orders_mode
|
||||
orders_advance_option.visible = not final_orders_mode
|
||||
orders_submit_final_button.visible = final_orders_mode
|
||||
if final_orders_mode:
|
||||
var deadline := str(attempt.get("finalOrdersDeadlineUtc", ""))
|
||||
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_orders()
|
||||
|
||||
|
||||
func _render_active_orders(rows: Array) -> void:
|
||||
_clear_dynamic_children(orders_active)
|
||||
if rows.is_empty():
|
||||
var empty := Label.new()
|
||||
empty.text = "No active orders."
|
||||
orders_active.add_child(empty)
|
||||
return
|
||||
for raw_order in rows:
|
||||
var order: Dictionary = raw_order
|
||||
var row := HBoxContainer.new()
|
||||
orders_active.add_child(row)
|
||||
var label := Label.new()
|
||||
label.text = "%s — %s, %s" % [str(order.get("name", "Order")), str(order.get("route", "")), str(order.get("frequency", ""))]
|
||||
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
row.add_child(label)
|
||||
var cancel := Button.new()
|
||||
cancel.text = "Cancel"
|
||||
cancel.pressed.connect(_emit_cancel_order.bind(str(order.get("code", ""))))
|
||||
row.add_child(cancel)
|
||||
|
||||
|
||||
func _render_order_results(chart: Array) -> void:
|
||||
var parts: Array[String] = []
|
||||
for raw_entry in chart:
|
||||
var entry: Dictionary = raw_entry
|
||||
if str(entry.get("category", "")) in ["lab", "imaging", "other_test", "treatment"]:
|
||||
parts.append("[b]%s[/b]\n%s" % [str(entry.get("title", "Result")), str(entry.get("text", ""))])
|
||||
orders_results.text = "\n\n".join(parts) if not parts.is_empty() else "No results are available."
|
||||
|
||||
|
||||
func _order_result_count(chart: Array) -> int:
|
||||
var count := 0
|
||||
for raw_entry in chart:
|
||||
if str(raw_entry.get("category", "")) in ["lab", "imaging", "other_test", "treatment"]:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
|
||||
func set_orders_pending(pending: bool, message: String = "") -> void:
|
||||
orders_confirm_button.disabled = pending or staged_order_codes.is_empty()
|
||||
orders_advance_button.disabled = pending
|
||||
orders_submit_final_button.disabled = pending
|
||||
orders_status.text = message
|
||||
|
||||
|
||||
func _emit_cancel_order(code: String) -> void:
|
||||
order_cancel_requested.emit(code)
|
||||
|
||||
|
||||
func _clear_dynamic_children(parent: Node) -> void:
|
||||
for child in parent.get_children():
|
||||
child.queue_free()
|
||||
|
||||
|
||||
func _build_medical_history_tabs() -> void:
|
||||
var content := medical_history_text.get_parent() as VBoxContainer
|
||||
medical_history_section_title = content.get_node("SectionTitle") as Label
|
||||
@@ -639,7 +942,7 @@ func _bring_computer_window_to_front(window: Control) -> void:
|
||||
|
||||
func _topmost_computer_window() -> Control:
|
||||
var top_window: Control
|
||||
for window in [vitals_window, medical_history_window]:
|
||||
for window in [vitals_window, medical_history_window, orders_window]:
|
||||
if window.visible and (top_window == null or window.z_index > top_window.z_index):
|
||||
top_window = window
|
||||
return top_window
|
||||
|
||||
@@ -5,7 +5,7 @@ const Style := preload("res://scripts/ui/ui_style.gd")
|
||||
const DOCTOR_SCENE := preload("res://scenes/ccs_cases_2/doctor_office.tscn")
|
||||
const DESIGN_SIZE := Vector2(1600.0, 900.0)
|
||||
const FOCUSED_INTERVIEW_CASE_ID := "ccs-gastro-duodenal-ulcer-office-001"
|
||||
const FOCUSED_INTERVIEW_REVISION := 3
|
||||
const FOCUSED_INTERVIEW_REVISION := 4
|
||||
|
||||
var main
|
||||
var stage_root: Control
|
||||
@@ -43,6 +43,8 @@ func _connect_service() -> void:
|
||||
CCSService.attempt_changed.connect(_on_attempt_changed)
|
||||
if not CCSService.request_failed.is_connected(_on_request_failed):
|
||||
CCSService.request_failed.connect(_on_request_failed)
|
||||
if not CCSService.orders_changed.is_connected(_on_orders_changed):
|
||||
CCSService.orders_changed.connect(_on_orders_changed)
|
||||
if not CCSService.attempt_abandoned.is_connected(_on_attempt_abandoned):
|
||||
CCSService.attempt_abandoned.connect(_on_attempt_abandoned)
|
||||
|
||||
@@ -97,10 +99,19 @@ func _on_attempt_changed() -> void:
|
||||
and current_view == "doctor_office":
|
||||
_refresh_exam_result(CCSService.attempt, completed_exam_code)
|
||||
return
|
||||
if completed_action in ["orders", "cancel_order", "advance", "enter_final_orders"] \
|
||||
and active_scene != null and current_view == "doctor_office":
|
||||
_refresh_case_workspace(CCSService.attempt)
|
||||
return
|
||||
_render_state()
|
||||
|
||||
|
||||
func _refresh_exam_result(attempt: Dictionary, exam_code: String) -> void:
|
||||
_refresh_case_workspace(attempt)
|
||||
active_scene.show_exam_result(attempt.get("chart", []), exam_code)
|
||||
|
||||
|
||||
func _refresh_case_workspace(attempt: Dictionary) -> void:
|
||||
active_scene.configure_presentation(
|
||||
attempt.get("graphicalPresentation", {}),
|
||||
str(attempt.get("simulatedStartUtc", "")),
|
||||
@@ -108,7 +119,7 @@ func _refresh_exam_result(attempt: Dictionary, exam_code: String) -> void:
|
||||
attempt.get("vitals", {}),
|
||||
str(attempt.get("medicalHistory", "")), attempt.get("chart", []))
|
||||
active_scene.configure_examinations(attempt.get("availableExams", []), attempt.get("chart", []))
|
||||
active_scene.show_exam_result(attempt.get("chart", []), exam_code)
|
||||
active_scene.configure_orders(attempt)
|
||||
|
||||
|
||||
func _render_state() -> void:
|
||||
@@ -128,7 +139,7 @@ func _render_state() -> void:
|
||||
|
||||
|
||||
func _render_attempt(attempt: Dictionary) -> void:
|
||||
if str(attempt.get("state", "")) != "active":
|
||||
if str(attempt.get("state", "")) not in ["active", "final_orders"]:
|
||||
_show_unsupported_attempt("This active case is not available in the graphical interview yet.")
|
||||
return
|
||||
var interview: Dictionary = attempt.get("interview", {})
|
||||
@@ -243,6 +254,11 @@ func _show_doctor_office(node: Dictionary, attempt: Dictionary = {}) -> void:
|
||||
active_scene.choice_selected.connect(_submit_dialogue_choice)
|
||||
active_scene.physical_exam_selected.connect(_submit_physical_exam)
|
||||
active_scene.physical_exam_finish_requested.connect(_finish_physical_examination)
|
||||
active_scene.order_search_requested.connect(_search_orders)
|
||||
active_scene.orders_submit_requested.connect(_submit_orders)
|
||||
active_scene.order_cancel_requested.connect(_cancel_order)
|
||||
active_scene.time_advance_requested.connect(_advance_time)
|
||||
active_scene.final_orders_submit_requested.connect(_submit_final_orders)
|
||||
active_scene.debrief_return_requested.connect(_return_to_cases)
|
||||
active_scene.debrief_repeat_requested.connect(_repeat_interview)
|
||||
selection_view.visible = false
|
||||
@@ -256,6 +272,7 @@ func _show_doctor_office(node: Dictionary, attempt: Dictionary = {}) -> void:
|
||||
str(attempt.get("medicalHistory", "")), attempt.get("chart", []))
|
||||
active_scene.configure_examinations(attempt.get("availableExams", []), attempt.get("chart", []))
|
||||
active_scene.configure_interview(node)
|
||||
active_scene.configure_orders(attempt)
|
||||
active_scene.set_choices_pending(not pending_action.is_empty())
|
||||
|
||||
|
||||
@@ -279,8 +296,52 @@ func _submit_physical_exam(exam_code: String) -> void:
|
||||
func _finish_physical_examination() -> void:
|
||||
if not pending_action.is_empty():
|
||||
return
|
||||
pending_action = "finishing_exam"
|
||||
pending_action = "enter_final_orders"
|
||||
active_scene.set_physical_exam_pending("finishing_case")
|
||||
CCSService.send_command("end_case")
|
||||
|
||||
|
||||
func _search_orders(query: String) -> void:
|
||||
CCSService.search_orders(query)
|
||||
|
||||
|
||||
func _on_orders_changed() -> void:
|
||||
if active_scene != null and active_scene.has_method("render_order_search"):
|
||||
active_scene.render_order_search(CCSService.orders)
|
||||
|
||||
|
||||
func _submit_orders(codes: Array) -> void:
|
||||
if not pending_action.is_empty() or codes.is_empty():
|
||||
return
|
||||
pending_action = "orders"
|
||||
active_scene.set_orders_pending(true, "Submitting orders...")
|
||||
var commands: Array = []
|
||||
for code in codes:
|
||||
commands.append({"type": "order", "code": str(code), "minutes": 0})
|
||||
CCSService.send_batch(commands)
|
||||
|
||||
|
||||
func _cancel_order(code: String) -> void:
|
||||
if not pending_action.is_empty() or code.is_empty():
|
||||
return
|
||||
pending_action = "cancel_order"
|
||||
active_scene.set_orders_pending(true, "Cancelling order...")
|
||||
CCSService.send_batch([{"type": "cancel_order", "code": code, "minutes": 0}])
|
||||
|
||||
|
||||
func _advance_time(minutes: int) -> void:
|
||||
if not pending_action.is_empty() or minutes <= 0:
|
||||
return
|
||||
pending_action = "advance"
|
||||
active_scene.set_orders_pending(true, "Obtaining results...")
|
||||
CCSService.send_command("advance", "", minutes)
|
||||
|
||||
|
||||
func _submit_final_orders() -> void:
|
||||
if not pending_action.is_empty():
|
||||
return
|
||||
pending_action = "submit_final_orders"
|
||||
active_scene.set_orders_pending(true, "Submitting final orders...")
|
||||
CCSService.send_command("exit_case")
|
||||
|
||||
|
||||
@@ -361,6 +422,8 @@ func _on_request_failed(message: String) -> void:
|
||||
active_scene.show_physical_exam_error(message)
|
||||
else:
|
||||
active_scene.set_choices_pending(false)
|
||||
if active_scene.has_method("set_orders_pending"):
|
||||
active_scene.set_orders_pending(false, message)
|
||||
else:
|
||||
status_label.text = message
|
||||
retry_button.visible = failed_action == "loading"
|
||||
|
||||
Reference in New Issue
Block a user