This commit is contained in:
Your Name
2026-08-28 18:24:37 +08:00
parent 43ad07208f
commit ed48f8be31
383 changed files with 8673 additions and 2222 deletions
+29
View File
@@ -1018,6 +1018,35 @@ def test_prescription_detail_can_open_immutable_case_record_tab(
application.processEvents()
def test_case_record_translates_snapshot_dictionary_codes_to_chinese() -> None:
# 处方快照存的是开方当时的原始 code,没有后端补的 *_text。
prescription = {
"id": 21,
"diagnosis_id": 9,
"case_record": {
"diagnosis": {
"appetite": "dry,bitter",
"water_intake": "one_bottle",
"weight_change": "lose_10_jin",
"fatty_liver_degree": "mild",
"past_history": "hypertension,diabetes",
"sleep_condition": "many_dreams",
}
},
}
case_html = dialog_module.render_case_record_html(prescription)
assert "干、苦" in case_html
assert "1瓶矿泉水" in case_html
assert "瘦10斤" in case_html
assert "轻度" in case_html
assert "高血压、糖尿病" in case_html
assert "多梦" in case_html
for code in ("lose_10_jin", "one_bottle", "many_dreams"):
assert code not in case_html
def test_case_record_tab_exports_case_record_as_a3_pdf(
application: QApplication,
tmp_path: Any,