import 'dart:core'; import 'package:fis_jsonrpc/client_base.dart'; import 'package:fis_common/json_convert.dart'; import 'patient.m.dart'; import 'liveConsultation.m.dart'; class PatientService extends JsonRpcClientBase { PatientService( String host, { String serviceName = "IPatientService", Map? headers, int? timeout, }) : super( host, serviceName, headers: headers, timeout: timeout, ) { /// 注册响应实体反序列化处理器 FJsonConvert.setDecoder((map) => PageResult.fromJson(map)); FJsonConvert.setDecoder((map) => ClientPatientInfoBaseDTO.fromJson(map)); FJsonConvert.setDecoder((map) => ClientPatientInfoDTO.fromJson(map)); } Future createPatientAsync(CreatePatientRequest request) async { var rpcRst = await call("CreatePatientAsync", request); return rpcRst; } Future createPatientByUnregisteredAsync(CreatePatientByUnregisteredRequest request) async { var rpcRst = await call("CreatePatientByUnregisteredAsync", request); return rpcRst; } Future createUnregisteredPatientAsync(CreatePatientByUnregisteredRequest request) async { var rpcRst = await call("CreateUnregisteredPatientAsync", request); return rpcRst; } Future updatePatientAsync(UpdatePatientRequest request) async { var rpcRst = await call("UpdatePatientAsync", request); return rpcRst; } Future createPatientsAsync(CreatePatientsRequest request) async { var rpcRst = await call("CreatePatientsAsync", request); return rpcRst; } Future> findPatientsAsync(FindPatientsPageRequest request) async { var rpcRst = await call("FindPatientsAsync", request); var result = PageResult.fromJson(rpcRst as Map); return result; } Future findPatientByCodeAsync(FindPatientByCodeRequest request) async { var rpcRst = await call("FindPatientByCodeAsync", request); var result = ClientPatientInfoDTO.fromJson(rpcRst as Map); return result; } Future> findValidPatientsByNameAsync(FindValidPatientsByNameRequest request) async { var rpcRst = await call("FindValidPatientsByNameAsync", request); var result = (rpcRst as List).map((e)=>ClientPatientInfoBaseDTO.fromJson(e as Map)).toList(); return result; } Future setValidPatientAsync(SetValidPatientRequest request) async { var rpcRst = await call("SetValidPatientAsync", request); return rpcRst; } Future removePatientsAsync(RemovePatientsRequest request) async { var rpcRst = await call("RemovePatientsAsync", request); return rpcRst; } }