data_sync.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:vitalapp/database/entities/defines.dart';
  2. import 'package:vitalapp/database/entities/patient.dart';
  3. import 'package:vitalapp/managers/interfaces/base.dart';
  4. import 'models/common.dart';
  5. import 'models/data_sync.dart';
  6. /// 数据同步Mananger
  7. abstract class IDataSyncManager implements IManager {
  8. /// 获取病人分页列表
  9. ///
  10. /// [pageIndex] 当前页,从 `1` 开始
  11. ///
  12. /// [pageSize] 页码,默认 `50`
  13. ///
  14. /// [syncStates] 同步状态,为空时查询全部状态
  15. ///
  16. /// [isReturnCountOnly] 是否只返回数量
  17. Future<PagedDataCollection<PatientEntity>> getPatientPagedList(
  18. int pageIndex, {
  19. int pageSize = 50,
  20. List<OfflineDataSyncState>? syncStates,
  21. bool isReturnCountOnly = false,
  22. });
  23. /// 获取所有待上传居民列表
  24. Future<List<PatientEntity>> getPatientWaitUploadAllList();
  25. /// 同步病人所有模块数据
  26. Future<bool> syncPatientAllData(String patientCode);
  27. /// 校验同步是否完成
  28. bool checkPatientSyncCompleted(PatientEntity entity);
  29. /// 同步病人
  30. Future<bool> syncPatient(PatientEntity entity);
  31. /// 同步居民的健康检测数据
  32. Future<int> syncPatientDiagnosis(String patientCode);
  33. /// 同步居民的随访数据
  34. Future<int> syncPatientFollowUp(String patientCode);
  35. /// 同步居民的健康体检
  36. Future<int> syncPatientExam(String patientCode);
  37. /// 同步居民的中医体质
  38. Future<int> syncPatientTCMConsitution(String patientCode);
  39. }