Preserve dialogue after examinations
This commit is contained in:
@@ -93,9 +93,22 @@ func _on_attempt_changed() -> void:
|
|||||||
var completed_exam_code := pending_exam_code
|
var completed_exam_code := pending_exam_code
|
||||||
pending_action = ""
|
pending_action = ""
|
||||||
pending_exam_code = ""
|
pending_exam_code = ""
|
||||||
|
if completed_action == "physical_exam" and active_scene != null \
|
||||||
|
and current_view == "doctor_office":
|
||||||
|
_refresh_exam_result(CCSService.attempt, completed_exam_code)
|
||||||
|
return
|
||||||
_render_state()
|
_render_state()
|
||||||
if completed_action == "physical_exam" and active_scene != null:
|
|
||||||
active_scene.show_exam_result(CCSService.attempt.get("chart", []), completed_exam_code)
|
|
||||||
|
func _refresh_exam_result(attempt: Dictionary, exam_code: String) -> void:
|
||||||
|
active_scene.configure_presentation(
|
||||||
|
attempt.get("graphicalPresentation", {}),
|
||||||
|
str(attempt.get("simulatedStartUtc", "")),
|
||||||
|
int(attempt.get("simulatedMinute", 0)),
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
func _render_state() -> void:
|
func _render_state() -> void:
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ func _run() -> void:
|
|||||||
screen._on_attempt_changed()
|
screen._on_attempt_changed()
|
||||||
await process_frame
|
await process_frame
|
||||||
_assert(screen.current_view == "doctor_office", "attempt refreshes should preserve the interview phase")
|
_assert(screen.current_view == "doctor_office", "attempt refreshes should preserve the interview phase")
|
||||||
|
_assert(not screen.active_scene.is_patient_dialogue_visible(), "an examination result should not replay the current patient dialogue")
|
||||||
_assert(screen.active_scene.physical_exam_finding_text.text == "Mild epigastric tenderness.", "the returned chart finding should be displayed")
|
_assert(screen.active_scene.physical_exam_finding_text.text == "Mild epigastric tenderness.", "the returned chart finding should be displayed")
|
||||||
_assert(screen.active_scene.physical_exam_result_button.visible, "a completed exam should present a focused result card")
|
_assert(screen.active_scene.physical_exam_result_button.visible, "a completed exam should present a focused result card")
|
||||||
var result_dialogue_page: int = screen.active_scene.dialogue_page_index
|
var result_dialogue_page: int = screen.active_scene.dialogue_page_index
|
||||||
|
|||||||
Reference in New Issue
Block a user