|
@@ -45,33 +45,34 @@ class PatientRepository
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
- Future<bool> increaseFollowUpCount(String code) =>
|
|
|
- _updateCountByCategory(code, _FunctionCategory.followUp, 1);
|
|
|
+ Future<bool> increaseFollowUpCount(String code, String userCode) =>
|
|
|
+ _updateCountByCategory(code, userCode, _FunctionCategory.followUp, 1);
|
|
|
@override
|
|
|
- Future<bool> increaseExamCount(String code) =>
|
|
|
- _updateCountByCategory(code, _FunctionCategory.exam, 1);
|
|
|
+ Future<bool> increaseExamCount(String code, String userCode) =>
|
|
|
+ _updateCountByCategory(code, userCode, _FunctionCategory.exam, 1);
|
|
|
@override
|
|
|
- Future<bool> increaseDiagnoissCount(String code) =>
|
|
|
- _updateCountByCategory(code, _FunctionCategory.diagnosis, 1);
|
|
|
+ Future<bool> increaseDiagnoissCount(String code, String userCode) =>
|
|
|
+ _updateCountByCategory(code, userCode, _FunctionCategory.diagnosis, 1);
|
|
|
@override
|
|
|
- Future<bool> decreaseFollowUpCount(String code) =>
|
|
|
- _updateCountByCategory(code, _FunctionCategory.followUp, -1);
|
|
|
+ Future<bool> decreaseFollowUpCount(String code, String userCode) =>
|
|
|
+ _updateCountByCategory(code, userCode, _FunctionCategory.followUp, -1);
|
|
|
@override
|
|
|
- Future<bool> decreaseExamCount(String code) =>
|
|
|
- _updateCountByCategory(code, _FunctionCategory.exam, -1);
|
|
|
+ Future<bool> decreaseExamCount(String code, String userCode) =>
|
|
|
+ _updateCountByCategory(code, userCode, _FunctionCategory.exam, -1);
|
|
|
@override
|
|
|
- Future<bool> decreaseDiagnoissCount(String code) =>
|
|
|
- _updateCountByCategory(code, _FunctionCategory.diagnosis, -1);
|
|
|
+ Future<bool> decreaseDiagnoissCount(String code, String userCode) =>
|
|
|
+ _updateCountByCategory(code, userCode, _FunctionCategory.diagnosis, -1);
|
|
|
|
|
|
/// 根据分类更新离线数量
|
|
|
///
|
|
|
/// [num] 1 则加1,-1 则减1
|
|
|
Future<bool> _updateCountByCategory(
|
|
|
String code,
|
|
|
+ String userCode,
|
|
|
_FunctionCategory category,
|
|
|
int num,
|
|
|
) async {
|
|
|
- final entity = await singleByCode(code, "userCode");
|
|
|
+ final entity = await singleByCode(code, userCode);
|
|
|
if (entity == null) {
|
|
|
return false;
|
|
|
}
|