|
@@ -12,13 +12,14 @@ class FollowUpServiceMock extends VitalFollowUpService {
|
|
|
@override
|
|
|
Future<String> createFollowUpAsync(CreateFollowUpRequest request) async {
|
|
|
final entity = FollowUpEntity();
|
|
|
+ final patientCode = Store.user.currentSelectPatientInfo!.code!;
|
|
|
|
|
|
final uuid = const Uuid().v4().replaceAll('-', '');
|
|
|
entity.code = "mock_$uuid";
|
|
|
entity.isValid = true;
|
|
|
entity.syncType = OfflineDataSyncType.create;
|
|
|
entity.userCode = Store.user.userCode!;
|
|
|
- entity.patientCode = Store.user.currentSelectPatientInfo!.code!;
|
|
|
+ entity.patientCode = patientCode;
|
|
|
entity.contractDoctor = Store.user.principalName;
|
|
|
entity.typeKey = request.key!;
|
|
|
entity.templateCode = request.templateCode!;
|
|
@@ -36,7 +37,7 @@ class FollowUpServiceMock extends VitalFollowUpService {
|
|
|
final success = id > 0;
|
|
|
if (success) {
|
|
|
|
|
|
- await db.repositories.patient.increaseFollowUpCount(entity.code);
|
|
|
+ await db.repositories.patient.increaseFollowUpCount(patientCode);
|
|
|
}
|
|
|
final result = success ? entity.code : "";
|
|
|
return result;
|
|
@@ -51,9 +52,10 @@ class FollowUpServiceMock extends VitalFollowUpService {
|
|
|
entity.isValid = true;
|
|
|
entity.syncType = OfflineDataSyncType.update;
|
|
|
}
|
|
|
+ final patientCode = Store.user.currentSelectPatientInfo!.code!;
|
|
|
entity.code = request.code!;
|
|
|
entity.userCode = Store.user.userCode!;
|
|
|
- entity.patientCode = Store.user.currentSelectPatientInfo!.code!;
|
|
|
+ entity.patientCode = patientCode;
|
|
|
entity.contractDoctor = Store.user.principalName;
|
|
|
entity.typeKey = request.key!;
|
|
|
entity.mode = request.followUpMode!;
|
|
@@ -67,7 +69,7 @@ class FollowUpServiceMock extends VitalFollowUpService {
|
|
|
result = await db.repositories.followUp.insert(entity);
|
|
|
if (result > 0) {
|
|
|
|
|
|
- await db.repositories.patient.increaseFollowUpCount(entity.code);
|
|
|
+ await db.repositories.patient.increaseFollowUpCount(patientCode);
|
|
|
}
|
|
|
} else {
|
|
|
result = await db.repositories.followUp.update(entity);
|