|
@@ -29,18 +29,31 @@ class DiagnosisRepository
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
- Future<int> getListCountByPatientCode(String patientCode,
|
|
|
- {OfflineDataSyncState? syncState}) async {
|
|
|
+ Future<int> getNotUploadedCountByPatientCode(String patientCode) async {
|
|
|
final query = queryable.where((x) {
|
|
|
final List<IDbColumnCondition> arr = [];
|
|
|
arr.add(x.isValid.equals(true));
|
|
|
arr.add(x.patientCode.equals(patientCode));
|
|
|
- if (syncState != null) {
|
|
|
- arr.add(x.syncState.equals(syncState));
|
|
|
- }
|
|
|
+ arr.add(x.syncState.notEquals(OfflineDataSyncState.success));
|
|
|
return arr;
|
|
|
});
|
|
|
final listCount = await query.count();
|
|
|
return listCount;
|
|
|
}
|
|
|
+
|
|
|
+ @override
|
|
|
+ Future<List<DiagnosisEntity>> getNotUploadedListByPatientCode(
|
|
|
+ String patientCode) async {
|
|
|
+ final query = queryable.where((x) {
|
|
|
+ final List<IDbColumnCondition> arr = [];
|
|
|
+ arr.add(x.isValid.equals(true));
|
|
|
+ arr.add(x.patientCode.equals(patientCode));
|
|
|
+
|
|
|
+ arr.add(x.syncState.notEquals(OfflineDataSyncState.success));
|
|
|
+
|
|
|
+ return arr;
|
|
|
+ });
|
|
|
+ final list = await query.toList();
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|