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 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 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 getVitalRecordByPhysicalExamNumberAsync( String physicalExamNumber) async { return rpc.vitalHealthExamBooking.getVitalRecordByPhysicalExamNumberAsync( GetVitalRecordByPhysicalExamNumberRequest( physicalExamNumber: physicalExamNumber, token: token, )); } @override Future endScan(String recordCode) async { final finishRecordAsync = await rpc.recordInfo.finishRecordAsync( FinishRecordRequest( recordCode: recordCode, token: Store.user.token, isVital: true, ), ); return finishRecordAsync; } }