import 'liveConsultation.m.dart'; import 'notification.m.dart'; import 'vitalContractRecord.m.dart'; import 'device.m.dart'; import 'package:fis_jsonrpc/utils.dart'; enum FollowUpModeEnum { Outpatient, Visit, Phone, } class CreateFollowUpRequest extends TokenRequest{ String? code; String? key; String? patientCode; String? contractedDoctor; String? followUpData; String? templateCode; DateTime? followUpTime; DateTime? nextFollowUpTime; FollowUpModeEnum followUpMode; List? followUpPhotos; CreateFollowUpRequest({ this.code, this.key, this.patientCode, this.contractedDoctor, this.followUpData, this.templateCode, this.followUpTime, this.nextFollowUpTime, this.followUpMode = FollowUpModeEnum.Outpatient, this.followUpPhotos, String? token, }) : super( token: token, ); factory CreateFollowUpRequest.fromJson(Map map) { return CreateFollowUpRequest( code: map['Code'], key: map['Key'], patientCode: map['PatientCode'], contractedDoctor: map['ContractedDoctor'], followUpData: map['FollowUpData'], templateCode: map['TemplateCode'], followUpTime: map['FollowUpTime'] != null ? DateTime.parse(map['FollowUpTime']) : null, nextFollowUpTime: map['NextFollowUpTime'] != null ? DateTime.parse(map['NextFollowUpTime']) : null, followUpMode: FollowUpModeEnum.values.firstWhere((e) => e.index == map['FollowUpMode']), followUpPhotos: map['FollowUpPhotos']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (key != null) map['Key'] = key; if (patientCode != null) map['PatientCode'] = patientCode; if (contractedDoctor != null) map['ContractedDoctor'] = contractedDoctor; if (followUpData != null) map['FollowUpData'] = followUpData; if (templateCode != null) map['TemplateCode'] = templateCode; if (followUpTime != null) map['FollowUpTime'] = JsonRpcUtils.dateFormat(followUpTime!); if (nextFollowUpTime != null) map['NextFollowUpTime'] = JsonRpcUtils.dateFormat(nextFollowUpTime!); map['FollowUpMode'] = followUpMode.index; if (followUpPhotos != null) map['FollowUpPhotos'] = followUpPhotos; return map; } } enum FollowUpStateEnum { NoFollowUp, FollowUpVisit, Cancelled, } class FollowUpDTO extends BaseDTO{ String? code; String? key; String? patientCode; String? contractedDoctorCode; String? contractedDoctor; String? followUpData; String? patientName; String? cardNo; GenderEnum patientGender; String? patientAddress; DateTime? birthday; FollowUpStateEnum followUpState; String? templateCode; DateTime? followUpTime; DateTime? nextFollowUpTime; FollowUpModeEnum? followUpMode; List? followUpPhotos; String? followUpDoctorCode; String? followUpDoctor; FollowUpDTO({ this.code, this.key, this.patientCode, this.contractedDoctorCode, this.contractedDoctor, this.followUpData, this.patientName, this.cardNo, this.patientGender = GenderEnum.Unknown, this.patientAddress, this.birthday, this.followUpState = FollowUpStateEnum.NoFollowUp, this.templateCode, this.followUpTime, this.nextFollowUpTime, this.followUpMode, this.followUpPhotos, this.followUpDoctorCode, this.followUpDoctor, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory FollowUpDTO.fromJson(Map map) { return FollowUpDTO( code: map['Code'], key: map['Key'], patientCode: map['PatientCode'], contractedDoctorCode: map['ContractedDoctorCode'], contractedDoctor: map['ContractedDoctor'], followUpData: map['FollowUpData'], patientName: map['PatientName'], cardNo: map['CardNo'], patientGender: GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']), patientAddress: map['PatientAddress'], birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null, followUpState: FollowUpStateEnum.values.firstWhere((e) => e.index == map['FollowUpState']), templateCode: map['TemplateCode'], followUpTime: map['FollowUpTime'] != null ? DateTime.parse(map['FollowUpTime']) : null, nextFollowUpTime: map['NextFollowUpTime'] != null ? DateTime.parse(map['NextFollowUpTime']) : null, followUpMode: map['FollowUpMode'] != null ? FollowUpModeEnum.values.firstWhere((e) => e.index == map['FollowUpMode']) : null, followUpPhotos: map['FollowUpPhotos']?.cast().toList(), followUpDoctorCode: map['FollowUpDoctorCode'], followUpDoctor: map['FollowUpDoctor'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (key != null) map['Key'] = key; if (patientCode != null) map['PatientCode'] = patientCode; if (contractedDoctorCode != null) map['ContractedDoctorCode'] = contractedDoctorCode; if (contractedDoctor != null) map['ContractedDoctor'] = contractedDoctor; if (followUpData != null) map['FollowUpData'] = followUpData; if (patientName != null) map['PatientName'] = patientName; if (cardNo != null) map['CardNo'] = cardNo; map['PatientGender'] = patientGender.index; if (patientAddress != null) map['PatientAddress'] = patientAddress; if (birthday != null) map['Birthday'] = JsonRpcUtils.dateFormat(birthday!); map['FollowUpState'] = followUpState.index; if (templateCode != null) map['TemplateCode'] = templateCode; if (followUpTime != null) map['FollowUpTime'] = JsonRpcUtils.dateFormat(followUpTime!); if (nextFollowUpTime != null) map['NextFollowUpTime'] = JsonRpcUtils.dateFormat(nextFollowUpTime!); if (followUpMode != null) map['FollowUpMode'] = followUpMode; if (followUpPhotos != null) map['FollowUpPhotos'] = followUpPhotos; if (followUpDoctorCode != null) map['FollowUpDoctorCode'] = followUpDoctorCode; if (followUpDoctor != null) map['FollowUpDoctor'] = followUpDoctor; return map; } } class GetFollowUpRequest extends TokenRequest{ String? code; GetFollowUpRequest({ this.code, String? token, }) : super( token: token, ); factory GetFollowUpRequest.fromJson(Map map) { return GetFollowUpRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetFollowUpByKeyRequest extends TokenRequest{ String? key; String? value; GetFollowUpByKeyRequest({ this.key, this.value, String? token, }) : super( token: token, ); factory GetFollowUpByKeyRequest.fromJson(Map map) { return GetFollowUpByKeyRequest( key: map['Key'], value: map['Value'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (key != null) map['Key'] = key; if (value != null) map['Value'] = value; return map; } } class FollowUpPageRequest extends PageRequest{ FollowUpPageRequest({ int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FollowUpPageRequest.fromJson(Map map) { return FollowUpPageRequest( pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class RemoveFollowUpRequest extends TokenRequest{ String? code; RemoveFollowUpRequest({ this.code, String? token, }) : super( token: token, ); factory RemoveFollowUpRequest.fromJson(Map map) { return RemoveFollowUpRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetFollowUpListRequest extends TokenRequest{ List? codes; GetFollowUpListRequest({ this.codes, String? token, }) : super( token: token, ); factory GetFollowUpListRequest.fromJson(Map map) { return GetFollowUpListRequest( codes: map['Codes']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (codes != null) map['Codes'] = codes; return map; } } class UpdateFollowUpRequest extends TokenRequest{ String? code; String? key; String? followUpData; FollowUpStateEnum? followUpState; DateTime? followUpTime; DateTime? nextFollowUpTime; FollowUpModeEnum? followUpMode; List? followUpPhotos; UpdateFollowUpRequest({ this.code, this.key, this.followUpData, this.followUpState, this.followUpTime, this.nextFollowUpTime, this.followUpMode, this.followUpPhotos, String? token, }) : super( token: token, ); factory UpdateFollowUpRequest.fromJson(Map map) { return UpdateFollowUpRequest( code: map['Code'], key: map['Key'], followUpData: map['FollowUpData'], followUpState: map['FollowUpState'] != null ? FollowUpStateEnum.values.firstWhere((e) => e.index == map['FollowUpState']) : null, followUpTime: map['FollowUpTime'] != null ? DateTime.parse(map['FollowUpTime']) : null, nextFollowUpTime: map['NextFollowUpTime'] != null ? DateTime.parse(map['NextFollowUpTime']) : null, followUpMode: map['FollowUpMode'] != null ? FollowUpModeEnum.values.firstWhere((e) => e.index == map['FollowUpMode']) : null, followUpPhotos: map['FollowUpPhotos']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (key != null) map['Key'] = key; if (followUpData != null) map['FollowUpData'] = followUpData; if (followUpState != null) map['FollowUpState'] = followUpState; if (followUpTime != null) map['FollowUpTime'] = JsonRpcUtils.dateFormat(followUpTime!); if (nextFollowUpTime != null) map['NextFollowUpTime'] = JsonRpcUtils.dateFormat(nextFollowUpTime!); if (followUpMode != null) map['FollowUpMode'] = followUpMode; if (followUpPhotos != null) map['FollowUpPhotos'] = followUpPhotos; return map; } } class GetFollowUpPageByKeyRequest extends PageRequest{ String? key; String? patientCode; GetFollowUpPageByKeyRequest({ this.key, this.patientCode, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetFollowUpPageByKeyRequest.fromJson(Map map) { return GetFollowUpPageByKeyRequest( key: map['Key'], patientCode: map['PatientCode'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (key != null) map['Key'] = key; if (patientCode != null) map['PatientCode'] = patientCode; return map; } } class GetFollowUpPatientPageByKeyRequest extends PageRequest{ String? key; FollowUpStateEnum? followUpState; GetFollowUpPatientPageByKeyRequest({ this.key, this.followUpState, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetFollowUpPatientPageByKeyRequest.fromJson(Map map) { return GetFollowUpPatientPageByKeyRequest( key: map['Key'], followUpState: map['FollowUpState'] != null ? FollowUpStateEnum.values.firstWhere((e) => e.index == map['FollowUpState']) : null, pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (key != null) map['Key'] = key; if (followUpState != null) map['FollowUpState'] = followUpState; return map; } } class FollowUpRecordDataDTO { String? key; String? code; String? followUpData; String? templateCode; DateTime? followUpTime; DateTime? nextFollowUpTime; FollowUpModeEnum? followUpMode; FollowUpStateEnum followUpState; String? followUpDoctor; String? followUpDoctorCode; List? followUpPhotos; String? followUpDoctorSignature; FollowUpRecordDataDTO({ this.key, this.code, this.followUpData, this.templateCode, this.followUpTime, this.nextFollowUpTime, this.followUpMode, this.followUpState = FollowUpStateEnum.NoFollowUp, this.followUpDoctor, this.followUpDoctorCode, this.followUpPhotos, this.followUpDoctorSignature, }); factory FollowUpRecordDataDTO.fromJson(Map map) { return FollowUpRecordDataDTO( key: map['Key'], code: map['Code'], followUpData: map['FollowUpData'], templateCode: map['TemplateCode'], followUpTime: map['FollowUpTime'] != null ? DateTime.parse(map['FollowUpTime']) : null, nextFollowUpTime: map['NextFollowUpTime'] != null ? DateTime.parse(map['NextFollowUpTime']) : null, followUpMode: map['FollowUpMode'] != null ? FollowUpModeEnum.values.firstWhere((e) => e.index == map['FollowUpMode']) : null, followUpState: FollowUpStateEnum.values.firstWhere((e) => e.index == map['FollowUpState']), followUpDoctor: map['FollowUpDoctor'], followUpDoctorCode: map['FollowUpDoctorCode'], followUpPhotos: map['FollowUpPhotos']?.cast().toList(), followUpDoctorSignature: map['FollowUpDoctorSignature'], ); } Map toJson() { final map = Map(); if (key != null) { map['Key'] = key; } if (code != null) { map['Code'] = code; } if (followUpData != null) { map['FollowUpData'] = followUpData; } if (templateCode != null) { map['TemplateCode'] = templateCode; } if (followUpTime != null) { map['FollowUpTime'] = JsonRpcUtils.dateFormat(followUpTime!); } if (nextFollowUpTime != null) { map['NextFollowUpTime'] = JsonRpcUtils.dateFormat(nextFollowUpTime!); } if (followUpMode != null) { map['FollowUpMode'] = followUpMode; } map['FollowUpState'] = followUpState.index; if (followUpDoctor != null) { map['FollowUpDoctor'] = followUpDoctor; } if (followUpDoctorCode != null) { map['FollowUpDoctorCode'] = followUpDoctorCode; } if (followUpPhotos != null) { map['FollowUpPhotos'] = followUpPhotos; } if (followUpDoctorSignature != null) { map['FollowUpDoctorSignature'] = followUpDoctorSignature; } return map; } } class FollowUpRecordDTO { String? contractedDoctor; String? contractedDoctorCode; String? patientName; String? cardNo; GenderEnum patientGender; String? patientAddress; DateTime? birthday; List? followUpRecordDatas; FollowUpRecordDTO({ this.contractedDoctor, this.contractedDoctorCode, this.patientName, this.cardNo, this.patientGender = GenderEnum.Unknown, this.patientAddress, this.birthday, this.followUpRecordDatas, }); factory FollowUpRecordDTO.fromJson(Map map) { return FollowUpRecordDTO( contractedDoctor: map['ContractedDoctor'], contractedDoctorCode: map['ContractedDoctorCode'], patientName: map['PatientName'], cardNo: map['CardNo'], patientGender: GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']), patientAddress: map['PatientAddress'], birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null, followUpRecordDatas: map['FollowUpRecordDatas'] != null ? (map['FollowUpRecordDatas'] as List).map((e)=>FollowUpRecordDataDTO.fromJson(e as Map)).toList() : null, ); } Map toJson() { final map = Map(); if (contractedDoctor != null) { map['ContractedDoctor'] = contractedDoctor; } if (contractedDoctorCode != null) { map['ContractedDoctorCode'] = contractedDoctorCode; } if (patientName != null) { map['PatientName'] = patientName; } if (cardNo != null) { map['CardNo'] = cardNo; } map['PatientGender'] = patientGender.index; if (patientAddress != null) { map['PatientAddress'] = patientAddress; } if (birthday != null) { map['Birthday'] = JsonRpcUtils.dateFormat(birthday!); } if (followUpRecordDatas != null) { map['FollowUpRecordDatas'] = followUpRecordDatas; } return map; } } class GetFollowUpRecordListRequest extends TokenRequest{ List? keys; String? patientCode; GetFollowUpRecordListRequest({ this.keys, this.patientCode, String? token, }) : super( token: token, ); factory GetFollowUpRecordListRequest.fromJson(Map map) { return GetFollowUpRecordListRequest( keys: map['Keys']?.cast().toList(), patientCode: map['PatientCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (keys != null) map['Keys'] = keys; if (patientCode != null) map['PatientCode'] = patientCode; return map; } } class GetFollowUpRecordListByYearRequest extends TokenRequest{ List? keys; String? patientCode; String? year; GetFollowUpRecordListByYearRequest({ this.keys, this.patientCode, this.year, String? token, }) : super( token: token, ); factory GetFollowUpRecordListByYearRequest.fromJson(Map map) { return GetFollowUpRecordListByYearRequest( keys: map['Keys']?.cast().toList(), patientCode: map['PatientCode'], year: map['Year'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (keys != null) map['Keys'] = keys; if (patientCode != null) map['PatientCode'] = patientCode; if (year != null) map['Year'] = year; return map; } }