Explorar o código

fix 18133: 【一体机】【健康档案】创建未建过档的体检记录后,在居民列表中显示此居民,平板离线后,不显示此居民,且健康档案左侧不显示个人信息详情

Melon hai 1 ano
pai
achega
99b221408b

+ 0 - 10
lib/pages/check/health_check_record/controllers/list_controller.dart

@@ -144,7 +144,6 @@ class ListController {
             batchNumber: rowData.batchNumber ?? '',
           ),
         );
-        _setCurrentSelectPatientInfo(rowData);
         _openExamDialog(rowData);
       },
       child: const Text(
@@ -154,15 +153,6 @@ class ListController {
     );
   }
 
-  void _setCurrentSelectPatientInfo(ResidentModel rowData) {
-    Store.user.currentSelectPatientInfo = PatientDTO(
-      cardNo: rowData.idNumber,
-      patientName: rowData.name,
-      code: rowData.idNumber,
-      patientAddress: rowData.homeAddress,
-    );
-  }
-
   void _openExamDialog(ResidentModel rowData) async {
     final FEventHandler<bool> onSubmitEvent = FEventHandler<bool>();
 

+ 0 - 16
lib/pages/home/controller.dart

@@ -385,22 +385,6 @@ class HomeController extends FControllerBase with HomeNavMixin {
       PromptBox.toast("扫码失败,请重试");
       Get.back();
     }
-
-    // RegisterPersonInfoDTO? registerPersonInfo =
-    //     await _patientManager.getRegisterPersonInfoByPhysicalExamNumberAsync(
-    //   physicalExamNumber: code,
-    // );
-    // PatientDTO? patientInfo = PatientDTO();
-    // if (registerPersonInfo != null &&
-    //     registerPersonInfo.physicalExamNumber != null) {
-    //   patientInfo.code = registerPersonInfo.code;
-    //   patientInfo.patientName = registerPersonInfo.name;
-    //   Store.user.currentSelectRegisterPersonInfo = registerPersonInfo;
-    //   Store.user.currentSelectPatientInfo = patientInfo;
-    // }
-    // Get.back();
-    // onScanSwitchPage(state.currentSelectMenu);
-    // print(state.currentSelectMenu);
   }
 
   void onScanSwitchPage(String routeName) {

+ 3 - 3
lib/pages/medical_checkup_station/registration/controller/form.dart

@@ -5,6 +5,7 @@ import 'package:uuid/uuid.dart';
 import 'package:vitalapp/architecture/storage/text_storage.dart';
 import 'package:vitalapp/architecture/utils/datetime.dart';
 import 'package:vitalapp/architecture/utils/prompt_box.dart';
+import 'package:vitalapp/managers/interfaces/patient.dart';
 import 'package:vitalapp/pages/home/controller.dart';
 import 'package:vitalapp/pages/medical_checkup_station/registration/controller.dart';
 import 'package:vitalapp/pages/medical_checkup_station/registration/state/list.dart';
@@ -61,7 +62,7 @@ class RegistrationFormController {
       return;
     }
     if (infoResult.isNewPatient) {
-      Store.user.currentSelectPatientInfo = patient;
+      Get.find<IPatientManager>().switchCurrentPatientByCode(patient!.cardNo!);
       Get.toNamed("/patient/info");
     } else {
       PromptBox.toast('新建成功');
@@ -101,8 +102,7 @@ class RegistrationFormController {
       return;
     }
     if (infoResult.isNewPatient) {
-      Store.user.currentSelectPatientInfo =
-          patient?.addToPatientDTO(PatientDTO());
+      Get.find<IPatientManager>().switchCurrentPatientByCode(patient!.cardNo!);
       Get.toNamed("/patient/info");
     } else {
       PromptBox.toast('新建成功');

+ 2 - 16
lib/pages/medical_checkup_station/registration/controller/list.dart

@@ -489,21 +489,6 @@ class RegistrationListController {
     );
   }
 
-  Future<void> _setCurrentSelectPatientInfo(ResidentModel rowData) async {
-    final _patientManager = Get.find<IPatientManager>();
-    final PatientDTO? dto = await _patientManager.getDetail(rowData.idNumber);
-    if (dto != null) {
-      Store.user.currentSelectPatientInfo = dto;
-    } else {
-      Store.user.currentSelectPatientInfo = PatientDTO(
-        cardNo: rowData.idNumber,
-        patientName: rowData.name,
-        code: rowData.idNumber,
-        patientAddress: rowData.homeAddress,
-      );
-    }
-  }
-
   void _examDialog(ResidentModel rowData, bool isIntegralDesk) async {
     final FEventHandler<bool> onSubmitEvent = FEventHandler<bool>();
 
@@ -593,7 +578,8 @@ class RegistrationListController {
                 batchNumber: rowData.batchNumber ?? '',
               ),
             );
-            _setCurrentSelectPatientInfo(rowData);
+            Get.find<IPatientManager>()
+                .switchCurrentPatientByCode(rowData.idNumber);
             _examDialog(rowData, isIntegralDesk);
           },
           "HealthCheck",

+ 2 - 5
lib/pages/medical_checkup_station/registration/widgets/table/index.dart

@@ -27,11 +27,8 @@ class RegistrationTable extends GetView<RegistrationController> {
         onRowSelected: (value, index, idxs) {},
         onRowTap: (index) async {
           controller.listController.currentResident = residentList[index];
-          final patientManager = Get.find<IPatientManager>();
-          PatientDTO? patientInfoDto =
-              await patientManager.getDetail(residentList[index].idNumber);
-          Store.user.currentSelectPatientInfo = patientInfoDto ??
-              new PatientDTO(patientName: residentList[index].name);
+          await Get.find<IPatientManager>()
+              .switchCurrentPatientByCode(residentList[index].idNumber);
           controller.update(['registration_table_detail']);
         },
         onAllRowsSelected: (value, idxs) => {},

+ 0 - 1
lib/pages/patient/info/controller.dart

@@ -197,7 +197,6 @@ class PatientInfoController extends FControllerBase {
         .getDetail(Store.user.currentSelectPatientInfo!.cardNo!);
     if (patientInfoDto != null) {
       // 更新最新信息
-      Store.user.currentSelectPatientInfo = patientInfoDto;
       await _patientManager.switchCurrentPatient(patientInfoDto);
     }