|
@@ -147,11 +147,16 @@ class PatientDetailController extends FControllerBase with HomeNavMixin {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Future<void> loadData() async {
|
|
|
- state.code = Store.user.currentSelectPatientInfo?.code ?? '';
|
|
|
- var dto = await getPatientPhoto(Store.user.currentSelectPatientInfo!.code!);
|
|
|
- dto ??= Store.user.currentSelectPatientInfo;
|
|
|
+ Future<void> loadData({String code = ''}) async {
|
|
|
+ PatientDTO? dto;
|
|
|
+ if (code.isNotEmpty) {
|
|
|
+ dto = await getPatientPhoto(code);
|
|
|
+ } else if (Store.user.currentSelectPatientInfo != null &&
|
|
|
+ Store.user.currentSelectPatientInfo!.code != null) {
|
|
|
+ dto ??= Store.user.currentSelectPatientInfo;
|
|
|
+ }
|
|
|
if (dto != null) {
|
|
|
+ state.code = dto.code ?? '';
|
|
|
dto.birthday = dto.birthday!.toLocal();
|
|
|
state.updateDto(dto);
|
|
|
}
|