更新
This commit is contained in:
@@ -46,6 +46,7 @@ from ..diagnosis_drawer import (
|
||||
DiagnosisSwitch,
|
||||
DiagnosisTabWidget,
|
||||
DiagnosisTextEdit,
|
||||
ExpandableDiagnosisTextEdit,
|
||||
LoadingOverlay,
|
||||
MessageStrip,
|
||||
NotesTimeline,
|
||||
@@ -300,7 +301,7 @@ _FORM_SECTIONS: tuple[tuple[str, tuple[tuple[tuple[str, str, int, str], ...], ..
|
||||
("渠道", "create_source", 12, "create_source"),
|
||||
),
|
||||
(("统计端就诊卡", "show_card", 12, "show_card"),),
|
||||
(("在用药物", "current_medications", 24, "textarea3"),),
|
||||
(("在用药物", "current_medications", 24, "expandable_textarea3"),),
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -331,7 +332,7 @@ _FORM_SECTIONS: tuple[tuple[str, tuple[tuple[tuple[str, str, int, str], ...], ..
|
||||
(("小便情况", "urine_condition", 24, "urine_condition_choices"),),
|
||||
(("大便情况", "stool_condition", 24, "stool_condition_choices"),),
|
||||
(("腰肾情况", "kidney_condition", 24, "kidney_condition_choices"),),
|
||||
(("其他补充", "symptoms", 24, "textarea3"),),
|
||||
(("其他补充", "symptoms", 24, "expandable_textarea3"),),
|
||||
),
|
||||
),
|
||||
("既往史", ((("既往史", "past_history", 24, "past_history_choices"),),)),
|
||||
@@ -1234,11 +1235,12 @@ class DiagnosisDialog(QDialog):
|
||||
occupied = 0
|
||||
for label, key, span, field_kind in row_fields:
|
||||
editor = self._ensure_editor(key, field_kind)
|
||||
display = (
|
||||
editor.wrap_with_unit()
|
||||
if isinstance(editor, DiagnosisNumberEdit)
|
||||
else editor
|
||||
)
|
||||
if isinstance(editor, DiagnosisNumberEdit):
|
||||
display = editor.wrap_with_unit()
|
||||
elif isinstance(editor, ExpandableDiagnosisTextEdit):
|
||||
display = editor.wrap_with_expander(label)
|
||||
else:
|
||||
display = editor
|
||||
container = self._field_container(label, display, span, editor=editor)
|
||||
row_layout.addWidget(container, span)
|
||||
fields.append(container)
|
||||
@@ -1371,9 +1373,13 @@ class DiagnosisDialog(QDialog):
|
||||
columns=4 if multiple else 5,
|
||||
)
|
||||
self._choice_fields[key] = editor
|
||||
elif field_kind.startswith("textarea"):
|
||||
elif field_kind.startswith(("textarea", "expandable_textarea")):
|
||||
rows = int(field_kind[-1])
|
||||
editor = DiagnosisTextEdit(rows)
|
||||
editor = (
|
||||
ExpandableDiagnosisTextEdit(rows)
|
||||
if field_kind.startswith("expandable_")
|
||||
else DiagnosisTextEdit(rows)
|
||||
)
|
||||
else:
|
||||
editor = DiagnosisLineEdit()
|
||||
editor.setObjectName(f"DiagnosisField_{key.removeprefix('__')}")
|
||||
|
||||
Reference in New Issue
Block a user