123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- import 'authentication.m.dart';
- import 'patient.m.dart';
- import 'package:fis_jsonrpc/utils.dart';
- class PatientInfoExt {
- String? patientScanType;
- List<DataItemDTO>? content;
- PatientInfoExt({
- this.patientScanType,
- this.content,
- });
- factory PatientInfoExt.fromJson(Map<String, dynamic> map) {
- return PatientInfoExt(
- patientScanType: map['PatientScanType'],
- content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(patientScanType != null)
- map['PatientScanType'] = patientScanType;
- if(content != null)
- map['Content'] = content;
- return map;
- }
- }
- class CreateRecordRequest extends TokenRequest{
- String? patientCode;
- String? deviceCode;
- List<PatientInfoExt>? patientInfoExtList;
- CreateRecordRequest({
- this.patientCode,
- this.deviceCode,
- this.patientInfoExtList,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateRecordRequest.fromJson(Map<String, dynamic> map) {
- return CreateRecordRequest(
- patientCode: map['PatientCode'],
- deviceCode: map['DeviceCode'],
- patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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 RecordStatusEnum {
- NotScanned,
- NotReport,
- Completed,
- }
- class GetRecordsPageResult {
- DateTime? createTime;
- String? deptName;
- String? creatorName;
- String? deviceName;
- String? reportNum;
- String? recordCode;
- RecordStatusEnum recordStatus;
- bool isRead;
- GetRecordsPageResult({
- this.createTime,
- this.deptName,
- this.creatorName,
- this.deviceName,
- this.reportNum,
- this.recordCode,
- this.recordStatus = RecordStatusEnum.NotScanned,
- this.isRead = false,
- });
- factory GetRecordsPageResult.fromJson(Map<String, dynamic> map) {
- return GetRecordsPageResult(
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- deptName: map['DeptName'],
- creatorName: map['CreatorName'],
- deviceName: map['DeviceName'],
- reportNum: map['ReportNum'],
- recordCode: map['RecordCode'],
- recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
- isRead: map['IsRead'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(createTime != null)
- map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
- if(deptName != null)
- map['DeptName'] = deptName;
- if(creatorName != null)
- map['CreatorName'] = creatorName;
- if(deviceName != null)
- map['DeviceName'] = deviceName;
- if(reportNum != null)
- map['ReportNum'] = reportNum;
- if(recordCode != null)
- map['RecordCode'] = recordCode;
- map['RecordStatus'] = recordStatus.index;
- map['IsRead'] = isRead;
- return map;
- }
- }
- class GetRecordsPageRequest extends PageRequest{
- String? patientCode;
- GetRecordsPageRequest({
- this.patientCode,
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory GetRecordsPageRequest.fromJson(Map<String, dynamic> map) {
- return GetRecordsPageRequest(
- patientCode: map['PatientCode'],
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(patientCode != null)
- map['PatientCode'] = patientCode;
- return map;
- }
- }
- class QueryRecordResult {
- DateTime? createTime;
- String? deptName;
- String? patientName;
- String? patientAge;
- int patientSex;
- String? creatorName;
- String? deviceName;
- RecordStatusEnum recordStatus;
- List<PatientInfoExt>? patientInfoExtList;
- QueryRecordResult({
- this.createTime,
- this.deptName,
- this.patientName,
- this.patientAge,
- this.patientSex = 0,
- this.creatorName,
- this.deviceName,
- this.recordStatus = RecordStatusEnum.NotScanned,
- this.patientInfoExtList,
- });
- factory QueryRecordResult.fromJson(Map<String, dynamic> 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<String,dynamic>)).toList() : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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;
- return map;
- }
- }
- class QueryRecordRequest extends TokenRequest{
- String? recordCode;
- QueryRecordRequest({
- this.recordCode,
- String? token,
- }) : super(
- token: token,
- );
- factory QueryRecordRequest.fromJson(Map<String, dynamic> map) {
- return QueryRecordRequest(
- recordCode: map['RecordCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(recordCode != null)
- map['RecordCode'] = recordCode;
- return map;
- }
- }
- class PushRecordCodesToDeviceRequest extends TokenRequest{
- List<String>? recordCodes;
- String? deviceCode;
- PushRecordCodesToDeviceRequest({
- this.recordCodes,
- this.deviceCode,
- String? token,
- }) : super(
- token: token,
- );
- factory PushRecordCodesToDeviceRequest.fromJson(Map<String, dynamic> map) {
- return PushRecordCodesToDeviceRequest(
- recordCodes: map['RecordCodes'] != null ? map['RecordCodes'].cast<String>().toList() : null,
- deviceCode: map['DeviceCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(recordCodes != null)
- map['RecordCodes'] = recordCodes;
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
- class FinishExamNotifyDetail {
- String? recordCode;
- RecordStatusEnum recordStatus;
- FinishExamNotifyDetail({
- this.recordCode,
- this.recordStatus = RecordStatusEnum.NotScanned,
- });
- factory FinishExamNotifyDetail.fromJson(Map<String, dynamic> map) {
- return FinishExamNotifyDetail(
- recordCode: map['RecordCode'],
- recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(recordCode != null)
- map['RecordCode'] = recordCode;
- map['RecordStatus'] = recordStatus.index;
- return map;
- }
- }
- class PushFinishExamNotifyToClientRequest {
- List<FinishExamNotifyDetail>? records;
- String? userCode;
- PushFinishExamNotifyToClientRequest({
- this.records,
- this.userCode,
- });
- factory PushFinishExamNotifyToClientRequest.fromJson(Map<String, dynamic> map) {
- return PushFinishExamNotifyToClientRequest(
- records: map['Records'] != null ? (map['Records'] as List).map((e)=>FinishExamNotifyDetail.fromJson(e as Map<String,dynamic>)).toList() : null,
- userCode: map['UserCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(records != null)
- map['Records'] = records;
- if(userCode != null)
- map['UserCode'] = userCode;
- return map;
- }
- }
- class DeviceFinishExamRequest extends TokenRequest{
- List<String>? records;
- DeviceFinishExamRequest({
- this.records,
- String? token,
- }) : super(
- token: token,
- );
- factory DeviceFinishExamRequest.fromJson(Map<String, dynamic> map) {
- return DeviceFinishExamRequest(
- records: map['Records'] != null ? map['Records'].cast<String>().toList() : null,
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(records != null)
- map['Records'] = records;
- return map;
- }
- }
|