recordInfo.m.dart 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. import 'liveConsultation.m.dart';
  2. import 'patient.m.dart';
  3. import 'notification.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. String? displayName;
  116. RecordStatusEnum recordStatus;
  117. List<PatientInfoExt >? patientInfoExtList;
  118. DiagnosisStatusEnum diagnosisStatus;
  119. List<DiagnosisInfoDTO >? diagnosisInfos;
  120. bool isCollecting;
  121. DateTime? startCollectingTime;
  122. QueryRecordResult({
  123. this.createTime,
  124. this.deptName,
  125. this.patientName,
  126. this.patientAge,
  127. this.patientAgeInfo,
  128. this.patientSex = 0,
  129. this.creatorName,
  130. this.deviceName,
  131. this.displayName,
  132. this.recordStatus = RecordStatusEnum.NotScanned,
  133. this.patientInfoExtList,
  134. this.diagnosisStatus = DiagnosisStatusEnum.NotRequired,
  135. this.diagnosisInfos,
  136. this.isCollecting = false,
  137. this.startCollectingTime,
  138. });
  139. factory QueryRecordResult.fromJson(Map<String, dynamic> map) {
  140. return QueryRecordResult(
  141. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  142. deptName: map['DeptName'],
  143. patientName: map['PatientName'],
  144. patientAge: map['PatientAge'],
  145. patientAgeInfo: map['PatientAgeInfo'] != null ? (map['PatientAgeInfo'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  146. patientSex: map['PatientSex'],
  147. creatorName: map['CreatorName'],
  148. deviceName: map['DeviceName'],
  149. displayName: map['DisplayName'],
  150. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  151. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  152. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  153. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  154. isCollecting: map['IsCollecting'],
  155. startCollectingTime: map['StartCollectingTime'] != null ? DateTime.parse(map['StartCollectingTime']) : null,
  156. );
  157. }
  158. Map<String, dynamic> toJson() {
  159. final map = Map<String, dynamic>();
  160. if(createTime != null)
  161. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  162. if(deptName != null)
  163. map['DeptName'] = deptName;
  164. if(patientName != null)
  165. map['PatientName'] = patientName;
  166. if(patientAge != null)
  167. map['PatientAge'] = patientAge;
  168. if(patientAgeInfo != null)
  169. map['PatientAgeInfo'] = patientAgeInfo;
  170. map['PatientSex'] = patientSex;
  171. if(creatorName != null)
  172. map['CreatorName'] = creatorName;
  173. if(deviceName != null)
  174. map['DeviceName'] = deviceName;
  175. if(displayName != null)
  176. map['DisplayName'] = displayName;
  177. map['RecordStatus'] = recordStatus.index;
  178. if(patientInfoExtList != null)
  179. map['PatientInfoExtList'] = patientInfoExtList;
  180. map['DiagnosisStatus'] = diagnosisStatus.index;
  181. if(diagnosisInfos != null)
  182. map['DiagnosisInfos'] = diagnosisInfos;
  183. map['IsCollecting'] = isCollecting;
  184. if(startCollectingTime != null)
  185. map['StartCollectingTime'] = JsonRpcUtils.dateFormat(startCollectingTime!);
  186. return map;
  187. }
  188. }
  189. class QueryRecordRequest extends TokenRequest{
  190. String? recordCode;
  191. QueryRecordRequest({
  192. this.recordCode,
  193. String? token,
  194. }) : super(
  195. token: token,
  196. );
  197. factory QueryRecordRequest.fromJson(Map<String, dynamic> map) {
  198. return QueryRecordRequest(
  199. recordCode: map['RecordCode'],
  200. token: map['Token'],
  201. );
  202. }
  203. Map<String, dynamic> toJson() {
  204. final map = super.toJson();
  205. if(recordCode != null)
  206. map['RecordCode'] = recordCode;
  207. return map;
  208. }
  209. }
  210. class ProcessRecordDataResult {
  211. List<DataItemDTO >? content;
  212. ProcessRecordDataResult({
  213. this.content,
  214. });
  215. factory ProcessRecordDataResult.fromJson(Map<String, dynamic> map) {
  216. return ProcessRecordDataResult(
  217. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  218. );
  219. }
  220. Map<String, dynamic> toJson() {
  221. final map = Map<String, dynamic>();
  222. if(content != null)
  223. map['Content'] = content;
  224. return map;
  225. }
  226. }
  227. enum AnimalSpeciesEnum {
  228. Bovine,
  229. Canidae,
  230. Equidae,
  231. Felidae,
  232. Caprinae,
  233. Suidae,
  234. }
  235. class ProcessRecordDataRequest extends TokenRequest{
  236. String? methodName;
  237. List<DataItemDTO >? content;
  238. OrganizationPatientTypeEnum patientType;
  239. AnimalSpeciesEnum speciesEnum;
  240. ProcessRecordDataRequest({
  241. this.methodName,
  242. this.content,
  243. this.patientType = OrganizationPatientTypeEnum.Person,
  244. this.speciesEnum = AnimalSpeciesEnum.Bovine,
  245. String? token,
  246. }) : super(
  247. token: token,
  248. );
  249. factory ProcessRecordDataRequest.fromJson(Map<String, dynamic> map) {
  250. return ProcessRecordDataRequest(
  251. methodName: map['MethodName'],
  252. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  253. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  254. speciesEnum: AnimalSpeciesEnum.values.firstWhere((e) => e.index == map['SpeciesEnum']),
  255. token: map['Token'],
  256. );
  257. }
  258. Map<String, dynamic> toJson() {
  259. final map = super.toJson();
  260. if(methodName != null)
  261. map['MethodName'] = methodName;
  262. if(content != null)
  263. map['Content'] = content;
  264. map['PatientType'] = patientType.index;
  265. map['SpeciesEnum'] = speciesEnum.index;
  266. return map;
  267. }
  268. }
  269. class RelevanceRecordRequest extends TokenRequest{
  270. String? examCode;
  271. String? rservationCode;
  272. RelevanceRecordRequest({
  273. this.examCode,
  274. this.rservationCode,
  275. String? token,
  276. }) : super(
  277. token: token,
  278. );
  279. factory RelevanceRecordRequest.fromJson(Map<String, dynamic> map) {
  280. return RelevanceRecordRequest(
  281. examCode: map['ExamCode'],
  282. rservationCode: map['RservationCode'],
  283. token: map['Token'],
  284. );
  285. }
  286. Map<String, dynamic> toJson() {
  287. final map = super.toJson();
  288. if(examCode != null)
  289. map['ExamCode'] = examCode;
  290. if(rservationCode != null)
  291. map['RservationCode'] = rservationCode;
  292. return map;
  293. }
  294. }
  295. class FinishRecordRequest extends TokenRequest{
  296. String? recordCode;
  297. FinishRecordRequest({
  298. this.recordCode,
  299. String? token,
  300. }) : super(
  301. token: token,
  302. );
  303. factory FinishRecordRequest.fromJson(Map<String, dynamic> map) {
  304. return FinishRecordRequest(
  305. recordCode: map['RecordCode'],
  306. token: map['Token'],
  307. );
  308. }
  309. Map<String, dynamic> toJson() {
  310. final map = super.toJson();
  311. if(recordCode != null)
  312. map['RecordCode'] = recordCode;
  313. return map;
  314. }
  315. }
  316. class AddRemedicalMeasuredInfoDTO {
  317. String? remedicalCode;
  318. int frameIndex;
  319. String? measuredFileToken;
  320. String? previewFileToken;
  321. String? measuredData;
  322. AddRemedicalMeasuredInfoDTO({
  323. this.remedicalCode,
  324. this.frameIndex = 0,
  325. this.measuredFileToken,
  326. this.previewFileToken,
  327. this.measuredData,
  328. });
  329. factory AddRemedicalMeasuredInfoDTO.fromJson(Map<String, dynamic> map) {
  330. return AddRemedicalMeasuredInfoDTO(
  331. remedicalCode: map['RemedicalCode'],
  332. frameIndex: map['FrameIndex'],
  333. measuredFileToken: map['MeasuredFileToken'],
  334. previewFileToken: map['PreviewFileToken'],
  335. measuredData: map['MeasuredData'],
  336. );
  337. }
  338. Map<String, dynamic> toJson() {
  339. final map = Map<String, dynamic>();
  340. if(remedicalCode != null)
  341. map['RemedicalCode'] = remedicalCode;
  342. map['FrameIndex'] = frameIndex;
  343. if(measuredFileToken != null)
  344. map['MeasuredFileToken'] = measuredFileToken;
  345. if(previewFileToken != null)
  346. map['PreviewFileToken'] = previewFileToken;
  347. if(measuredData != null)
  348. map['MeasuredData'] = measuredData;
  349. return map;
  350. }
  351. }
  352. class AddRemedicalMeasuredInfoRequest extends TokenRequest{
  353. BusinessTypeEnum businessType;
  354. String? recordCode;
  355. List<AddRemedicalMeasuredInfoDTO >? remedicalMeasuredInfos;
  356. AddRemedicalMeasuredInfoRequest({
  357. this.businessType = BusinessTypeEnum.RemoteDiagnosis,
  358. this.recordCode,
  359. this.remedicalMeasuredInfos,
  360. String? token,
  361. }) : super(
  362. token: token,
  363. );
  364. factory AddRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  365. return AddRemedicalMeasuredInfoRequest(
  366. businessType: BusinessTypeEnum.values.firstWhere((e) => e.index == map['BusinessType']),
  367. recordCode: map['RecordCode'],
  368. remedicalMeasuredInfos: map['RemedicalMeasuredInfos'] != null ? (map['RemedicalMeasuredInfos'] as List).map((e)=>AddRemedicalMeasuredInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  369. token: map['Token'],
  370. );
  371. }
  372. Map<String, dynamic> toJson() {
  373. final map = super.toJson();
  374. map['BusinessType'] = businessType.index;
  375. if(recordCode != null)
  376. map['RecordCode'] = recordCode;
  377. if(remedicalMeasuredInfos != null)
  378. map['RemedicalMeasuredInfos'] = remedicalMeasuredInfos;
  379. return map;
  380. }
  381. }
  382. class FindRemedicalMeasuredInfoRequest extends TokenRequest{
  383. BusinessTypeEnum businessType;
  384. String? recordCode;
  385. FindRemedicalMeasuredInfoRequest({
  386. this.businessType = BusinessTypeEnum.RemoteDiagnosis,
  387. this.recordCode,
  388. String? token,
  389. }) : super(
  390. token: token,
  391. );
  392. factory FindRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  393. return FindRemedicalMeasuredInfoRequest(
  394. businessType: BusinessTypeEnum.values.firstWhere((e) => e.index == map['BusinessType']),
  395. recordCode: map['RecordCode'],
  396. token: map['Token'],
  397. );
  398. }
  399. Map<String, dynamic> toJson() {
  400. final map = super.toJson();
  401. map['BusinessType'] = businessType.index;
  402. if(recordCode != null)
  403. map['RecordCode'] = recordCode;
  404. return map;
  405. }
  406. }
  407. class CheckCollectingImgRequest extends TokenRequest{
  408. String? deviceCode;
  409. CheckCollectingImgRequest({
  410. this.deviceCode,
  411. String? token,
  412. }) : super(
  413. token: token,
  414. );
  415. factory CheckCollectingImgRequest.fromJson(Map<String, dynamic> map) {
  416. return CheckCollectingImgRequest(
  417. deviceCode: map['DeviceCode'],
  418. token: map['Token'],
  419. );
  420. }
  421. Map<String, dynamic> toJson() {
  422. final map = super.toJson();
  423. if(deviceCode != null)
  424. map['DeviceCode'] = deviceCode;
  425. return map;
  426. }
  427. }
  428. class StartCollectingImgRequest extends TokenRequest{
  429. String? recordCode;
  430. StartCollectingImgRequest({
  431. this.recordCode,
  432. String? token,
  433. }) : super(
  434. token: token,
  435. );
  436. factory StartCollectingImgRequest.fromJson(Map<String, dynamic> map) {
  437. return StartCollectingImgRequest(
  438. recordCode: map['RecordCode'],
  439. token: map['Token'],
  440. );
  441. }
  442. Map<String, dynamic> toJson() {
  443. final map = super.toJson();
  444. if(recordCode != null)
  445. map['RecordCode'] = recordCode;
  446. return map;
  447. }
  448. }