recordInfo.dart 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import 'dart:core';
  2. import 'package:fis_jsonrpc/client_base.dart';
  3. import 'package:fis_common/json_convert.dart';
  4. import 'recordInfo.m.dart';
  5. import 'authentication.m.dart';
  6. import 'patient.m.dart';
  7. class RecordInfoService extends JsonRpcClientBase {
  8. RecordInfoService(
  9. String host, {
  10. String serviceName = "IRecordInfoService",
  11. Map<String, String>? headers,
  12. int? timeout,
  13. }) : super(
  14. host,
  15. serviceName,
  16. headers: headers,
  17. timeout: timeout,
  18. ) {
  19. /// 注册响应实体反序列化处理器
  20. FJsonConvert.setDecoder((map) => PageResult<GetRecordsPageResult>.fromJson(map));
  21. FJsonConvert.setDecoder((map) => GetRecordsPageResult.fromJson(map));
  22. FJsonConvert.setDecoder((map) => QueryRecordResult.fromJson(map));
  23. }
  24. Future<bool> createRecordInfoAsync(CreateRecordRequest request) async {
  25. var rpcRst = await call("CreateRecordInfoAsync", request);
  26. return rpcRst;
  27. }
  28. Future<PageResult<GetRecordsPageResult>> getRecordInfoPagesAsync(GetRecordsPageRequest request) async {
  29. var rpcRst = await call("GetRecordInfoPagesAsync", request);
  30. var result = PageResult<GetRecordsPageResult>.fromJson(rpcRst as Map<String, dynamic>);
  31. return result;
  32. }
  33. Future<QueryRecordResult> queryRecordInfoAsync(QueryRecordRequest request) async {
  34. var rpcRst = await call("QueryRecordInfoAsync", request);
  35. var result = QueryRecordResult.fromJson(rpcRst as Map<String, dynamic>);
  36. return result;
  37. }
  38. Future<int> getUnReadExamNum(TokenRequest request) async {
  39. var rpcRst = await call("GetUnReadExamNum", request);
  40. return rpcRst;
  41. }
  42. Future<bool> pushRecordCodesToDevice(PushRecordCodesToDeviceRequest request) async {
  43. var rpcRst = await call("PushRecordCodesToDevice", request);
  44. return rpcRst;
  45. }
  46. Future<bool> pushFinshExamNotificationToClientAsync(PushFinishExamNotifyToClientRequest request) async {
  47. var rpcRst = await call("PushFinshExamNotificationToClientAsync", request);
  48. return rpcRst;
  49. }
  50. Future<bool> deviceFinishExamAsync(DeviceFinishExamRequest request) async {
  51. var rpcRst = await call("DeviceFinishExamAsync", request);
  52. return rpcRst;
  53. }
  54. }