Integrate examinations into CCS interview

This commit is contained in:
hz
2026-08-11 22:27:37 -05:00
parent 6108011f74
commit 9a54bfc6d6
4 changed files with 204 additions and 57 deletions
+9 -35
View File
@@ -89,9 +89,13 @@ func _on_cases_changed() -> void:
func _on_attempt_changed() -> void:
active_loaded = true
var completed_action := pending_action
var completed_exam_code := pending_exam_code
pending_action = ""
pending_exam_code = ""
_render_state()
if completed_action == "physical_exam" and active_scene != null:
active_scene.show_exam_result(CCSService.attempt.get("chart", []), completed_exam_code)
func _render_state() -> void:
@@ -129,9 +133,6 @@ func _render_attempt(attempt: Dictionary) -> void:
and bool(attempt.get("openingCompleted", false)) and not bool(node.get("isTerminal", false)):
_show_unsupported_attempt("This case has progressed beyond the graphical interview.")
return
if current_view == "physical_examination" and bool(node.get("isTerminal", false)):
_show_physical_examination(attempt)
return
_show_doctor_office(node, attempt)
@@ -227,7 +228,6 @@ func _show_doctor_office(node: Dictionary, attempt: Dictionary = {}) -> void:
if active_scene == null:
_set_active_scene(DOCTOR_SCENE.instantiate(), "doctor_office")
active_scene.choice_selected.connect(_submit_dialogue_choice)
active_scene.interview_continue_requested.connect(_begin_physical_examination)
active_scene.physical_exam_selected.connect(_submit_physical_exam)
active_scene.physical_exam_finish_requested.connect(_finish_physical_examination)
active_scene.debrief_return_requested.connect(_return_to_cases)
@@ -240,7 +240,8 @@ func _show_doctor_office(node: Dictionary, attempt: Dictionary = {}) -> void:
str(attempt.get("simulatedStartUtc", "")),
int(attempt.get("simulatedMinute", 0)),
attempt.get("vitals", {}),
str(attempt.get("medicalHistory", "")))
str(attempt.get("medicalHistory", "")), attempt.get("chart", []))
active_scene.configure_examinations(attempt.get("availableExams", []), attempt.get("chart", []))
active_scene.configure_interview(node)
active_scene.set_choices_pending(not pending_action.is_empty())
@@ -253,33 +254,6 @@ func _submit_dialogue_choice(choice_id: String) -> void:
CCSService.send_dialogue_choice(choice_id)
func _begin_physical_examination() -> void:
if not pending_action.is_empty():
return
_show_physical_examination(CCSService.attempt)
func _show_physical_examination(attempt: Dictionary) -> void:
if active_scene == null:
_set_active_scene(DOCTOR_SCENE.instantiate(), "physical_examination")
active_scene.physical_exam_selected.connect(_submit_physical_exam)
active_scene.physical_exam_finish_requested.connect(_finish_physical_examination)
active_scene.debrief_return_requested.connect(_return_to_cases)
active_scene.debrief_repeat_requested.connect(_repeat_interview)
selection_view.visible = false
stage_root.visible = true
active_scene.configure_experience_mode("graphical_interview")
active_scene.configure_presentation(
attempt.get("graphicalPresentation", {}),
str(attempt.get("simulatedStartUtc", "")),
int(attempt.get("simulatedMinute", 0)),
attempt.get("vitals", {}),
str(attempt.get("medicalHistory", "")))
active_scene.show_physical_exam(
attempt.get("availableExams", []), attempt.get("chart", []), pending_exam_code)
current_view = "physical_examination"
func _submit_physical_exam(exam_code: String) -> void:
if not pending_action.is_empty() or exam_code.is_empty():
return
@@ -309,7 +283,7 @@ func _render_debrief(attempt: Dictionary) -> void:
str(attempt.get("simulatedStartUtc", "")),
int(attempt.get("simulatedMinute", 0)),
attempt.get("vitals", {}),
str(attempt.get("medicalHistory", "")))
str(attempt.get("medicalHistory", "")), attempt.get("chart", []))
active_scene.show_debrief(attempt.get("interviewDebrief", {}), attempt.get("score", {}))
current_view = "interview_debrief"
@@ -369,7 +343,7 @@ func _on_request_failed(message: String) -> void:
retry_button.visible = true
return
if active_scene != null:
if current_view == "physical_examination":
if failed_action == "physical_exam":
pending_exam_code = ""
active_scene.show_physical_exam_error(message)
else:
@@ -398,7 +372,7 @@ func _clear_active_scene() -> void:
active_scene.get_parent().remove_child(active_scene)
active_scene.queue_free()
active_scene = null
if current_view in ["doctor_office", "physical_examination"]:
if current_view == "doctor_office":
current_view = ""