recordInfo.m.dart 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. import 'authentication.m.dart';
  2. import 'patient.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. class PatientInfoExt {
  5. String? patientScanType;
  6. List<DataItemDTO>? content;
  7. PatientInfoExt({
  8. this.patientScanType,
  9. this.content,
  10. });
  11. factory PatientInfoExt.fromJson(Map<String, dynamic> map) {
  12. return PatientInfoExt(
  13. patientScanType: map['PatientScanType'],
  14. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  15. );
  16. }
  17. Map<String, dynamic> toJson() {
  18. final map = Map<String, dynamic>();
  19. if(patientScanType != null)
  20. map['PatientScanType'] = patientScanType;
  21. if(content != null)
  22. map['Content'] = content;
  23. return map;
  24. }
  25. }
  26. class CreateRecordRequest extends TokenRequest{
  27. String? patientCode;
  28. String? deviceCode;
  29. List<PatientInfoExt>? patientInfoExtList;
  30. CreateRecordRequest({
  31. this.patientCode,
  32. this.deviceCode,
  33. this.patientInfoExtList,
  34. String? token,
  35. }) : super(
  36. token: token,
  37. );
  38. factory CreateRecordRequest.fromJson(Map<String, dynamic> map) {
  39. return CreateRecordRequest(
  40. patientCode: map['PatientCode'],
  41. deviceCode: map['DeviceCode'],
  42. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  43. token: map['Token'],
  44. );
  45. }
  46. Map<String, dynamic> toJson() {
  47. final map = super.toJson();
  48. if(patientCode != null)
  49. map['PatientCode'] = patientCode;
  50. if(deviceCode != null)
  51. map['DeviceCode'] = deviceCode;
  52. if(patientInfoExtList != null)
  53. map['PatientInfoExtList'] = patientInfoExtList;
  54. return map;
  55. }
  56. }
  57. enum RecordStatusEnum {
  58. NotScanned,
  59. NotReport,
  60. Completed,
  61. }
  62. class GetRecordsPageResult {
  63. DateTime? createTime;
  64. String? deptName;
  65. String? creatorName;
  66. String? deviceName;
  67. String? reportNum;
  68. String? recordCode;
  69. RecordStatusEnum recordStatus;
  70. bool isRead;
  71. GetRecordsPageResult({
  72. this.createTime,
  73. this.deptName,
  74. this.creatorName,
  75. this.deviceName,
  76. this.reportNum,
  77. this.recordCode,
  78. this.recordStatus = RecordStatusEnum.NotScanned,
  79. this.isRead = false,
  80. });
  81. factory GetRecordsPageResult.fromJson(Map<String, dynamic> map) {
  82. return GetRecordsPageResult(
  83. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  84. deptName: map['DeptName'],
  85. creatorName: map['CreatorName'],
  86. deviceName: map['DeviceName'],
  87. reportNum: map['ReportNum'],
  88. recordCode: map['RecordCode'],
  89. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  90. isRead: map['IsRead'],
  91. );
  92. }
  93. Map<String, dynamic> toJson() {
  94. final map = Map<String, dynamic>();
  95. if(createTime != null)
  96. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  97. if(deptName != null)
  98. map['DeptName'] = deptName;
  99. if(creatorName != null)
  100. map['CreatorName'] = creatorName;
  101. if(deviceName != null)
  102. map['DeviceName'] = deviceName;
  103. if(reportNum != null)
  104. map['ReportNum'] = reportNum;
  105. if(recordCode != null)
  106. map['RecordCode'] = recordCode;
  107. map['RecordStatus'] = recordStatus.index;
  108. map['IsRead'] = isRead;
  109. return map;
  110. }
  111. }
  112. class GetRecordsPageRequest extends PageRequest{
  113. String? patientCode;
  114. GetRecordsPageRequest({
  115. this.patientCode,
  116. int pageIndex = 0,
  117. int pageSize = 0,
  118. String? token,
  119. }) : super(
  120. pageIndex: pageIndex,
  121. pageSize: pageSize,
  122. token: token,
  123. );
  124. factory GetRecordsPageRequest.fromJson(Map<String, dynamic> map) {
  125. return GetRecordsPageRequest(
  126. patientCode: map['PatientCode'],
  127. pageIndex: map['PageIndex'],
  128. pageSize: map['PageSize'],
  129. token: map['Token'],
  130. );
  131. }
  132. Map<String, dynamic> toJson() {
  133. final map = super.toJson();
  134. if(patientCode != null)
  135. map['PatientCode'] = patientCode;
  136. return map;
  137. }
  138. }
  139. class QueryRecordResult {
  140. DateTime? createTime;
  141. String? deptName;
  142. String? patientName;
  143. String? patientAge;
  144. int patientSex;
  145. String? creatorName;
  146. String? deviceName;
  147. RecordStatusEnum recordStatus;
  148. List<PatientInfoExt>? patientInfoExtList;
  149. QueryRecordResult({
  150. this.createTime,
  151. this.deptName,
  152. this.patientName,
  153. this.patientAge,
  154. this.patientSex = 0,
  155. this.creatorName,
  156. this.deviceName,
  157. this.recordStatus = RecordStatusEnum.NotScanned,
  158. this.patientInfoExtList,
  159. });
  160. factory QueryRecordResult.fromJson(Map<String, dynamic> map) {
  161. return QueryRecordResult(
  162. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  163. deptName: map['DeptName'],
  164. patientName: map['PatientName'],
  165. patientAge: map['PatientAge'],
  166. patientSex: map['PatientSex'],
  167. creatorName: map['CreatorName'],
  168. deviceName: map['DeviceName'],
  169. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  170. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  171. );
  172. }
  173. Map<String, dynamic> toJson() {
  174. final map = Map<String, dynamic>();
  175. if(createTime != null)
  176. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  177. if(deptName != null)
  178. map['DeptName'] = deptName;
  179. if(patientName != null)
  180. map['PatientName'] = patientName;
  181. if(patientAge != null)
  182. map['PatientAge'] = patientAge;
  183. map['PatientSex'] = patientSex;
  184. if(creatorName != null)
  185. map['CreatorName'] = creatorName;
  186. if(deviceName != null)
  187. map['DeviceName'] = deviceName;
  188. map['RecordStatus'] = recordStatus.index;
  189. if(patientInfoExtList != null)
  190. map['PatientInfoExtList'] = patientInfoExtList;
  191. return map;
  192. }
  193. }
  194. class QueryRecordRequest extends TokenRequest{
  195. String? recordCode;
  196. QueryRecordRequest({
  197. this.recordCode,
  198. String? token,
  199. }) : super(
  200. token: token,
  201. );
  202. factory QueryRecordRequest.fromJson(Map<String, dynamic> map) {
  203. return QueryRecordRequest(
  204. recordCode: map['RecordCode'],
  205. token: map['Token'],
  206. );
  207. }
  208. Map<String, dynamic> toJson() {
  209. final map = super.toJson();
  210. if(recordCode != null)
  211. map['RecordCode'] = recordCode;
  212. return map;
  213. }
  214. }
  215. class PushRecordCodesToDeviceRequest extends TokenRequest{
  216. List<String>? recordCodes;
  217. String? deviceCode;
  218. PushRecordCodesToDeviceRequest({
  219. this.recordCodes,
  220. this.deviceCode,
  221. String? token,
  222. }) : super(
  223. token: token,
  224. );
  225. factory PushRecordCodesToDeviceRequest.fromJson(Map<String, dynamic> map) {
  226. return PushRecordCodesToDeviceRequest(
  227. recordCodes: map['RecordCodes'] != null ? map['RecordCodes'].cast<String>().toList() : null,
  228. deviceCode: map['DeviceCode'],
  229. token: map['Token'],
  230. );
  231. }
  232. Map<String, dynamic> toJson() {
  233. final map = super.toJson();
  234. if(recordCodes != null)
  235. map['RecordCodes'] = recordCodes;
  236. if(deviceCode != null)
  237. map['DeviceCode'] = deviceCode;
  238. return map;
  239. }
  240. }
  241. class FinishExamNotifyDetail {
  242. String? recordCode;
  243. RecordStatusEnum recordStatus;
  244. FinishExamNotifyDetail({
  245. this.recordCode,
  246. this.recordStatus = RecordStatusEnum.NotScanned,
  247. });
  248. factory FinishExamNotifyDetail.fromJson(Map<String, dynamic> map) {
  249. return FinishExamNotifyDetail(
  250. recordCode: map['RecordCode'],
  251. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  252. );
  253. }
  254. Map<String, dynamic> toJson() {
  255. final map = Map<String, dynamic>();
  256. if(recordCode != null)
  257. map['RecordCode'] = recordCode;
  258. map['RecordStatus'] = recordStatus.index;
  259. return map;
  260. }
  261. }
  262. class PushFinishExamNotifyToClientRequest {
  263. List<FinishExamNotifyDetail>? records;
  264. String? userCode;
  265. PushFinishExamNotifyToClientRequest({
  266. this.records,
  267. this.userCode,
  268. });
  269. factory PushFinishExamNotifyToClientRequest.fromJson(Map<String, dynamic> map) {
  270. return PushFinishExamNotifyToClientRequest(
  271. records: map['Records'] != null ? (map['Records'] as List).map((e)=>FinishExamNotifyDetail.fromJson(e as Map<String,dynamic>)).toList() : null,
  272. userCode: map['UserCode'],
  273. );
  274. }
  275. Map<String, dynamic> toJson() {
  276. final map = Map<String, dynamic>();
  277. if(records != null)
  278. map['Records'] = records;
  279. if(userCode != null)
  280. map['UserCode'] = userCode;
  281. return map;
  282. }
  283. }
  284. class DeviceFinishExamRequest extends TokenRequest{
  285. List<String>? records;
  286. DeviceFinishExamRequest({
  287. this.records,
  288. String? token,
  289. }) : super(
  290. token: token,
  291. );
  292. factory DeviceFinishExamRequest.fromJson(Map<String, dynamic> map) {
  293. return DeviceFinishExamRequest(
  294. records: map['Records'] != null ? map['Records'].cast<String>().toList() : null,
  295. token: map['Token'],
  296. );
  297. }
  298. Map<String, dynamic> toJson() {
  299. final map = super.toJson();
  300. if(records != null)
  301. map['Records'] = records;
  302. return map;
  303. }
  304. }