Schedule graphical CCS procedures

This commit is contained in:
hz
2026-08-14 17:54:03 -05:00
parent 375b3ea62f
commit 25c2188264
7 changed files with 204 additions and 26 deletions
+15 -2
View File
@@ -107,16 +107,28 @@ func _run() -> void:
{"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")
_assert(screen.active_scene.orders_search_results.get_child_count() == 2, "order search should keep unavailable catalog entries visible")
_assert(not (screen.active_scene.orders_search_results.get_child(0) as Button).disabled, "case-authored orders should remain selectable across performance locations")
_assert((screen.active_scene.orders_search_results.get_child(1) as Button).disabled, "orders not authored for this case should explain their unavailability")
(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({
"state": "active", "activeOrderCodes": ["cbc"],
"activeOrders": [{"code": "cbc", "name": "Complete blood count", "route": "Blood", "frequency": "Once"}],
"orderOptions": [{"code": "cbc", "performanceLocation": "outpatient_laboratory", "turnaroundMinutes": 20, "requiresPatientVisit": true}],
"activeOrders": [{"code": "cbc", "name": "Complete blood count", "status": "completed", "performanceLocation": "outpatient_laboratory"}],
"chart": [{"category": "lab", "code": "cbc", "title": "Complete blood count", "text": "Hemoglobin 10.4 g/dL."}]
})
_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.configure_orders({
"state": "active", "activeOrderCodes": ["cbc"], "orderOptions": [], "activeOrders": [],
"chart": [
{"category": "progress", "code": "cbc_completed", "simulatedMinute": 20, "text": "The patient completed Complete blood count at Outpatient Laboratory and returned."},
{"category": "lab", "code": "cbc", "title": "Complete blood count", "text": "Hemoglobin 10.4 g/dL."}
]
})
_assert(screen.active_scene.patient_update_panel.visible and screen.active_scene.patient_update_text.text.contains("returned"), "completed off-site work should produce an in-scene patient update")
screen.active_scene.patient_update_panel.visible = false
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")
@@ -351,6 +363,7 @@ func _sample_attempt(completed: bool) -> Dictionary:
"openingCompleted": completed,
"experienceMode": "graphical_interview",
"availableExams": _sample_exams(), "chart": [],
"orderOptions": [{"code": "cbc", "performanceLocation": "outpatient_laboratory", "turnaroundMinutes": 20, "requiresPatientVisit": true}],
"interview": {"currentNodeId": node.id, "currentNode": node, "visitedChoiceIds": [], "completed": completed}
}