import 'liveConsultation.m.dart'; import 'notification.m.dart'; import 'vitalContractRecord.m.dart'; import 'vitalHealthExamBooking.m.dart'; import 'device.m.dart'; import 'package:fis_jsonrpc/utils.dart'; class CreateExamRequest extends TokenRequest{ String? code; String? batchNumber; String? key; String? patientCode; String? contractedDoctor; String? examData; String? templateCode; CreateExamRequest({ this.code, this.batchNumber, this.key, this.patientCode, this.contractedDoctor, this.examData, this.templateCode, String? token, }) : super( token: token, ); factory CreateExamRequest.fromJson(Map map) { return CreateExamRequest( code: map['Code'], batchNumber: map['BatchNumber'], key: map['Key'], patientCode: map['PatientCode'], contractedDoctor: map['ContractedDoctor'], examData: map['ExamData'], templateCode: map['TemplateCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (batchNumber != null) map['BatchNumber'] = batchNumber; if (key != null) map['Key'] = key; if (patientCode != null) map['PatientCode'] = patientCode; if (contractedDoctor != null) map['ContractedDoctor'] = contractedDoctor; if (examData != null) map['ExamData'] = examData; if (templateCode != null) map['TemplateCode'] = templateCode; return map; } } class ExamDTO extends BaseDTO{ String? code; String? key; String? patientCode; String? contractedDoctor; String? examData; String? patientName; String? cardNo; GenderEnum patientGender; String? patientAddress; DateTime? birthday; ExamStateEnum examState; DateTime? examTime; String? templateCode; String? examDoctor; String? batchNumber; ExamDTO({ this.code, this.key, this.patientCode, this.contractedDoctor, this.examData, this.patientName, this.cardNo, this.patientGender = GenderEnum.Unknown, this.patientAddress, this.birthday, this.examState = ExamStateEnum.Unchecked, this.examTime, this.templateCode, this.examDoctor, this.batchNumber, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory ExamDTO.fromJson(Map map) { return ExamDTO( code: map['Code'], key: map['Key'], patientCode: map['PatientCode'], contractedDoctor: map['ContractedDoctor'], examData: map['ExamData'], 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, examState: ExamStateEnum.values.firstWhere((e) => e.index == map['ExamState']), examTime: map['ExamTime'] != null ? DateTime.parse(map['ExamTime']) : null, templateCode: map['TemplateCode'], examDoctor: map['ExamDoctor'], batchNumber: map['BatchNumber'], 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 (contractedDoctor != null) map['ContractedDoctor'] = contractedDoctor; if (examData != null) map['ExamData'] = examData; 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['ExamState'] = examState.index; if (examTime != null) map['ExamTime'] = JsonRpcUtils.dateFormat(examTime!); if (templateCode != null) map['TemplateCode'] = templateCode; if (examDoctor != null) map['ExamDoctor'] = examDoctor; if (batchNumber != null) map['BatchNumber'] = batchNumber; return map; } } class GetExamRequest extends TokenRequest{ String? code; GetExamRequest({ this.code, String? token, }) : super( token: token, ); factory GetExamRequest.fromJson(Map map) { return GetExamRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetExamByKeyRequest extends TokenRequest{ String? key; String? value; GetExamByKeyRequest({ this.key, this.value, String? token, }) : super( token: token, ); factory GetExamByKeyRequest.fromJson(Map map) { return GetExamByKeyRequest( 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 ExamPageRequest extends PageRequest{ ExamPageRequest({ int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory ExamPageRequest.fromJson(Map map) { return ExamPageRequest( pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class RemoveExamRequest extends TokenRequest{ String? code; RemoveExamRequest({ this.code, String? token, }) : super( token: token, ); factory RemoveExamRequest.fromJson(Map map) { return RemoveExamRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetExamListRequest extends TokenRequest{ List? codes; GetExamListRequest({ this.codes, String? token, }) : super( token: token, ); factory GetExamListRequest.fromJson(Map map) { return GetExamListRequest( codes: map['Codes']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (codes != null) map['Codes'] = codes; return map; } } class UpdateExamRequest extends TokenRequest{ String? code; String? key; String? examData; UpdateExamRequest({ this.code, this.key, this.examData, String? token, }) : super( token: token, ); factory UpdateExamRequest.fromJson(Map map) { return UpdateExamRequest( code: map['Code'], key: map['Key'], examData: map['ExamData'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (key != null) map['Key'] = key; if (examData != null) map['ExamData'] = examData; return map; } } class GetExamPageByKeyRequest extends PageRequest{ String? key; String? patientCode; GetExamPageByKeyRequest({ this.key, this.patientCode, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetExamPageByKeyRequest.fromJson(Map map) { return GetExamPageByKeyRequest( 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 GetExamPatientPageByKeyRequest extends PageRequest{ String? key; GetExamPatientPageByKeyRequest({ this.key, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetExamPatientPageByKeyRequest.fromJson(Map map) { return GetExamPatientPageByKeyRequest( key: map['Key'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (key != null) map['Key'] = key; return map; } } class GetExamRecordPageRequest extends PageRequest{ List? keys; GetExamRecordPageRequest({ this.keys, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetExamRecordPageRequest.fromJson(Map map) { return GetExamRecordPageRequest( keys: map['Keys']?.cast().toList(), pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (keys != null) map['Keys'] = keys; return map; } } class ExamRecordDataDTO { String? key; String? code; String? examData; String? templateCode; ExamRecordDataDTO({ this.key, this.code, this.examData, this.templateCode, }); factory ExamRecordDataDTO.fromJson(Map map) { return ExamRecordDataDTO( key: map['Key'], code: map['Code'], examData: map['ExamData'], templateCode: map['TemplateCode'], ); } Map toJson() { final map = Map(); if (key != null) { map['Key'] = key; } if (code != null) { map['Code'] = code; } if (examData != null) { map['ExamData'] = examData; } if (templateCode != null) { map['TemplateCode'] = templateCode; } return map; } } class ExamRecordDTO { String? batchNumber; String? contractedDoctor; String? patientName; String? cardNo; GenderEnum patientGender; String? patientAddress; DateTime? birthday; ExamStateEnum examState; DateTime? examTime; String? examDoctor; List? examRecordDatas; ExamRecordDTO({ this.batchNumber, this.contractedDoctor, this.patientName, this.cardNo, this.patientGender = GenderEnum.Unknown, this.patientAddress, this.birthday, this.examState = ExamStateEnum.Unchecked, this.examTime, this.examDoctor, this.examRecordDatas, }); factory ExamRecordDTO.fromJson(Map map) { return ExamRecordDTO( batchNumber: map['BatchNumber'], contractedDoctor: map['ContractedDoctor'], 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, examState: ExamStateEnum.values.firstWhere((e) => e.index == map['ExamState']), examTime: map['ExamTime'] != null ? DateTime.parse(map['ExamTime']) : null, examDoctor: map['ExamDoctor'], examRecordDatas: map['ExamRecordDatas'] != null ? (map['ExamRecordDatas'] as List).map((e)=>ExamRecordDataDTO.fromJson(e as Map)).toList() : null, ); } Map toJson() { final map = Map(); if (batchNumber != null) { map['BatchNumber'] = batchNumber; } if (contractedDoctor != null) { map['ContractedDoctor'] = contractedDoctor; } 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['ExamState'] = examState.index; if (examTime != null) { map['ExamTime'] = JsonRpcUtils.dateFormat(examTime!); } if (examDoctor != null) { map['ExamDoctor'] = examDoctor; } if (examRecordDatas != null) { map['ExamRecordDatas'] = examRecordDatas; } return map; } } class GetExamRecordListRequest extends TokenRequest{ List? keys; String? patientCode; GetExamRecordListRequest({ this.keys, this.patientCode, String? token, }) : super( token: token, ); factory GetExamRecordListRequest.fromJson(Map map) { return GetExamRecordListRequest( 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 SaveQuickCheckRecordRequest extends TokenRequest{ String? patientCode; List? keys; String? quickData; SaveQuickCheckRecordRequest({ this.patientCode, this.keys, this.quickData, String? token, }) : super( token: token, ); factory SaveQuickCheckRecordRequest.fromJson(Map map) { return SaveQuickCheckRecordRequest( patientCode: map['PatientCode'], keys: map['Keys']?.cast().toList(), quickData: map['QuickData'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (patientCode != null) map['PatientCode'] = patientCode; if (keys != null) map['Keys'] = keys; if (quickData != null) map['QuickData'] = quickData; return map; } } class UpdateExamByBatchNumberRequest extends TokenRequest{ String? batchNumber; String? patientCode; String? key; String? examData; UpdateExamByBatchNumberRequest({ this.batchNumber, this.patientCode, this.key, this.examData, String? token, }) : super( token: token, ); factory UpdateExamByBatchNumberRequest.fromJson(Map map) { return UpdateExamByBatchNumberRequest( batchNumber: map['BatchNumber'], patientCode: map['PatientCode'], key: map['Key'], examData: map['ExamData'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (batchNumber != null) map['BatchNumber'] = batchNumber; if (patientCode != null) map['PatientCode'] = patientCode; if (key != null) map['Key'] = key; if (examData != null) map['ExamData'] = examData; return map; } }