recordInfo.m.dart 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  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. }
  449. enum ReferralTypeEnum {
  450. Normal,
  451. ReferralIn,
  452. ReferralOut,
  453. }
  454. class SimpleRecordInfoDTO extends BaseDTO{
  455. String? recordCode;
  456. RecordStatusEnum recordStatus;
  457. ReferralTypeEnum referralType;
  458. String? patientCode;
  459. String? patientName;
  460. String? age;
  461. String? sex;
  462. String? devicePatientID;
  463. String? deviceCode;
  464. String? deviceName;
  465. String? rootOrganizationCode;
  466. String? rootOrganizationName;
  467. String? languge;
  468. SimpleRecordInfoDTO({
  469. this.recordCode,
  470. this.recordStatus = RecordStatusEnum.NotScanned,
  471. this.referralType = ReferralTypeEnum.Normal,
  472. this.patientCode,
  473. this.patientName,
  474. this.age,
  475. this.sex,
  476. this.devicePatientID,
  477. this.deviceCode,
  478. this.deviceName,
  479. this.rootOrganizationCode,
  480. this.rootOrganizationName,
  481. this.languge,
  482. DateTime? createTime,
  483. DateTime? updateTime,
  484. }) : super(
  485. createTime: createTime,
  486. updateTime: updateTime,
  487. );
  488. factory SimpleRecordInfoDTO.fromJson(Map<String, dynamic> map) {
  489. return SimpleRecordInfoDTO(
  490. recordCode: map['RecordCode'],
  491. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  492. referralType: ReferralTypeEnum.values.firstWhere((e) => e.index == map['ReferralType']),
  493. patientCode: map['PatientCode'],
  494. patientName: map['PatientName'],
  495. age: map['Age'],
  496. sex: map['Sex'],
  497. devicePatientID: map['DevicePatientID'],
  498. deviceCode: map['DeviceCode'],
  499. deviceName: map['DeviceName'],
  500. rootOrganizationCode: map['RootOrganizationCode'],
  501. rootOrganizationName: map['RootOrganizationName'],
  502. languge: map['Languge'],
  503. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  504. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  505. );
  506. }
  507. Map<String, dynamic> toJson() {
  508. final map = super.toJson();
  509. if(recordCode != null)
  510. map['RecordCode'] = recordCode;
  511. map['RecordStatus'] = recordStatus.index;
  512. map['ReferralType'] = referralType.index;
  513. if(patientCode != null)
  514. map['PatientCode'] = patientCode;
  515. if(patientName != null)
  516. map['PatientName'] = patientName;
  517. if(age != null)
  518. map['Age'] = age;
  519. if(sex != null)
  520. map['Sex'] = sex;
  521. if(devicePatientID != null)
  522. map['DevicePatientID'] = devicePatientID;
  523. if(deviceCode != null)
  524. map['DeviceCode'] = deviceCode;
  525. if(deviceName != null)
  526. map['DeviceName'] = deviceName;
  527. if(rootOrganizationCode != null)
  528. map['RootOrganizationCode'] = rootOrganizationCode;
  529. if(rootOrganizationName != null)
  530. map['RootOrganizationName'] = rootOrganizationName;
  531. if(languge != null)
  532. map['Languge'] = languge;
  533. return map;
  534. }
  535. }
  536. enum RecordQueryStateEnum {
  537. All,
  538. NotScanned,
  539. Uploaded,
  540. NotReport,
  541. Completed,
  542. }
  543. enum RecordProcessStateEnum {
  544. All,
  545. Wait,
  546. Done,
  547. ReferralOut,
  548. }
  549. class FindRecordPagesRequest extends PageRequest{
  550. List<String >? organizationCodes;
  551. List<String >? deviceCodes;
  552. RecordQueryStateEnum recordQueryState;
  553. RecordProcessStateEnum recordProcessState;
  554. String? language;
  555. String? keyWord;
  556. DateTime? startTime;
  557. DateTime? endTime;
  558. FindRecordPagesRequest({
  559. this.organizationCodes,
  560. this.deviceCodes,
  561. this.recordQueryState = RecordQueryStateEnum.All,
  562. this.recordProcessState = RecordProcessStateEnum.All,
  563. this.language,
  564. this.keyWord,
  565. this.startTime,
  566. this.endTime,
  567. int pageIndex = 0,
  568. int pageSize = 0,
  569. String? token,
  570. }) : super(
  571. pageIndex: pageIndex,
  572. pageSize: pageSize,
  573. token: token,
  574. );
  575. factory FindRecordPagesRequest.fromJson(Map<String, dynamic> map) {
  576. return FindRecordPagesRequest(
  577. organizationCodes: map['OrganizationCodes'] != null ? map['OrganizationCodes'].cast<String>().toList() : null,
  578. deviceCodes: map['DeviceCodes'] != null ? map['DeviceCodes'].cast<String>().toList() : null,
  579. recordQueryState: RecordQueryStateEnum.values.firstWhere((e) => e.index == map['RecordQueryState']),
  580. recordProcessState: RecordProcessStateEnum.values.firstWhere((e) => e.index == map['RecordProcessState']),
  581. language: map['Language'],
  582. keyWord: map['KeyWord'],
  583. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  584. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  585. pageIndex: map['PageIndex'],
  586. pageSize: map['PageSize'],
  587. token: map['Token'],
  588. );
  589. }
  590. Map<String, dynamic> toJson() {
  591. final map = super.toJson();
  592. if(organizationCodes != null)
  593. map['OrganizationCodes'] = organizationCodes;
  594. if(deviceCodes != null)
  595. map['DeviceCodes'] = deviceCodes;
  596. map['RecordQueryState'] = recordQueryState.index;
  597. map['RecordProcessState'] = recordProcessState.index;
  598. if(language != null)
  599. map['Language'] = language;
  600. if(keyWord != null)
  601. map['KeyWord'] = keyWord;
  602. if(startTime != null)
  603. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  604. if(endTime != null)
  605. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  606. return map;
  607. }
  608. }
  609. class CreateRecordNewRequest extends TokenRequest{
  610. String? patientCode;
  611. List<DataItemDTO >? patientDatas;
  612. String? deviceCode;
  613. List<PatientInfoExt >? patientInfoExtList;
  614. CreateRecordNewRequest({
  615. this.patientCode,
  616. this.patientDatas,
  617. this.deviceCode,
  618. this.patientInfoExtList,
  619. String? token,
  620. }) : super(
  621. token: token,
  622. );
  623. factory CreateRecordNewRequest.fromJson(Map<String, dynamic> map) {
  624. return CreateRecordNewRequest(
  625. patientCode: map['PatientCode'],
  626. patientDatas: map['PatientDatas'] != null ? (map['PatientDatas'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  627. deviceCode: map['DeviceCode'],
  628. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  629. token: map['Token'],
  630. );
  631. }
  632. Map<String, dynamic> toJson() {
  633. final map = super.toJson();
  634. if(patientCode != null)
  635. map['PatientCode'] = patientCode;
  636. if(patientDatas != null)
  637. map['PatientDatas'] = patientDatas;
  638. if(deviceCode != null)
  639. map['DeviceCode'] = deviceCode;
  640. if(patientInfoExtList != null)
  641. map['PatientInfoExtList'] = patientInfoExtList;
  642. return map;
  643. }
  644. }
  645. class CreateReferralRecordNewRequest extends TokenRequest{
  646. String? recordCode;
  647. String? referralOrganizationCode;
  648. String? referralUserCode;
  649. String? subjectMatter;
  650. CreateReferralRecordNewRequest({
  651. this.recordCode,
  652. this.referralOrganizationCode,
  653. this.referralUserCode,
  654. this.subjectMatter,
  655. String? token,
  656. }) : super(
  657. token: token,
  658. );
  659. factory CreateReferralRecordNewRequest.fromJson(Map<String, dynamic> map) {
  660. return CreateReferralRecordNewRequest(
  661. recordCode: map['RecordCode'],
  662. referralOrganizationCode: map['ReferralOrganizationCode'],
  663. referralUserCode: map['ReferralUserCode'],
  664. subjectMatter: map['SubjectMatter'],
  665. token: map['Token'],
  666. );
  667. }
  668. Map<String, dynamic> toJson() {
  669. final map = super.toJson();
  670. if(recordCode != null)
  671. map['RecordCode'] = recordCode;
  672. if(referralOrganizationCode != null)
  673. map['ReferralOrganizationCode'] = referralOrganizationCode;
  674. if(referralUserCode != null)
  675. map['ReferralUserCode'] = referralUserCode;
  676. if(subjectMatter != null)
  677. map['SubjectMatter'] = subjectMatter;
  678. return map;
  679. }
  680. }
  681. class WithdrawReferralForRecordListRequest extends TokenRequest{
  682. String? recordCode;
  683. WithdrawReferralForRecordListRequest({
  684. this.recordCode,
  685. String? token,
  686. }) : super(
  687. token: token,
  688. );
  689. factory WithdrawReferralForRecordListRequest.fromJson(Map<String, dynamic> map) {
  690. return WithdrawReferralForRecordListRequest(
  691. recordCode: map['RecordCode'],
  692. token: map['Token'],
  693. );
  694. }
  695. Map<String, dynamic> toJson() {
  696. final map = super.toJson();
  697. if(recordCode != null)
  698. map['RecordCode'] = recordCode;
  699. return map;
  700. }
  701. }
  702. enum RecordReferralStatusEnum {
  703. ReferralIn,
  704. Processed,
  705. Withdrawn,
  706. }
  707. class ReferralData extends BaseDTO{
  708. String? code;
  709. String? recordCode;
  710. String? referralOutUserCode;
  711. String? referralOutOrganizationCode;
  712. String? referralInUserCode;
  713. String? referralInOrganizationCode;
  714. RecordReferralStatusEnum referralStatus;
  715. DateTime? referralTime;
  716. String? subjectMatter;
  717. ReferralData({
  718. this.code,
  719. this.recordCode,
  720. this.referralOutUserCode,
  721. this.referralOutOrganizationCode,
  722. this.referralInUserCode,
  723. this.referralInOrganizationCode,
  724. this.referralStatus = RecordReferralStatusEnum.ReferralIn,
  725. this.referralTime,
  726. this.subjectMatter,
  727. DateTime? createTime,
  728. DateTime? updateTime,
  729. }) : super(
  730. createTime: createTime,
  731. updateTime: updateTime,
  732. );
  733. factory ReferralData.fromJson(Map<String, dynamic> map) {
  734. return ReferralData(
  735. code: map['Code'],
  736. recordCode: map['RecordCode'],
  737. referralOutUserCode: map['ReferralOutUserCode'],
  738. referralOutOrganizationCode: map['ReferralOutOrganizationCode'],
  739. referralInUserCode: map['ReferralInUserCode'],
  740. referralInOrganizationCode: map['ReferralInOrganizationCode'],
  741. referralStatus: RecordReferralStatusEnum.values.firstWhere((e) => e.index == map['ReferralStatus']),
  742. referralTime: map['ReferralTime'] != null ? DateTime.parse(map['ReferralTime']) : null,
  743. subjectMatter: map['SubjectMatter'],
  744. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  745. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  746. );
  747. }
  748. Map<String, dynamic> toJson() {
  749. final map = super.toJson();
  750. if(code != null)
  751. map['Code'] = code;
  752. if(recordCode != null)
  753. map['RecordCode'] = recordCode;
  754. if(referralOutUserCode != null)
  755. map['ReferralOutUserCode'] = referralOutUserCode;
  756. if(referralOutOrganizationCode != null)
  757. map['ReferralOutOrganizationCode'] = referralOutOrganizationCode;
  758. if(referralInUserCode != null)
  759. map['ReferralInUserCode'] = referralInUserCode;
  760. if(referralInOrganizationCode != null)
  761. map['ReferralInOrganizationCode'] = referralInOrganizationCode;
  762. map['ReferralStatus'] = referralStatus.index;
  763. if(referralTime != null)
  764. map['ReferralTime'] = JsonRpcUtils.dateFormat(referralTime!);
  765. if(subjectMatter != null)
  766. map['SubjectMatter'] = subjectMatter;
  767. return map;
  768. }
  769. }
  770. class ReferralHistoryDetail extends ReferralData{
  771. String? referralOutOrganizationName;
  772. String? referralOutUserName;
  773. String? referralInOrganizationName;
  774. String? referralInUserName;
  775. ReferralHistoryDetail({
  776. this.referralOutOrganizationName,
  777. this.referralOutUserName,
  778. this.referralInOrganizationName,
  779. this.referralInUserName,
  780. String? code,
  781. String? recordCode,
  782. String? referralOutUserCode,
  783. String? referralOutOrganizationCode,
  784. String? referralInUserCode,
  785. String? referralInOrganizationCode,
  786. RecordReferralStatusEnum referralStatus = RecordReferralStatusEnum.ReferralIn,
  787. DateTime? referralTime,
  788. String? subjectMatter,
  789. DateTime? createTime,
  790. DateTime? updateTime,
  791. }) : super(
  792. code: code,
  793. recordCode: recordCode,
  794. referralOutUserCode: referralOutUserCode,
  795. referralOutOrganizationCode: referralOutOrganizationCode,
  796. referralInUserCode: referralInUserCode,
  797. referralInOrganizationCode: referralInOrganizationCode,
  798. referralStatus: referralStatus,
  799. referralTime: referralTime,
  800. subjectMatter: subjectMatter,
  801. createTime: createTime,
  802. updateTime: updateTime,
  803. );
  804. factory ReferralHistoryDetail.fromJson(Map<String, dynamic> map) {
  805. return ReferralHistoryDetail(
  806. referralOutOrganizationName: map['ReferralOutOrganizationName'],
  807. referralOutUserName: map['ReferralOutUserName'],
  808. referralInOrganizationName: map['ReferralInOrganizationName'],
  809. referralInUserName: map['ReferralInUserName'],
  810. code: map['Code'],
  811. recordCode: map['RecordCode'],
  812. referralOutUserCode: map['ReferralOutUserCode'],
  813. referralOutOrganizationCode: map['ReferralOutOrganizationCode'],
  814. referralInUserCode: map['ReferralInUserCode'],
  815. referralInOrganizationCode: map['ReferralInOrganizationCode'],
  816. referralStatus: RecordReferralStatusEnum.values.firstWhere((e) => e.index == map['ReferralStatus']),
  817. referralTime: map['ReferralTime'] != null ? DateTime.parse(map['ReferralTime']) : null,
  818. subjectMatter: map['SubjectMatter'],
  819. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  820. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  821. );
  822. }
  823. Map<String, dynamic> toJson() {
  824. final map = super.toJson();
  825. if(referralOutOrganizationName != null)
  826. map['ReferralOutOrganizationName'] = referralOutOrganizationName;
  827. if(referralOutUserName != null)
  828. map['ReferralOutUserName'] = referralOutUserName;
  829. if(referralInOrganizationName != null)
  830. map['ReferralInOrganizationName'] = referralInOrganizationName;
  831. if(referralInUserName != null)
  832. map['ReferralInUserName'] = referralInUserName;
  833. return map;
  834. }
  835. }
  836. class FindReferralHistoryRequest extends TokenRequest{
  837. String? recordCode;
  838. FindReferralHistoryRequest({
  839. this.recordCode,
  840. String? token,
  841. }) : super(
  842. token: token,
  843. );
  844. factory FindReferralHistoryRequest.fromJson(Map<String, dynamic> map) {
  845. return FindReferralHistoryRequest(
  846. recordCode: map['RecordCode'],
  847. token: map['Token'],
  848. );
  849. }
  850. Map<String, dynamic> toJson() {
  851. final map = super.toJson();
  852. if(recordCode != null)
  853. map['RecordCode'] = recordCode;
  854. return map;
  855. }
  856. }