recordInfo.m.dart 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. import 'liveConsultation.m.dart';
  2. import 'patient.m.dart';
  3. import 'aIDiagnosis.m.dart';
  4. import 'package:fis_jsonrpc/utils.dart';
  5. class PatientInfoExt {
  6. String? patientScanType;
  7. List<DataItemDTO >? content;
  8. PatientInfoExt({
  9. this.patientScanType,
  10. this.content,
  11. });
  12. factory PatientInfoExt.fromJson(Map<String, dynamic> map) {
  13. return PatientInfoExt(
  14. patientScanType: map['PatientScanType'],
  15. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  16. );
  17. }
  18. Map<String, dynamic> toJson() {
  19. final map = Map<String, dynamic>();
  20. if(patientScanType != null)
  21. map['PatientScanType'] = patientScanType;
  22. if(content != null)
  23. map['Content'] = content;
  24. return map;
  25. }
  26. }
  27. class CreateRecordRequest extends TokenRequest{
  28. String? patientCode;
  29. String? deviceCode;
  30. List<PatientInfoExt >? patientInfoExtList;
  31. CreateRecordRequest({
  32. this.patientCode,
  33. this.deviceCode,
  34. this.patientInfoExtList,
  35. String? token,
  36. }) : super(
  37. token: token,
  38. );
  39. factory CreateRecordRequest.fromJson(Map<String, dynamic> map) {
  40. return CreateRecordRequest(
  41. patientCode: map['PatientCode'],
  42. deviceCode: map['DeviceCode'],
  43. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  44. token: map['Token'],
  45. );
  46. }
  47. Map<String, dynamic> toJson() {
  48. final map = super.toJson();
  49. if(patientCode != null)
  50. map['PatientCode'] = patientCode;
  51. if(deviceCode != null)
  52. map['DeviceCode'] = deviceCode;
  53. if(patientInfoExtList != null)
  54. map['PatientInfoExtList'] = patientInfoExtList;
  55. return map;
  56. }
  57. }
  58. enum QueryRecordStatusEnum {
  59. All,
  60. NotScanned,
  61. Uploaded,
  62. NotReport,
  63. Completed,
  64. NotCompleted,
  65. }
  66. enum QueryRecordCreateTypeEnum {
  67. All,
  68. Reservation,
  69. Normal,
  70. }
  71. class GetRecordsPageRequest extends PageRequest{
  72. String? patientCode;
  73. QueryRecordStatusEnum queryRecordStatus;
  74. QueryRecordCreateTypeEnum queryRecordCreateType;
  75. GetRecordsPageRequest({
  76. this.patientCode,
  77. this.queryRecordStatus = QueryRecordStatusEnum.All,
  78. this.queryRecordCreateType = QueryRecordCreateTypeEnum.All,
  79. int pageIndex = 0,
  80. int pageSize = 0,
  81. String? token,
  82. }) : super(
  83. pageIndex: pageIndex,
  84. pageSize: pageSize,
  85. token: token,
  86. );
  87. factory GetRecordsPageRequest.fromJson(Map<String, dynamic> map) {
  88. return GetRecordsPageRequest(
  89. patientCode: map['PatientCode'],
  90. queryRecordStatus: QueryRecordStatusEnum.values.firstWhere((e) => e.index == map['QueryRecordStatus']),
  91. queryRecordCreateType: QueryRecordCreateTypeEnum.values.firstWhere((e) => e.index == map['QueryRecordCreateType']),
  92. pageIndex: map['PageIndex'],
  93. pageSize: map['PageSize'],
  94. token: map['Token'],
  95. );
  96. }
  97. Map<String, dynamic> toJson() {
  98. final map = super.toJson();
  99. if(patientCode != null)
  100. map['PatientCode'] = patientCode;
  101. map['QueryRecordStatus'] = queryRecordStatus.index;
  102. map['QueryRecordCreateType'] = queryRecordCreateType.index;
  103. return map;
  104. }
  105. }
  106. class QueryRecordResult {
  107. DateTime? createTime;
  108. String? deptName;
  109. String? patientName;
  110. String? patientAge;
  111. List<DataItemDTO >? patientAgeInfo;
  112. int patientSex;
  113. String? creatorName;
  114. String? deviceName;
  115. RecordStatusEnum recordStatus;
  116. List<PatientInfoExt >? patientInfoExtList;
  117. DiagnosisStatusEnum diagnosisStatus;
  118. List<DiagnosisInfoDTO >? diagnosisInfos;
  119. QueryRecordResult({
  120. this.createTime,
  121. this.deptName,
  122. this.patientName,
  123. this.patientAge,
  124. this.patientAgeInfo,
  125. this.patientSex = 0,
  126. this.creatorName,
  127. this.deviceName,
  128. this.recordStatus = RecordStatusEnum.NotScanned,
  129. this.patientInfoExtList,
  130. this.diagnosisStatus = DiagnosisStatusEnum.NotRequired,
  131. this.diagnosisInfos,
  132. });
  133. factory QueryRecordResult.fromJson(Map<String, dynamic> map) {
  134. return QueryRecordResult(
  135. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  136. deptName: map['DeptName'],
  137. patientName: map['PatientName'],
  138. patientAge: map['PatientAge'],
  139. patientAgeInfo: map['PatientAgeInfo'] != null ? (map['PatientAgeInfo'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  140. patientSex: map['PatientSex'],
  141. creatorName: map['CreatorName'],
  142. deviceName: map['DeviceName'],
  143. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  144. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  145. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  146. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  147. );
  148. }
  149. Map<String, dynamic> toJson() {
  150. final map = Map<String, dynamic>();
  151. if(createTime != null)
  152. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  153. if(deptName != null)
  154. map['DeptName'] = deptName;
  155. if(patientName != null)
  156. map['PatientName'] = patientName;
  157. if(patientAge != null)
  158. map['PatientAge'] = patientAge;
  159. if(patientAgeInfo != null)
  160. map['PatientAgeInfo'] = patientAgeInfo;
  161. map['PatientSex'] = patientSex;
  162. if(creatorName != null)
  163. map['CreatorName'] = creatorName;
  164. if(deviceName != null)
  165. map['DeviceName'] = deviceName;
  166. map['RecordStatus'] = recordStatus.index;
  167. if(patientInfoExtList != null)
  168. map['PatientInfoExtList'] = patientInfoExtList;
  169. map['DiagnosisStatus'] = diagnosisStatus.index;
  170. if(diagnosisInfos != null)
  171. map['DiagnosisInfos'] = diagnosisInfos;
  172. return map;
  173. }
  174. }
  175. class QueryRecordRequest extends TokenRequest{
  176. String? recordCode;
  177. QueryRecordRequest({
  178. this.recordCode,
  179. String? token,
  180. }) : super(
  181. token: token,
  182. );
  183. factory QueryRecordRequest.fromJson(Map<String, dynamic> map) {
  184. return QueryRecordRequest(
  185. recordCode: map['RecordCode'],
  186. token: map['Token'],
  187. );
  188. }
  189. Map<String, dynamic> toJson() {
  190. final map = super.toJson();
  191. if(recordCode != null)
  192. map['RecordCode'] = recordCode;
  193. return map;
  194. }
  195. }
  196. class ProcessRecordDataResult {
  197. List<DataItemDTO >? content;
  198. ProcessRecordDataResult({
  199. this.content,
  200. });
  201. factory ProcessRecordDataResult.fromJson(Map<String, dynamic> map) {
  202. return ProcessRecordDataResult(
  203. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  204. );
  205. }
  206. Map<String, dynamic> toJson() {
  207. final map = Map<String, dynamic>();
  208. if(content != null)
  209. map['Content'] = content;
  210. return map;
  211. }
  212. }
  213. enum AnimalSpeciesEnum {
  214. Bovine,
  215. Canidae,
  216. Equidae,
  217. Felidae,
  218. Caprinae,
  219. Suidae,
  220. }
  221. class ProcessRecordDataRequest extends TokenRequest{
  222. String? methodName;
  223. List<DataItemDTO >? content;
  224. OrganizationPatientTypeEnum patientType;
  225. AnimalSpeciesEnum speciesEnum;
  226. ProcessRecordDataRequest({
  227. this.methodName,
  228. this.content,
  229. this.patientType = OrganizationPatientTypeEnum.Person,
  230. this.speciesEnum = AnimalSpeciesEnum.Bovine,
  231. String? token,
  232. }) : super(
  233. token: token,
  234. );
  235. factory ProcessRecordDataRequest.fromJson(Map<String, dynamic> map) {
  236. return ProcessRecordDataRequest(
  237. methodName: map['MethodName'],
  238. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  239. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  240. speciesEnum: AnimalSpeciesEnum.values.firstWhere((e) => e.index == map['SpeciesEnum']),
  241. token: map['Token'],
  242. );
  243. }
  244. Map<String, dynamic> toJson() {
  245. final map = super.toJson();
  246. if(methodName != null)
  247. map['MethodName'] = methodName;
  248. if(content != null)
  249. map['Content'] = content;
  250. map['PatientType'] = patientType.index;
  251. map['SpeciesEnum'] = speciesEnum.index;
  252. return map;
  253. }
  254. }
  255. class RelevanceRecordRequest extends TokenRequest{
  256. String? examCode;
  257. String? rservationCode;
  258. RelevanceRecordRequest({
  259. this.examCode,
  260. this.rservationCode,
  261. String? token,
  262. }) : super(
  263. token: token,
  264. );
  265. factory RelevanceRecordRequest.fromJson(Map<String, dynamic> map) {
  266. return RelevanceRecordRequest(
  267. examCode: map['ExamCode'],
  268. rservationCode: map['RservationCode'],
  269. token: map['Token'],
  270. );
  271. }
  272. Map<String, dynamic> toJson() {
  273. final map = super.toJson();
  274. if(examCode != null)
  275. map['ExamCode'] = examCode;
  276. if(rservationCode != null)
  277. map['RservationCode'] = rservationCode;
  278. return map;
  279. }
  280. }
  281. class FinishRecordRequest extends TokenRequest{
  282. String? recordCode;
  283. FinishRecordRequest({
  284. this.recordCode,
  285. String? token,
  286. }) : super(
  287. token: token,
  288. );
  289. factory FinishRecordRequest.fromJson(Map<String, dynamic> map) {
  290. return FinishRecordRequest(
  291. recordCode: map['RecordCode'],
  292. token: map['Token'],
  293. );
  294. }
  295. Map<String, dynamic> toJson() {
  296. final map = super.toJson();
  297. if(recordCode != null)
  298. map['RecordCode'] = recordCode;
  299. return map;
  300. }
  301. }
  302. class AddRemedicalMeasuredInfoDTO {
  303. String? remedicalCode;
  304. int frameIndex;
  305. String? measuredFileToken;
  306. String? previewFileToken;
  307. String? measuredData;
  308. AddRemedicalMeasuredInfoDTO({
  309. this.remedicalCode,
  310. this.frameIndex = 0,
  311. this.measuredFileToken,
  312. this.previewFileToken,
  313. this.measuredData,
  314. });
  315. factory AddRemedicalMeasuredInfoDTO.fromJson(Map<String, dynamic> map) {
  316. return AddRemedicalMeasuredInfoDTO(
  317. remedicalCode: map['RemedicalCode'],
  318. frameIndex: map['FrameIndex'],
  319. measuredFileToken: map['MeasuredFileToken'],
  320. previewFileToken: map['PreviewFileToken'],
  321. measuredData: map['MeasuredData'],
  322. );
  323. }
  324. Map<String, dynamic> toJson() {
  325. final map = Map<String, dynamic>();
  326. if(remedicalCode != null)
  327. map['RemedicalCode'] = remedicalCode;
  328. map['FrameIndex'] = frameIndex;
  329. if(measuredFileToken != null)
  330. map['MeasuredFileToken'] = measuredFileToken;
  331. if(previewFileToken != null)
  332. map['PreviewFileToken'] = previewFileToken;
  333. if(measuredData != null)
  334. map['MeasuredData'] = measuredData;
  335. return map;
  336. }
  337. }
  338. class AddRemedicalMeasuredInfoRequest extends TokenRequest{
  339. String? recordCode;
  340. List<AddRemedicalMeasuredInfoDTO >? remedicalMeasuredInfos;
  341. AddRemedicalMeasuredInfoRequest({
  342. this.recordCode,
  343. this.remedicalMeasuredInfos,
  344. String? token,
  345. }) : super(
  346. token: token,
  347. );
  348. factory AddRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  349. return AddRemedicalMeasuredInfoRequest(
  350. recordCode: map['RecordCode'],
  351. remedicalMeasuredInfos: map['RemedicalMeasuredInfos'] != null ? (map['RemedicalMeasuredInfos'] as List).map((e)=>AddRemedicalMeasuredInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  352. token: map['Token'],
  353. );
  354. }
  355. Map<String, dynamic> toJson() {
  356. final map = super.toJson();
  357. if(recordCode != null)
  358. map['RecordCode'] = recordCode;
  359. if(remedicalMeasuredInfos != null)
  360. map['RemedicalMeasuredInfos'] = remedicalMeasuredInfos;
  361. return map;
  362. }
  363. }
  364. class RemedicalMeasuredInfoDTO extends BaseDTO{
  365. String? remedicalMeasuredInfoCode;
  366. String? userCode;
  367. String? recordCode;
  368. String? remedicalCode;
  369. int frameIndex;
  370. String? measuredFileToken;
  371. String? previewFileToken;
  372. String? measuredData;
  373. RemedicalMeasuredInfoDTO({
  374. this.remedicalMeasuredInfoCode,
  375. this.userCode,
  376. this.recordCode,
  377. this.remedicalCode,
  378. this.frameIndex = 0,
  379. this.measuredFileToken,
  380. this.previewFileToken,
  381. this.measuredData,
  382. DateTime? createTime,
  383. DateTime? updateTime,
  384. }) : super(
  385. createTime: createTime,
  386. updateTime: updateTime,
  387. );
  388. factory RemedicalMeasuredInfoDTO.fromJson(Map<String, dynamic> map) {
  389. return RemedicalMeasuredInfoDTO(
  390. remedicalMeasuredInfoCode: map['RemedicalMeasuredInfoCode'],
  391. userCode: map['UserCode'],
  392. recordCode: map['RecordCode'],
  393. remedicalCode: map['RemedicalCode'],
  394. frameIndex: map['FrameIndex'],
  395. measuredFileToken: map['MeasuredFileToken'],
  396. previewFileToken: map['PreviewFileToken'],
  397. measuredData: map['MeasuredData'],
  398. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  399. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  400. );
  401. }
  402. Map<String, dynamic> toJson() {
  403. final map = super.toJson();
  404. if(remedicalMeasuredInfoCode != null)
  405. map['RemedicalMeasuredInfoCode'] = remedicalMeasuredInfoCode;
  406. if(userCode != null)
  407. map['UserCode'] = userCode;
  408. if(recordCode != null)
  409. map['RecordCode'] = recordCode;
  410. if(remedicalCode != null)
  411. map['RemedicalCode'] = remedicalCode;
  412. map['FrameIndex'] = frameIndex;
  413. if(measuredFileToken != null)
  414. map['MeasuredFileToken'] = measuredFileToken;
  415. if(previewFileToken != null)
  416. map['PreviewFileToken'] = previewFileToken;
  417. if(measuredData != null)
  418. map['MeasuredData'] = measuredData;
  419. return map;
  420. }
  421. }
  422. class FindRemedicalMeasuredInfoRequest extends TokenRequest{
  423. String? recordCode;
  424. FindRemedicalMeasuredInfoRequest({
  425. this.recordCode,
  426. String? token,
  427. }) : super(
  428. token: token,
  429. );
  430. factory FindRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  431. return FindRemedicalMeasuredInfoRequest(
  432. recordCode: map['RecordCode'],
  433. token: map['Token'],
  434. );
  435. }
  436. Map<String, dynamic> toJson() {
  437. final map = super.toJson();
  438. if(recordCode != null)
  439. map['RecordCode'] = recordCode;
  440. return map;
  441. }
  442. }