123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import 'package:fis_common/logger/logger.dart';
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:vitalapp/managers/interfaces/base_manager.dart';
- import 'package:vitalapp/managers/interfaces/scanning_image.dart';
- import 'package:vitalapp/rpc.dart';
- import 'package:vitalapp/store/store.dart';
- class ScanningImage extends BaseManager implements IScanningImage {
- ///需区分杏聆荟和健康平台
- @override
- Future<bool> startScan(String recordCode) async {
- bool result = false;
- try {
- result = await rpc.recordInfo
- .startCollectingImgAsync(StartCollectingImgRequest(
- recordCode: recordCode,
- token: Store.user.token,
- isVital: true,
- ));
- } catch (e) {
- logger.e("ScanningImage startScan ex:", e);
- }
- return result;
- }
- ///检查采图是否空闲
- @override
- Future<bool> checkCollectingImgAsync() async {
- bool result = false;
- try {
- result = await rpc.recordInfo
- .checkCollectingImgAsync(CheckCollectingImgRequest(
- token: Store.user.token,
- isVital: true,
- ));
- } catch (e) {
- logger.e("ScanningImage checkCollectingImgAsync ex:", e);
- }
- return result;
- }
- @override
- Future<RecordInfoDTO> getVitalRecordByPhysicalExamNumberAsync(
- String physicalExamNumber) async {
- return rpc.vitalHealthExamBooking.getVitalRecordByPhysicalExamNumberAsync(
- GetVitalRecordByPhysicalExamNumberRequest(
- physicalExamNumber: physicalExamNumber,
- token: token,
- ));
- }
- @override
- Future<bool> endScan(String recordCode) async {
- final finishRecordAsync = await rpc.recordInfo.finishRecordAsync(
- FinishRecordRequest(
- recordCode: recordCode,
- token: Store.user.token,
- isVital: true,
- ),
- );
- return finishRecordAsync;
- }
- }
|