123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:vitalapp/managers/interfaces/follow_up.dart';
- import 'package:vitalapp/rpc.dart';
- import 'package:vitalapp/store/store.dart';
- import 'package:fis_common/logger/logger.dart';
- class FollowUpManager implements IFollowUpManager {
- @override
- Future<String> createFollowUp(CreateFollowUpRequest examRequest) async {
- try {
- examRequest.token = Store.user.token;
- final examCode = await rpc.vitalFollowUp.createFollowUpAsync(
- examRequest,
- );
- return examCode;
- } catch (e) {
- logger.e("DoctorManager sync user info error.", e);
- return '';
- }
- }
- @override
- Future<bool?> updateFollowUp(UpdateFollowUpRequest followRequest) async {
- try {
- followRequest.token = Store.user.token;
- final result = await rpc.vitalFollowUp.updateFollowUpAsync(
- followRequest,
- );
- return result;
- } catch (e) {
- logger.e("FollowUpManager sync user info error.", e);
- return null;
- }
- }
- @override
- Future<List<FollowUpDTO>?> getFollowUpPage(
- FollowUpPageRequest followUpPageRequest) async {
- try {
- followUpPageRequest.token = Store.user.token;
- final result = await rpc.vitalFollowUp.getFollowUpPageAsync(
- followUpPageRequest,
- );
- return result.pageData;
- } catch (e) {
- logger.e("DoctorManager sync user info error.", e);
- return null;
- }
- }
- @override
- Future<List<FollowUpRecordDTO>?> getFollowUpRecordList(
- List<String> keys, String patientCode) async {
- try {
- var request = GetFollowUpRecordListRequest(
- keys: keys, patientCode: patientCode, token: Store.user.token);
- final result =
- await rpc.vitalFollowUp.getFollowUpRecordListAsync(request);
- return result;
- } catch (e) {
- return null;
- }
- }
- @override
- Future<List<FollowUpRecordDTO>?> getFollowUpRecordListByYearAsync(
- GetFollowUpRecordListByYearRequest
- followUpRecordListByYearRequest) async {
- try {
- followUpRecordListByYearRequest.token = Store.user.token;
- final result = await rpc.vitalFollowUp
- .getFollowUpRecordListByYearAsync(followUpRecordListByYearRequest);
- return result;
- } catch (e) {
- return null;
- }
- }
- }
|