import 'aIDiagnosis.m.dart'; import 'patient.m.dart'; import 'connect.m.dart'; import 'authentication.m.dart'; import 'organization.m.dart'; import 'package:fis_jsonrpc/utils.dart'; class PatientInfoExt { String? patientScanType; List? content; PatientInfoExt({ this.patientScanType, this.content, }); factory PatientInfoExt.fromJson(Map map) { return PatientInfoExt( patientScanType: map['PatientScanType'], content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map)).toList() : null, ); } Map toJson() { final map = Map(); if(patientScanType != null) map['PatientScanType'] = patientScanType; if(content != null) map['Content'] = content; return map; } } class CreateRecordRequest extends TokenRequest{ String? patientCode; String? deviceCode; List? patientInfoExtList; CreateRecordRequest({ this.patientCode, this.deviceCode, this.patientInfoExtList, String? token, }) : super( token: token, ); factory CreateRecordRequest.fromJson(Map map) { return CreateRecordRequest( patientCode: map['PatientCode'], deviceCode: map['DeviceCode'], patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map)).toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(patientCode != null) map['PatientCode'] = patientCode; if(deviceCode != null) map['DeviceCode'] = deviceCode; if(patientInfoExtList != null) map['PatientInfoExtList'] = patientInfoExtList; return map; } } enum QueryRecordStatusEnum { All, NotScanned, Uploaded, NotReport, Completed, NotCompleted, } enum QueryRecordCreateTypeEnum { All, Reservation, Normal, } class GetRecordsPageRequest extends PageRequest{ String? patientCode; QueryRecordStatusEnum queryRecordStatus; QueryRecordCreateTypeEnum queryRecordCreateType; GetRecordsPageRequest({ this.patientCode, this.queryRecordStatus = QueryRecordStatusEnum.All, this.queryRecordCreateType = QueryRecordCreateTypeEnum.All, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetRecordsPageRequest.fromJson(Map map) { return GetRecordsPageRequest( patientCode: map['PatientCode'], queryRecordStatus: QueryRecordStatusEnum.values.firstWhere((e) => e.index == map['QueryRecordStatus']), queryRecordCreateType: QueryRecordCreateTypeEnum.values.firstWhere((e) => e.index == map['QueryRecordCreateType']), pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(patientCode != null) map['PatientCode'] = patientCode; map['QueryRecordStatus'] = queryRecordStatus.index; map['QueryRecordCreateType'] = queryRecordCreateType.index; return map; } } class QueryRecordResult { DateTime? createTime; String? deptName; String? patientName; String? patientAge; int patientSex; String? creatorName; String? deviceName; RecordStatusEnum recordStatus; List? patientInfoExtList; DiagnosisStatusEnum diagnosisStatus; List? diagnosisInfos; QueryRecordResult({ this.createTime, this.deptName, this.patientName, this.patientAge, this.patientSex = 0, this.creatorName, this.deviceName, this.recordStatus = RecordStatusEnum.NotScanned, this.patientInfoExtList, this.diagnosisStatus = DiagnosisStatusEnum.NotRequired, this.diagnosisInfos, }); factory QueryRecordResult.fromJson(Map map) { return QueryRecordResult( createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, deptName: map['DeptName'], patientName: map['PatientName'], patientAge: map['PatientAge'], patientSex: map['PatientSex'], creatorName: map['CreatorName'], deviceName: map['DeviceName'], recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']), patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map)).toList() : null, diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']), diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map)).toList() : null, ); } Map toJson() { final map = Map(); if(createTime != null) map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!); if(deptName != null) map['DeptName'] = deptName; if(patientName != null) map['PatientName'] = patientName; if(patientAge != null) map['PatientAge'] = patientAge; map['PatientSex'] = patientSex; if(creatorName != null) map['CreatorName'] = creatorName; if(deviceName != null) map['DeviceName'] = deviceName; map['RecordStatus'] = recordStatus.index; if(patientInfoExtList != null) map['PatientInfoExtList'] = patientInfoExtList; map['DiagnosisStatus'] = diagnosisStatus.index; if(diagnosisInfos != null) map['DiagnosisInfos'] = diagnosisInfos; return map; } } class QueryRecordRequest extends TokenRequest{ String? recordCode; QueryRecordRequest({ this.recordCode, String? token, }) : super( token: token, ); factory QueryRecordRequest.fromJson(Map map) { return QueryRecordRequest( recordCode: map['RecordCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(recordCode != null) map['RecordCode'] = recordCode; return map; } } class ProcessRecordDataResult { List? content; ProcessRecordDataResult({ this.content, }); factory ProcessRecordDataResult.fromJson(Map map) { return ProcessRecordDataResult( content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map)).toList() : null, ); } Map toJson() { final map = Map(); if(content != null) map['Content'] = content; return map; } } enum AnimalSpeciesEnum { Bovine, Canidae, Equidae, Felidae, Caprinae, Suidae, } class ProcessRecordDataRequest extends TokenRequest{ String? methodName; List? content; OrganizationPatientTypeEnum patientType; AnimalSpeciesEnum speciesEnum; ProcessRecordDataRequest({ this.methodName, this.content, this.patientType = OrganizationPatientTypeEnum.Person, this.speciesEnum = AnimalSpeciesEnum.Bovine, String? token, }) : super( token: token, ); factory ProcessRecordDataRequest.fromJson(Map map) { return ProcessRecordDataRequest( methodName: map['MethodName'], content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map)).toList() : null, patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']), speciesEnum: AnimalSpeciesEnum.values.firstWhere((e) => e.index == map['SpeciesEnum']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(methodName != null) map['MethodName'] = methodName; if(content != null) map['Content'] = content; map['PatientType'] = patientType.index; map['SpeciesEnum'] = speciesEnum.index; return map; } } class RelevanceRecordRequest extends TokenRequest{ String? examCode; String? rservationCode; RelevanceRecordRequest({ this.examCode, this.rservationCode, String? token, }) : super( token: token, ); factory RelevanceRecordRequest.fromJson(Map map) { return RelevanceRecordRequest( examCode: map['ExamCode'], rservationCode: map['RservationCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(examCode != null) map['ExamCode'] = examCode; if(rservationCode != null) map['RservationCode'] = rservationCode; return map; } } class FinishRecordRequest extends TokenRequest{ String? recordCode; FinishRecordRequest({ this.recordCode, String? token, }) : super( token: token, ); factory FinishRecordRequest.fromJson(Map map) { return FinishRecordRequest( recordCode: map['RecordCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(recordCode != null) map['RecordCode'] = recordCode; return map; } }