recordInfo.m.dart 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  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. }
  23. if (content != null) {
  24. map['Content'] = content;
  25. }
  26. return map;
  27. }
  28. }
  29. class CreateRecordRequest extends TokenRequest{
  30. String? patientCode;
  31. String? deviceCode;
  32. List<DataItemDTO>? patientDatas;
  33. List<PatientInfoExt>? patientInfoExtList;
  34. CreateRecordRequest({
  35. this.patientCode,
  36. this.deviceCode,
  37. this.patientDatas,
  38. this.patientInfoExtList,
  39. String? token,
  40. }) : super(
  41. token: token,
  42. );
  43. factory CreateRecordRequest.fromJson(Map<String, dynamic> map) {
  44. return CreateRecordRequest(
  45. patientCode: map['PatientCode'],
  46. deviceCode: map['DeviceCode'],
  47. patientDatas: map['PatientDatas'] != null ? (map['PatientDatas'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  48. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  49. token: map['Token'],
  50. );
  51. }
  52. Map<String, dynamic> toJson() {
  53. final map = super.toJson();
  54. if (patientCode != null)
  55. map['PatientCode'] = patientCode;
  56. if (deviceCode != null)
  57. map['DeviceCode'] = deviceCode;
  58. if (patientDatas != null)
  59. map['PatientDatas'] = patientDatas;
  60. if (patientInfoExtList != null)
  61. map['PatientInfoExtList'] = patientInfoExtList;
  62. return map;
  63. }
  64. }
  65. enum QueryRecordStatusEnum {
  66. All,
  67. NotScanned,
  68. Uploaded,
  69. NotReport,
  70. Completed,
  71. NotCompleted,
  72. }
  73. enum QueryRecordCreateTypeEnum {
  74. All,
  75. Reservation,
  76. Normal,
  77. }
  78. class GetRecordsPageRequest extends PageRequest{
  79. String? patientCode;
  80. QueryRecordStatusEnum queryRecordStatus;
  81. QueryRecordCreateTypeEnum queryRecordCreateType;
  82. GetRecordsPageRequest({
  83. this.patientCode,
  84. this.queryRecordStatus = QueryRecordStatusEnum.All,
  85. this.queryRecordCreateType = QueryRecordCreateTypeEnum.All,
  86. int pageIndex = 0,
  87. int pageSize = 0,
  88. String? token,
  89. }) : super(
  90. pageIndex: pageIndex,
  91. pageSize: pageSize,
  92. token: token,
  93. );
  94. factory GetRecordsPageRequest.fromJson(Map<String, dynamic> map) {
  95. return GetRecordsPageRequest(
  96. patientCode: map['PatientCode'],
  97. queryRecordStatus: QueryRecordStatusEnum.values.firstWhere((e) => e.index == map['QueryRecordStatus']),
  98. queryRecordCreateType: QueryRecordCreateTypeEnum.values.firstWhere((e) => e.index == map['QueryRecordCreateType']),
  99. pageIndex: map['PageIndex'],
  100. pageSize: map['PageSize'],
  101. token: map['Token'],
  102. );
  103. }
  104. Map<String, dynamic> toJson() {
  105. final map = super.toJson();
  106. if (patientCode != null)
  107. map['PatientCode'] = patientCode;
  108. map['QueryRecordStatus'] = queryRecordStatus.index;
  109. map['QueryRecordCreateType'] = queryRecordCreateType.index;
  110. return map;
  111. }
  112. }
  113. class QueryRecordResult {
  114. DateTime? createTime;
  115. String? deptName;
  116. String? patientName;
  117. String? patientAge;
  118. List<DataItemDTO>? patientAgeInfo;
  119. int patientSex;
  120. String? creatorName;
  121. String? deviceName;
  122. String? displayName;
  123. RecordStatusEnum recordStatus;
  124. List<PatientInfoExt>? patientInfoExtList;
  125. DiagnosisStatusEnum diagnosisStatus;
  126. List<DiagnosisInfoDTO>? diagnosisInfos;
  127. bool isCollecting;
  128. DateTime? startCollectingTime;
  129. String? customDoctor;
  130. String? customOrganzation;
  131. String? equipmentSN;
  132. String? deviceOrganzationName;
  133. QueryRecordResult({
  134. this.createTime,
  135. this.deptName,
  136. this.patientName,
  137. this.patientAge,
  138. this.patientAgeInfo,
  139. this.patientSex = 0,
  140. this.creatorName,
  141. this.deviceName,
  142. this.displayName,
  143. this.recordStatus = RecordStatusEnum.NotScanned,
  144. this.patientInfoExtList,
  145. this.diagnosisStatus = DiagnosisStatusEnum.NotRequired,
  146. this.diagnosisInfos,
  147. this.isCollecting = false,
  148. this.startCollectingTime,
  149. this.customDoctor,
  150. this.customOrganzation,
  151. this.equipmentSN,
  152. this.deviceOrganzationName,
  153. });
  154. factory QueryRecordResult.fromJson(Map<String, dynamic> map) {
  155. return QueryRecordResult(
  156. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  157. deptName: map['DeptName'],
  158. patientName: map['PatientName'],
  159. patientAge: map['PatientAge'],
  160. patientAgeInfo: map['PatientAgeInfo'] != null ? (map['PatientAgeInfo'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  161. patientSex: map['PatientSex'],
  162. creatorName: map['CreatorName'],
  163. deviceName: map['DeviceName'],
  164. displayName: map['DisplayName'],
  165. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  166. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  167. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  168. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  169. isCollecting: map['IsCollecting'],
  170. startCollectingTime: map['StartCollectingTime'] != null ? DateTime.parse(map['StartCollectingTime']) : null,
  171. customDoctor: map['CustomDoctor'],
  172. customOrganzation: map['CustomOrganzation'],
  173. equipmentSN: map['EquipmentSN'],
  174. deviceOrganzationName: map['DeviceOrganzationName'],
  175. );
  176. }
  177. Map<String, dynamic> toJson() {
  178. final map = Map<String, dynamic>();
  179. if (createTime != null) {
  180. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  181. }
  182. if (deptName != null) {
  183. map['DeptName'] = deptName;
  184. }
  185. if (patientName != null) {
  186. map['PatientName'] = patientName;
  187. }
  188. if (patientAge != null) {
  189. map['PatientAge'] = patientAge;
  190. }
  191. if (patientAgeInfo != null) {
  192. map['PatientAgeInfo'] = patientAgeInfo;
  193. }
  194. map['PatientSex'] = patientSex;
  195. if (creatorName != null) {
  196. map['CreatorName'] = creatorName;
  197. }
  198. if (deviceName != null) {
  199. map['DeviceName'] = deviceName;
  200. }
  201. if (displayName != null) {
  202. map['DisplayName'] = displayName;
  203. }
  204. map['RecordStatus'] = recordStatus.index;
  205. if (patientInfoExtList != null) {
  206. map['PatientInfoExtList'] = patientInfoExtList;
  207. }
  208. map['DiagnosisStatus'] = diagnosisStatus.index;
  209. if (diagnosisInfos != null) {
  210. map['DiagnosisInfos'] = diagnosisInfos;
  211. }
  212. map['IsCollecting'] = isCollecting;
  213. if (startCollectingTime != null) {
  214. map['StartCollectingTime'] = JsonRpcUtils.dateFormat(startCollectingTime!);
  215. }
  216. if (customDoctor != null) {
  217. map['CustomDoctor'] = customDoctor;
  218. }
  219. if (customOrganzation != null) {
  220. map['CustomOrganzation'] = customOrganzation;
  221. }
  222. if (equipmentSN != null) {
  223. map['EquipmentSN'] = equipmentSN;
  224. }
  225. if (deviceOrganzationName != null) {
  226. map['DeviceOrganzationName'] = deviceOrganzationName;
  227. }
  228. return map;
  229. }
  230. }
  231. class QueryRecordRequest extends TokenRequest{
  232. String? recordCode;
  233. QueryRecordRequest({
  234. this.recordCode,
  235. String? token,
  236. }) : super(
  237. token: token,
  238. );
  239. factory QueryRecordRequest.fromJson(Map<String, dynamic> map) {
  240. return QueryRecordRequest(
  241. recordCode: map['RecordCode'],
  242. token: map['Token'],
  243. );
  244. }
  245. Map<String, dynamic> toJson() {
  246. final map = super.toJson();
  247. if (recordCode != null)
  248. map['RecordCode'] = recordCode;
  249. return map;
  250. }
  251. }
  252. class ProcessRecordDataResult {
  253. List<DataItemDTO>? content;
  254. ProcessRecordDataResult({
  255. this.content,
  256. });
  257. factory ProcessRecordDataResult.fromJson(Map<String, dynamic> map) {
  258. return ProcessRecordDataResult(
  259. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  260. );
  261. }
  262. Map<String, dynamic> toJson() {
  263. final map = Map<String, dynamic>();
  264. if (content != null) {
  265. map['Content'] = content;
  266. }
  267. return map;
  268. }
  269. }
  270. enum AnimalSpeciesEnum {
  271. Bovine,
  272. Canidae,
  273. Equidae,
  274. Felidae,
  275. Caprinae,
  276. Suidae,
  277. }
  278. class ProcessRecordDataRequest extends TokenRequest{
  279. String? methodName;
  280. List<DataItemDTO>? content;
  281. OrganizationPatientTypeEnum patientType;
  282. AnimalSpeciesEnum speciesEnum;
  283. ProcessRecordDataRequest({
  284. this.methodName,
  285. this.content,
  286. this.patientType = OrganizationPatientTypeEnum.Person,
  287. this.speciesEnum = AnimalSpeciesEnum.Bovine,
  288. String? token,
  289. }) : super(
  290. token: token,
  291. );
  292. factory ProcessRecordDataRequest.fromJson(Map<String, dynamic> map) {
  293. return ProcessRecordDataRequest(
  294. methodName: map['MethodName'],
  295. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  296. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  297. speciesEnum: AnimalSpeciesEnum.values.firstWhere((e) => e.index == map['SpeciesEnum']),
  298. token: map['Token'],
  299. );
  300. }
  301. Map<String, dynamic> toJson() {
  302. final map = super.toJson();
  303. if (methodName != null)
  304. map['MethodName'] = methodName;
  305. if (content != null)
  306. map['Content'] = content;
  307. map['PatientType'] = patientType.index;
  308. map['SpeciesEnum'] = speciesEnum.index;
  309. return map;
  310. }
  311. }
  312. class RelevanceRecordRequest extends TokenRequest{
  313. String? examCode;
  314. String? rservationCode;
  315. RelevanceRecordRequest({
  316. this.examCode,
  317. this.rservationCode,
  318. String? token,
  319. }) : super(
  320. token: token,
  321. );
  322. factory RelevanceRecordRequest.fromJson(Map<String, dynamic> map) {
  323. return RelevanceRecordRequest(
  324. examCode: map['ExamCode'],
  325. rservationCode: map['RservationCode'],
  326. token: map['Token'],
  327. );
  328. }
  329. Map<String, dynamic> toJson() {
  330. final map = super.toJson();
  331. if (examCode != null)
  332. map['ExamCode'] = examCode;
  333. if (rservationCode != null)
  334. map['RservationCode'] = rservationCode;
  335. return map;
  336. }
  337. }
  338. class FinishRecordRequest extends TokenRequest{
  339. String? recordCode;
  340. FinishRecordRequest({
  341. this.recordCode,
  342. String? token,
  343. }) : super(
  344. token: token,
  345. );
  346. factory FinishRecordRequest.fromJson(Map<String, dynamic> map) {
  347. return FinishRecordRequest(
  348. recordCode: map['RecordCode'],
  349. token: map['Token'],
  350. );
  351. }
  352. Map<String, dynamic> toJson() {
  353. final map = super.toJson();
  354. if (recordCode != null)
  355. map['RecordCode'] = recordCode;
  356. return map;
  357. }
  358. }
  359. class AddRemedicalMeasuredInfoDTO {
  360. String? remedicalCode;
  361. int frameIndex;
  362. String? measuredFileToken;
  363. String? previewFileToken;
  364. String? measuredData;
  365. AddRemedicalMeasuredInfoDTO({
  366. this.remedicalCode,
  367. this.frameIndex = 0,
  368. this.measuredFileToken,
  369. this.previewFileToken,
  370. this.measuredData,
  371. });
  372. factory AddRemedicalMeasuredInfoDTO.fromJson(Map<String, dynamic> map) {
  373. return AddRemedicalMeasuredInfoDTO(
  374. remedicalCode: map['RemedicalCode'],
  375. frameIndex: map['FrameIndex'],
  376. measuredFileToken: map['MeasuredFileToken'],
  377. previewFileToken: map['PreviewFileToken'],
  378. measuredData: map['MeasuredData'],
  379. );
  380. }
  381. Map<String, dynamic> toJson() {
  382. final map = Map<String, dynamic>();
  383. if (remedicalCode != null) {
  384. map['RemedicalCode'] = remedicalCode;
  385. }
  386. map['FrameIndex'] = frameIndex;
  387. if (measuredFileToken != null) {
  388. map['MeasuredFileToken'] = measuredFileToken;
  389. }
  390. if (previewFileToken != null) {
  391. map['PreviewFileToken'] = previewFileToken;
  392. }
  393. if (measuredData != null) {
  394. map['MeasuredData'] = measuredData;
  395. }
  396. return map;
  397. }
  398. }
  399. class AddRemedicalMeasuredInfoRequest extends TokenRequest{
  400. BusinessTypeEnum businessType;
  401. String? recordCode;
  402. List<AddRemedicalMeasuredInfoDTO>? remedicalMeasuredInfos;
  403. AddRemedicalMeasuredInfoRequest({
  404. this.businessType = BusinessTypeEnum.RemoteDiagnosis,
  405. this.recordCode,
  406. this.remedicalMeasuredInfos,
  407. String? token,
  408. }) : super(
  409. token: token,
  410. );
  411. factory AddRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  412. return AddRemedicalMeasuredInfoRequest(
  413. businessType: BusinessTypeEnum.values.firstWhere((e) => e.index == map['BusinessType']),
  414. recordCode: map['RecordCode'],
  415. remedicalMeasuredInfos: map['RemedicalMeasuredInfos'] != null ? (map['RemedicalMeasuredInfos'] as List).map((e)=>AddRemedicalMeasuredInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  416. token: map['Token'],
  417. );
  418. }
  419. Map<String, dynamic> toJson() {
  420. final map = super.toJson();
  421. map['BusinessType'] = businessType.index;
  422. if (recordCode != null)
  423. map['RecordCode'] = recordCode;
  424. if (remedicalMeasuredInfos != null)
  425. map['RemedicalMeasuredInfos'] = remedicalMeasuredInfos;
  426. return map;
  427. }
  428. }
  429. class FindRemedicalMeasuredInfoRequest extends TokenRequest{
  430. BusinessTypeEnum businessType;
  431. String? recordCode;
  432. FindRemedicalMeasuredInfoRequest({
  433. this.businessType = BusinessTypeEnum.RemoteDiagnosis,
  434. this.recordCode,
  435. String? token,
  436. }) : super(
  437. token: token,
  438. );
  439. factory FindRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  440. return FindRemedicalMeasuredInfoRequest(
  441. businessType: BusinessTypeEnum.values.firstWhere((e) => e.index == map['BusinessType']),
  442. recordCode: map['RecordCode'],
  443. token: map['Token'],
  444. );
  445. }
  446. Map<String, dynamic> toJson() {
  447. final map = super.toJson();
  448. map['BusinessType'] = businessType.index;
  449. if (recordCode != null)
  450. map['RecordCode'] = recordCode;
  451. return map;
  452. }
  453. }
  454. class CheckCollectingImgRequest extends TokenRequest{
  455. String? deviceCode;
  456. CheckCollectingImgRequest({
  457. this.deviceCode,
  458. String? token,
  459. }) : super(
  460. token: token,
  461. );
  462. factory CheckCollectingImgRequest.fromJson(Map<String, dynamic> map) {
  463. return CheckCollectingImgRequest(
  464. deviceCode: map['DeviceCode'],
  465. token: map['Token'],
  466. );
  467. }
  468. Map<String, dynamic> toJson() {
  469. final map = super.toJson();
  470. if (deviceCode != null)
  471. map['DeviceCode'] = deviceCode;
  472. return map;
  473. }
  474. }
  475. class StartCollectingImgRequest extends TokenRequest{
  476. String? recordCode;
  477. StartCollectingImgRequest({
  478. this.recordCode,
  479. String? token,
  480. }) : super(
  481. token: token,
  482. );
  483. factory StartCollectingImgRequest.fromJson(Map<String, dynamic> map) {
  484. return StartCollectingImgRequest(
  485. recordCode: map['RecordCode'],
  486. token: map['Token'],
  487. );
  488. }
  489. Map<String, dynamic> toJson() {
  490. final map = super.toJson();
  491. if (recordCode != null)
  492. map['RecordCode'] = recordCode;
  493. return map;
  494. }
  495. }
  496. enum ReferralTypeEnum {
  497. Normal,
  498. ReferralIn,
  499. ReferralOut,
  500. }
  501. class SimpleRecordInfoDTO extends BaseDTO{
  502. String? recordCode;
  503. RecordStatusEnum recordStatus;
  504. ReferralTypeEnum referralType;
  505. String? patientCode;
  506. String? patientName;
  507. String? age;
  508. String? sex;
  509. String? devicePatientID;
  510. String? deviceCode;
  511. String? deviceName;
  512. String? rootOrganizationCode;
  513. String? rootOrganizationName;
  514. String? languge;
  515. bool canCreateReport;
  516. bool isCollecting;
  517. bool canCollcetImg;
  518. String? customDoctor;
  519. String? customOrganzation;
  520. String? equipmentSN;
  521. List<DiagnosisInfoDTO>? diagnosisInfos;
  522. SimpleRecordInfoDTO({
  523. this.recordCode,
  524. this.recordStatus = RecordStatusEnum.NotScanned,
  525. this.referralType = ReferralTypeEnum.Normal,
  526. this.patientCode,
  527. this.patientName,
  528. this.age,
  529. this.sex,
  530. this.devicePatientID,
  531. this.deviceCode,
  532. this.deviceName,
  533. this.rootOrganizationCode,
  534. this.rootOrganizationName,
  535. this.languge,
  536. this.canCreateReport = false,
  537. this.isCollecting = false,
  538. this.canCollcetImg = false,
  539. this.customDoctor,
  540. this.customOrganzation,
  541. this.equipmentSN,
  542. this.diagnosisInfos,
  543. DateTime? createTime,
  544. DateTime? updateTime,
  545. }) : super(
  546. createTime: createTime,
  547. updateTime: updateTime,
  548. );
  549. factory SimpleRecordInfoDTO.fromJson(Map<String, dynamic> map) {
  550. return SimpleRecordInfoDTO(
  551. recordCode: map['RecordCode'],
  552. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  553. referralType: ReferralTypeEnum.values.firstWhere((e) => e.index == map['ReferralType']),
  554. patientCode: map['PatientCode'],
  555. patientName: map['PatientName'],
  556. age: map['Age'],
  557. sex: map['Sex'],
  558. devicePatientID: map['DevicePatientID'],
  559. deviceCode: map['DeviceCode'],
  560. deviceName: map['DeviceName'],
  561. rootOrganizationCode: map['RootOrganizationCode'],
  562. rootOrganizationName: map['RootOrganizationName'],
  563. languge: map['Languge'],
  564. canCreateReport: map['CanCreateReport'],
  565. isCollecting: map['IsCollecting'],
  566. canCollcetImg: map['CanCollcetImg'],
  567. customDoctor: map['CustomDoctor'],
  568. customOrganzation: map['CustomOrganzation'],
  569. equipmentSN: map['EquipmentSN'],
  570. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  571. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  572. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  573. );
  574. }
  575. Map<String, dynamic> toJson() {
  576. final map = super.toJson();
  577. if (recordCode != null)
  578. map['RecordCode'] = recordCode;
  579. map['RecordStatus'] = recordStatus.index;
  580. map['ReferralType'] = referralType.index;
  581. if (patientCode != null)
  582. map['PatientCode'] = patientCode;
  583. if (patientName != null)
  584. map['PatientName'] = patientName;
  585. if (age != null)
  586. map['Age'] = age;
  587. if (sex != null)
  588. map['Sex'] = sex;
  589. if (devicePatientID != null)
  590. map['DevicePatientID'] = devicePatientID;
  591. if (deviceCode != null)
  592. map['DeviceCode'] = deviceCode;
  593. if (deviceName != null)
  594. map['DeviceName'] = deviceName;
  595. if (rootOrganizationCode != null)
  596. map['RootOrganizationCode'] = rootOrganizationCode;
  597. if (rootOrganizationName != null)
  598. map['RootOrganizationName'] = rootOrganizationName;
  599. if (languge != null)
  600. map['Languge'] = languge;
  601. map['CanCreateReport'] = canCreateReport;
  602. map['IsCollecting'] = isCollecting;
  603. map['CanCollcetImg'] = canCollcetImg;
  604. if (customDoctor != null)
  605. map['CustomDoctor'] = customDoctor;
  606. if (customOrganzation != null)
  607. map['CustomOrganzation'] = customOrganzation;
  608. if (equipmentSN != null)
  609. map['EquipmentSN'] = equipmentSN;
  610. if (diagnosisInfos != null)
  611. map['DiagnosisInfos'] = diagnosisInfos;
  612. return map;
  613. }
  614. }
  615. enum RecordQueryStateEnum {
  616. All,
  617. NotScanned,
  618. Uploaded,
  619. NotReport,
  620. Completed,
  621. }
  622. enum RecordProcessStateEnum {
  623. All,
  624. Wait,
  625. Done,
  626. ReferralOut,
  627. }
  628. class FindRecordPagesRequest extends PageRequest{
  629. List<String>? organizationCodes;
  630. List<String>? deviceCodes;
  631. RecordQueryStateEnum recordQueryState;
  632. RecordProcessStateEnum recordProcessState;
  633. String? language;
  634. String? keyWord;
  635. DateTime? startTime;
  636. DateTime? endTime;
  637. String? patientCode;
  638. FindRecordPagesRequest({
  639. this.organizationCodes,
  640. this.deviceCodes,
  641. this.recordQueryState = RecordQueryStateEnum.All,
  642. this.recordProcessState = RecordProcessStateEnum.All,
  643. this.language,
  644. this.keyWord,
  645. this.startTime,
  646. this.endTime,
  647. this.patientCode,
  648. int pageIndex = 0,
  649. int pageSize = 0,
  650. String? token,
  651. }) : super(
  652. pageIndex: pageIndex,
  653. pageSize: pageSize,
  654. token: token,
  655. );
  656. factory FindRecordPagesRequest.fromJson(Map<String, dynamic> map) {
  657. return FindRecordPagesRequest(
  658. organizationCodes: map['OrganizationCodes']?.cast<String>().toList(),
  659. deviceCodes: map['DeviceCodes']?.cast<String>().toList(),
  660. recordQueryState: RecordQueryStateEnum.values.firstWhere((e) => e.index == map['RecordQueryState']),
  661. recordProcessState: RecordProcessStateEnum.values.firstWhere((e) => e.index == map['RecordProcessState']),
  662. language: map['Language'],
  663. keyWord: map['KeyWord'],
  664. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  665. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  666. patientCode: map['PatientCode'],
  667. pageIndex: map['PageIndex'],
  668. pageSize: map['PageSize'],
  669. token: map['Token'],
  670. );
  671. }
  672. Map<String, dynamic> toJson() {
  673. final map = super.toJson();
  674. if (organizationCodes != null)
  675. map['OrganizationCodes'] = organizationCodes;
  676. if (deviceCodes != null)
  677. map['DeviceCodes'] = deviceCodes;
  678. map['RecordQueryState'] = recordQueryState.index;
  679. map['RecordProcessState'] = recordProcessState.index;
  680. if (language != null)
  681. map['Language'] = language;
  682. if (keyWord != null)
  683. map['KeyWord'] = keyWord;
  684. if (startTime != null)
  685. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  686. if (endTime != null)
  687. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  688. if (patientCode != null)
  689. map['PatientCode'] = patientCode;
  690. return map;
  691. }
  692. }
  693. class CreateRecordNewRequest extends TokenRequest{
  694. String? patientCode;
  695. List<DataItemDTO>? patientDatas;
  696. String? deviceCode;
  697. List<PatientInfoExt>? patientInfoExtList;
  698. CreateRecordNewRequest({
  699. this.patientCode,
  700. this.patientDatas,
  701. this.deviceCode,
  702. this.patientInfoExtList,
  703. String? token,
  704. }) : super(
  705. token: token,
  706. );
  707. factory CreateRecordNewRequest.fromJson(Map<String, dynamic> map) {
  708. return CreateRecordNewRequest(
  709. patientCode: map['PatientCode'],
  710. patientDatas: map['PatientDatas'] != null ? (map['PatientDatas'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  711. deviceCode: map['DeviceCode'],
  712. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  713. token: map['Token'],
  714. );
  715. }
  716. Map<String, dynamic> toJson() {
  717. final map = super.toJson();
  718. if (patientCode != null)
  719. map['PatientCode'] = patientCode;
  720. if (patientDatas != null)
  721. map['PatientDatas'] = patientDatas;
  722. if (deviceCode != null)
  723. map['DeviceCode'] = deviceCode;
  724. if (patientInfoExtList != null)
  725. map['PatientInfoExtList'] = patientInfoExtList;
  726. return map;
  727. }
  728. }
  729. class CreateReferralRecordNewRequest extends TokenRequest{
  730. String? recordCode;
  731. String? referralOrganizationCode;
  732. String? referralUserCode;
  733. String? subjectMatter;
  734. CreateReferralRecordNewRequest({
  735. this.recordCode,
  736. this.referralOrganizationCode,
  737. this.referralUserCode,
  738. this.subjectMatter,
  739. String? token,
  740. }) : super(
  741. token: token,
  742. );
  743. factory CreateReferralRecordNewRequest.fromJson(Map<String, dynamic> map) {
  744. return CreateReferralRecordNewRequest(
  745. recordCode: map['RecordCode'],
  746. referralOrganizationCode: map['ReferralOrganizationCode'],
  747. referralUserCode: map['ReferralUserCode'],
  748. subjectMatter: map['SubjectMatter'],
  749. token: map['Token'],
  750. );
  751. }
  752. Map<String, dynamic> toJson() {
  753. final map = super.toJson();
  754. if (recordCode != null)
  755. map['RecordCode'] = recordCode;
  756. if (referralOrganizationCode != null)
  757. map['ReferralOrganizationCode'] = referralOrganizationCode;
  758. if (referralUserCode != null)
  759. map['ReferralUserCode'] = referralUserCode;
  760. if (subjectMatter != null)
  761. map['SubjectMatter'] = subjectMatter;
  762. return map;
  763. }
  764. }
  765. class WithdrawReferralForRecordListRequest extends TokenRequest{
  766. String? recordCode;
  767. WithdrawReferralForRecordListRequest({
  768. this.recordCode,
  769. String? token,
  770. }) : super(
  771. token: token,
  772. );
  773. factory WithdrawReferralForRecordListRequest.fromJson(Map<String, dynamic> map) {
  774. return WithdrawReferralForRecordListRequest(
  775. recordCode: map['RecordCode'],
  776. token: map['Token'],
  777. );
  778. }
  779. Map<String, dynamic> toJson() {
  780. final map = super.toJson();
  781. if (recordCode != null)
  782. map['RecordCode'] = recordCode;
  783. return map;
  784. }
  785. }
  786. enum RecordReferralStatusEnum {
  787. ReferralIn,
  788. Processed,
  789. Withdrawn,
  790. }
  791. class ReferralData extends BaseDTO{
  792. String? patientName;
  793. String? code;
  794. String? recordCode;
  795. String? referralOutUserCode;
  796. String? referralOutOrganizationCode;
  797. String? referralInUserCode;
  798. String? referralInOrganizationCode;
  799. RecordReferralStatusEnum referralStatus;
  800. DateTime? referralTime;
  801. String? subjectMatter;
  802. ReferralData({
  803. this.patientName,
  804. this.code,
  805. this.recordCode,
  806. this.referralOutUserCode,
  807. this.referralOutOrganizationCode,
  808. this.referralInUserCode,
  809. this.referralInOrganizationCode,
  810. this.referralStatus = RecordReferralStatusEnum.ReferralIn,
  811. this.referralTime,
  812. this.subjectMatter,
  813. DateTime? createTime,
  814. DateTime? updateTime,
  815. }) : super(
  816. createTime: createTime,
  817. updateTime: updateTime,
  818. );
  819. factory ReferralData.fromJson(Map<String, dynamic> map) {
  820. return ReferralData(
  821. patientName: map['PatientName'],
  822. code: map['Code'],
  823. recordCode: map['RecordCode'],
  824. referralOutUserCode: map['ReferralOutUserCode'],
  825. referralOutOrganizationCode: map['ReferralOutOrganizationCode'],
  826. referralInUserCode: map['ReferralInUserCode'],
  827. referralInOrganizationCode: map['ReferralInOrganizationCode'],
  828. referralStatus: RecordReferralStatusEnum.values.firstWhere((e) => e.index == map['ReferralStatus']),
  829. referralTime: map['ReferralTime'] != null ? DateTime.parse(map['ReferralTime']) : null,
  830. subjectMatter: map['SubjectMatter'],
  831. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  832. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  833. );
  834. }
  835. Map<String, dynamic> toJson() {
  836. final map = super.toJson();
  837. if (patientName != null)
  838. map['PatientName'] = patientName;
  839. if (code != null)
  840. map['Code'] = code;
  841. if (recordCode != null)
  842. map['RecordCode'] = recordCode;
  843. if (referralOutUserCode != null)
  844. map['ReferralOutUserCode'] = referralOutUserCode;
  845. if (referralOutOrganizationCode != null)
  846. map['ReferralOutOrganizationCode'] = referralOutOrganizationCode;
  847. if (referralInUserCode != null)
  848. map['ReferralInUserCode'] = referralInUserCode;
  849. if (referralInOrganizationCode != null)
  850. map['ReferralInOrganizationCode'] = referralInOrganizationCode;
  851. map['ReferralStatus'] = referralStatus.index;
  852. if (referralTime != null)
  853. map['ReferralTime'] = JsonRpcUtils.dateFormat(referralTime!);
  854. if (subjectMatter != null)
  855. map['SubjectMatter'] = subjectMatter;
  856. return map;
  857. }
  858. }
  859. class ReferralHistoryDetail extends ReferralData{
  860. String? referralOutOrganizationName;
  861. String? referralOutUserName;
  862. String? referralInOrganizationName;
  863. String? referralInUserName;
  864. ReferralHistoryDetail({
  865. this.referralOutOrganizationName,
  866. this.referralOutUserName,
  867. this.referralInOrganizationName,
  868. this.referralInUserName,
  869. String? patientName,
  870. String? code,
  871. String? recordCode,
  872. String? referralOutUserCode,
  873. String? referralOutOrganizationCode,
  874. String? referralInUserCode,
  875. String? referralInOrganizationCode,
  876. RecordReferralStatusEnum referralStatus = RecordReferralStatusEnum.ReferralIn,
  877. DateTime? referralTime,
  878. String? subjectMatter,
  879. DateTime? createTime,
  880. DateTime? updateTime,
  881. }) : super(
  882. patientName: patientName,
  883. code: code,
  884. recordCode: recordCode,
  885. referralOutUserCode: referralOutUserCode,
  886. referralOutOrganizationCode: referralOutOrganizationCode,
  887. referralInUserCode: referralInUserCode,
  888. referralInOrganizationCode: referralInOrganizationCode,
  889. referralStatus: referralStatus,
  890. referralTime: referralTime,
  891. subjectMatter: subjectMatter,
  892. createTime: createTime,
  893. updateTime: updateTime,
  894. );
  895. factory ReferralHistoryDetail.fromJson(Map<String, dynamic> map) {
  896. return ReferralHistoryDetail(
  897. referralOutOrganizationName: map['ReferralOutOrganizationName'],
  898. referralOutUserName: map['ReferralOutUserName'],
  899. referralInOrganizationName: map['ReferralInOrganizationName'],
  900. referralInUserName: map['ReferralInUserName'],
  901. patientName: map['PatientName'],
  902. code: map['Code'],
  903. recordCode: map['RecordCode'],
  904. referralOutUserCode: map['ReferralOutUserCode'],
  905. referralOutOrganizationCode: map['ReferralOutOrganizationCode'],
  906. referralInUserCode: map['ReferralInUserCode'],
  907. referralInOrganizationCode: map['ReferralInOrganizationCode'],
  908. referralStatus: RecordReferralStatusEnum.values.firstWhere((e) => e.index == map['ReferralStatus']),
  909. referralTime: map['ReferralTime'] != null ? DateTime.parse(map['ReferralTime']) : null,
  910. subjectMatter: map['SubjectMatter'],
  911. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  912. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  913. );
  914. }
  915. Map<String, dynamic> toJson() {
  916. final map = super.toJson();
  917. if (referralOutOrganizationName != null)
  918. map['ReferralOutOrganizationName'] = referralOutOrganizationName;
  919. if (referralOutUserName != null)
  920. map['ReferralOutUserName'] = referralOutUserName;
  921. if (referralInOrganizationName != null)
  922. map['ReferralInOrganizationName'] = referralInOrganizationName;
  923. if (referralInUserName != null)
  924. map['ReferralInUserName'] = referralInUserName;
  925. return map;
  926. }
  927. }
  928. class FindReferralHistoryRequest extends TokenRequest{
  929. String? recordCode;
  930. String? languageCode;
  931. FindReferralHistoryRequest({
  932. this.recordCode,
  933. this.languageCode,
  934. String? token,
  935. }) : super(
  936. token: token,
  937. );
  938. factory FindReferralHistoryRequest.fromJson(Map<String, dynamic> map) {
  939. return FindReferralHistoryRequest(
  940. recordCode: map['RecordCode'],
  941. languageCode: map['LanguageCode'],
  942. token: map['Token'],
  943. );
  944. }
  945. Map<String, dynamic> toJson() {
  946. final map = super.toJson();
  947. if (recordCode != null)
  948. map['RecordCode'] = recordCode;
  949. if (languageCode != null)
  950. map['LanguageCode'] = languageCode;
  951. return map;
  952. }
  953. }