recordInfo.m.dart 27 KB

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