123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:vnoteapp/managers/interfaces/contract.dart';
- import 'package:vnoteapp/rpc.dart';
- import 'package:vnoteapp/store/store.dart';
- class ContractManager implements IContractManager {
- @override
- Future<String?> createContractRecordAsync(
- CreateContractRecordRequest request) async {
- try {
- request.token = Store.user.token;
- final result =
- await rpc.contractRecord.createContractRecordAsync(request);
- return result;
- } catch (e) {
- // logger.e("PatientManager create patient error.", e);
- return null;
- }
- }
- @override
- Future<PageCollection<ContractRecordDTO>?>
- getContractRecordPageByPatientCodeAsync(String patientCode) async {
- try {
- final result = await rpc.contractRecord
- .getContractRecordPageByPatientCodeAsync(
- GetContractRecordPageByPatientCodeRequest(
- patientCode: patientCode,
- token: Store.user.token,
- pageSize: 20,
- pageIndex: 1));
- return result;
- } catch (e) {
- return null;
- }
- }
- @override
- Future<PageCollection<ContractRecordDTO>?>
- getContractRecordPageAsync() async {
- try {
- final result = await rpc.contractRecord.getContractRecordPageAsync(
- ContractRecordPageRequest(
- token: Store.user.token, pageSize: 20, pageIndex: 1));
- return result;
- } catch (e) {
- return null;
- }
- }
- @override
- Future<ContractRecordDTO?> getContractRecordDetailAsync(
- String patientCode) async {
- try {
- var request = GetContractRecordRequest(
- code: patientCode,
- token: Store.user.token,
- );
- final result =
- await rpc.contractRecord.getContractRecordDetailAsync(request);
- return result;
- } catch (e) {
- return null;
- }
- }
- }
|