Clarify and filter graphical orders

This commit is contained in:
hz
2026-08-14 17:02:35 -05:00
parent 325d27eec5
commit 375b3ea62f
3 changed files with 55 additions and 2 deletions
+13 -1
View File
@@ -99,7 +99,15 @@ func _run() -> void:
_assert(screen.active_scene.vitals_launcher.icon.get_width() >= 58 and screen.active_scene.medical_history_launcher.icon.get_width() >= 58, "desktop shortcuts should use high-resolution vector imports")
screen.active_scene.orders_launcher.pressed.emit()
_assert(screen.active_scene.orders_window.visible and screen.active_scene.orders_tabs.get_tab_count() == 3, "Orders should open a three-tab clinical workspace")
screen.active_scene.render_order_search([{"code": "cbc", "canonicalName": "Complete blood count", "category": "laboratory"}])
screen.active_scene._queue_live_order_search("bl")
_assert(not screen.active_scene.order_search_timer.is_stopped(), "order typing should schedule a debounced live search")
screen.active_scene.order_search_timer.stop()
screen.active_scene.current_order_location = "office"
screen.active_scene.render_order_search([
{"code": "cbc", "canonicalName": "Complete blood count", "category": "laboratory", "availableLocations": []},
{"code": "venous_blood_gas", "canonicalName": "Venous blood gas", "category": "laboratory", "availableLocations": ["emergency_department", "icu"]}
])
_assert(screen.active_scene.orders_search_results.get_child_count() == 1, "order search should hide catalog entries unavailable at the current location")
(screen.active_scene.orders_search_results.get_child(0) as Button).pressed.emit()
_assert(screen.active_scene.staged_order_codes == ["cbc"] and not screen.active_scene.orders_confirm_button.disabled, "catalog results should stage for confirmation")
screen.active_scene.configure_orders({
@@ -109,6 +117,10 @@ func _run() -> void:
})
_assert(screen.active_scene.staged_order_codes.is_empty(), "confirmed active orders should leave the staged list")
_assert(screen.active_scene.orders_results.text.contains("Hemoglobin 10.4"), "returned results should render in the Orders results tab")
screen.active_scene.show_order_action_complete("orders")
_assert(screen.active_scene.orders_tabs.current_tab == 1 and screen.active_scene.orders_status.text.begins_with("Orders confirmed"), "successful submission should explain completion and open Active Orders")
screen.active_scene.show_order_action_complete("advance")
_assert(screen.active_scene.orders_tabs.current_tab == 2, "obtaining results should open the Results tab")
screen.active_scene.close_orders()
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")