Browse Source

Merge branch 'master' of http://git.ius.plus/Project-Vital/VitalApp

Melon 1 year ago
parent
commit
2f3bd39911

BIN
android/app/libs/device_sdk.aar


+ 2 - 1
lib/pages/medical/widgets/twelve_ecg.dart

@@ -336,7 +336,7 @@ class _HeartRateState extends State<TwelveHeartRate> {
       isConnectFail = true;
     }
     connectStatus = WorkerStatus.connectionFailed;
-
+    twelveEcgStatus = TwelveEcgStatus.noSampling;
     setState(() {});
   }
 
@@ -376,6 +376,7 @@ class _HeartRateState extends State<TwelveHeartRate> {
     // await tryReconnect();
     errorCount = 0;
     connectStatus = WorkerStatus.disconnected;
+    twelveEcgStatus = TwelveEcgStatus.noSampling;
     setState(() {});
   }
 

+ 9 - 4
lib/pages/patient/detail/controller.dart

@@ -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);
     }

+ 1 - 1
lib/pages/patient/list/controller.dart

@@ -40,7 +40,7 @@ class PatientListController extends FControllerBase {
     //   Get.lazyPut(() => MedicalController());
     // }
     // final medicalController = Get.find<MedicalController>();
-    await _patientDetailController.loadData();
+    await _patientDetailController.loadData(code: code);
     _homeController.updateMenus();
     _homeController.switchNavByName("/patient/detail");
     // await medicalController.initData();