1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- 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<String, String>? headers,
- int? timeout,
- }) : super(
- host,
- serviceName,
- headers: headers,
- timeout: timeout,
- ) {
- /// 注册响应实体反序列化处理器
- FJsonConvert.setDecoder((map) => PageResult<ClientPatientInfoBaseDTO>.fromJson(map));
- FJsonConvert.setDecoder((map) => ClientPatientInfoBaseDTO.fromJson(map));
- FJsonConvert.setDecoder((map) => ClientPatientInfoDTO.fromJson(map));
- }
- Future<String> createPatientAsync(CreatePatientRequest request) async {
- var rpcRst = await call("CreatePatientAsync", request);
- return rpcRst;
- }
- Future<bool> createPatientByUnregisteredAsync(CreatePatientByUnregisteredRequest request) async {
- var rpcRst = await call("CreatePatientByUnregisteredAsync", request);
- return rpcRst;
- }
- Future<String> createUnregisteredPatientAsync(CreatePatientByUnregisteredRequest request) async {
- var rpcRst = await call("CreateUnregisteredPatientAsync", request);
- return rpcRst;
- }
- Future<bool> updatePatientAsync(UpdatePatientRequest request) async {
- var rpcRst = await call("UpdatePatientAsync", request);
- return rpcRst;
- }
- Future<bool> createPatientsAsync(CreatePatientsRequest request) async {
- var rpcRst = await call("CreatePatientsAsync", request);
- return rpcRst;
- }
- Future<PageResult<ClientPatientInfoBaseDTO>> findPatientsAsync(FindPatientsPageRequest request) async {
- var rpcRst = await call("FindPatientsAsync", request);
- var result = PageResult<ClientPatientInfoBaseDTO>.fromJson(rpcRst as Map<String, dynamic>);
- return result;
- }
- Future<ClientPatientInfoDTO> findPatientByCodeAsync(FindPatientByCodeRequest request) async {
- var rpcRst = await call("FindPatientByCodeAsync", request);
- var result = ClientPatientInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
- return result;
- }
- Future<List<ClientPatientInfoBaseDTO>> findValidPatientsByNameAsync(FindValidPatientsByNameRequest request) async {
- var rpcRst = await call("FindValidPatientsByNameAsync", request);
- var result = (rpcRst as List).map((e)=>ClientPatientInfoBaseDTO.fromJson(e as Map<String, dynamic>)).toList();
- return result;
- }
- Future<bool> setValidPatientAsync(SetValidPatientRequest request) async {
- var rpcRst = await call("SetValidPatientAsync", request);
- return rpcRst;
- }
- Future<bool> removePatientsAsync(RemovePatientsRequest request) async {
- var rpcRst = await call("RemovePatientsAsync", request);
- return rpcRst;
- }
- }
|