vitalExam.m.dart 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'vitalContractRecord.m.dart';
  4. import 'vitalHealthExamBooking.m.dart';
  5. import 'device.m.dart';
  6. import 'package:fis_jsonrpc/utils.dart';
  7. class CreateExamRequest extends TokenRequest{
  8. String? code;
  9. String? batchNumber;
  10. String? key;
  11. String? patientCode;
  12. String? contractedDoctor;
  13. String? examData;
  14. String? templateCode;
  15. String? physicalExamNumber;
  16. CreateExamRequest({
  17. this.code,
  18. this.batchNumber,
  19. this.key,
  20. this.patientCode,
  21. this.contractedDoctor,
  22. this.examData,
  23. this.templateCode,
  24. this.physicalExamNumber,
  25. String? token,
  26. }) : super(
  27. token: token,
  28. );
  29. factory CreateExamRequest.fromJson(Map<String, dynamic> map) {
  30. return CreateExamRequest(
  31. code: map['Code'],
  32. batchNumber: map['BatchNumber'],
  33. key: map['Key'],
  34. patientCode: map['PatientCode'],
  35. contractedDoctor: map['ContractedDoctor'],
  36. examData: map['ExamData'],
  37. templateCode: map['TemplateCode'],
  38. physicalExamNumber: map['PhysicalExamNumber'],
  39. token: map['Token'],
  40. );
  41. }
  42. Map<String, dynamic> toJson() {
  43. final map = super.toJson();
  44. if (code != null)
  45. map['Code'] = code;
  46. if (batchNumber != null)
  47. map['BatchNumber'] = batchNumber;
  48. if (key != null)
  49. map['Key'] = key;
  50. if (patientCode != null)
  51. map['PatientCode'] = patientCode;
  52. if (contractedDoctor != null)
  53. map['ContractedDoctor'] = contractedDoctor;
  54. if (examData != null)
  55. map['ExamData'] = examData;
  56. if (templateCode != null)
  57. map['TemplateCode'] = templateCode;
  58. if (physicalExamNumber != null)
  59. map['PhysicalExamNumber'] = physicalExamNumber;
  60. return map;
  61. }
  62. }
  63. class ExamDTO extends BaseDTO{
  64. String? code;
  65. String? key;
  66. String? patientCode;
  67. String? contractedDoctor;
  68. String? examData;
  69. String? patientName;
  70. String? cardNo;
  71. GenderEnum patientGender;
  72. String? patientAddress;
  73. DateTime? birthday;
  74. ExamStateEnum examState;
  75. DateTime? examTime;
  76. String? templateCode;
  77. String? examDoctor;
  78. String? batchNumber;
  79. ExamDTO({
  80. this.code,
  81. this.key,
  82. this.patientCode,
  83. this.contractedDoctor,
  84. this.examData,
  85. this.patientName,
  86. this.cardNo,
  87. this.patientGender = GenderEnum.Unknown,
  88. this.patientAddress,
  89. this.birthday,
  90. this.examState = ExamStateEnum.Unchecked,
  91. this.examTime,
  92. this.templateCode,
  93. this.examDoctor,
  94. this.batchNumber,
  95. DateTime? createTime,
  96. DateTime? updateTime,
  97. }) : super(
  98. createTime: createTime,
  99. updateTime: updateTime,
  100. );
  101. factory ExamDTO.fromJson(Map<String, dynamic> map) {
  102. return ExamDTO(
  103. code: map['Code'],
  104. key: map['Key'],
  105. patientCode: map['PatientCode'],
  106. contractedDoctor: map['ContractedDoctor'],
  107. examData: map['ExamData'],
  108. patientName: map['PatientName'],
  109. cardNo: map['CardNo'],
  110. patientGender: GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']),
  111. patientAddress: map['PatientAddress'],
  112. birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
  113. examState: ExamStateEnum.values.firstWhere((e) => e.index == map['ExamState']),
  114. examTime: map['ExamTime'] != null ? DateTime.parse(map['ExamTime']) : null,
  115. templateCode: map['TemplateCode'],
  116. examDoctor: map['ExamDoctor'],
  117. batchNumber: map['BatchNumber'],
  118. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  119. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  120. );
  121. }
  122. Map<String, dynamic> toJson() {
  123. final map = super.toJson();
  124. if (code != null)
  125. map['Code'] = code;
  126. if (key != null)
  127. map['Key'] = key;
  128. if (patientCode != null)
  129. map['PatientCode'] = patientCode;
  130. if (contractedDoctor != null)
  131. map['ContractedDoctor'] = contractedDoctor;
  132. if (examData != null)
  133. map['ExamData'] = examData;
  134. if (patientName != null)
  135. map['PatientName'] = patientName;
  136. if (cardNo != null)
  137. map['CardNo'] = cardNo;
  138. map['PatientGender'] = patientGender.index;
  139. if (patientAddress != null)
  140. map['PatientAddress'] = patientAddress;
  141. if (birthday != null)
  142. map['Birthday'] = JsonRpcUtils.dateFormat(birthday!);
  143. map['ExamState'] = examState.index;
  144. if (examTime != null)
  145. map['ExamTime'] = JsonRpcUtils.dateFormat(examTime!);
  146. if (templateCode != null)
  147. map['TemplateCode'] = templateCode;
  148. if (examDoctor != null)
  149. map['ExamDoctor'] = examDoctor;
  150. if (batchNumber != null)
  151. map['BatchNumber'] = batchNumber;
  152. return map;
  153. }
  154. }
  155. class GetExamRequest extends TokenRequest{
  156. String? code;
  157. GetExamRequest({
  158. this.code,
  159. String? token,
  160. }) : super(
  161. token: token,
  162. );
  163. factory GetExamRequest.fromJson(Map<String, dynamic> map) {
  164. return GetExamRequest(
  165. code: map['Code'],
  166. token: map['Token'],
  167. );
  168. }
  169. Map<String, dynamic> toJson() {
  170. final map = super.toJson();
  171. if (code != null)
  172. map['Code'] = code;
  173. return map;
  174. }
  175. }
  176. class GetExamByKeyRequest extends TokenRequest{
  177. String? key;
  178. String? value;
  179. GetExamByKeyRequest({
  180. this.key,
  181. this.value,
  182. String? token,
  183. }) : super(
  184. token: token,
  185. );
  186. factory GetExamByKeyRequest.fromJson(Map<String, dynamic> map) {
  187. return GetExamByKeyRequest(
  188. key: map['Key'],
  189. value: map['Value'],
  190. token: map['Token'],
  191. );
  192. }
  193. Map<String, dynamic> toJson() {
  194. final map = super.toJson();
  195. if (key != null)
  196. map['Key'] = key;
  197. if (value != null)
  198. map['Value'] = value;
  199. return map;
  200. }
  201. }
  202. class ExamPageRequest extends PageRequest{
  203. ExamPageRequest({
  204. int pageIndex = 0,
  205. int pageSize = 0,
  206. String? token,
  207. }) : super(
  208. pageIndex: pageIndex,
  209. pageSize: pageSize,
  210. token: token,
  211. );
  212. factory ExamPageRequest.fromJson(Map<String, dynamic> map) {
  213. return ExamPageRequest(
  214. pageIndex: map['PageIndex'],
  215. pageSize: map['PageSize'],
  216. token: map['Token'],
  217. );
  218. }
  219. Map<String, dynamic> toJson() {
  220. final map = super.toJson();
  221. return map;
  222. }
  223. }
  224. class RemoveExamRequest extends TokenRequest{
  225. String? code;
  226. RemoveExamRequest({
  227. this.code,
  228. String? token,
  229. }) : super(
  230. token: token,
  231. );
  232. factory RemoveExamRequest.fromJson(Map<String, dynamic> map) {
  233. return RemoveExamRequest(
  234. code: map['Code'],
  235. token: map['Token'],
  236. );
  237. }
  238. Map<String, dynamic> toJson() {
  239. final map = super.toJson();
  240. if (code != null)
  241. map['Code'] = code;
  242. return map;
  243. }
  244. }
  245. class GetExamListRequest extends TokenRequest{
  246. List<String>? codes;
  247. GetExamListRequest({
  248. this.codes,
  249. String? token,
  250. }) : super(
  251. token: token,
  252. );
  253. factory GetExamListRequest.fromJson(Map<String, dynamic> map) {
  254. return GetExamListRequest(
  255. codes: map['Codes']?.cast<String>().toList(),
  256. token: map['Token'],
  257. );
  258. }
  259. Map<String, dynamic> toJson() {
  260. final map = super.toJson();
  261. if (codes != null)
  262. map['Codes'] = codes;
  263. return map;
  264. }
  265. }
  266. class UpdateExamRequest extends TokenRequest{
  267. String? code;
  268. String? key;
  269. String? examData;
  270. UpdateExamRequest({
  271. this.code,
  272. this.key,
  273. this.examData,
  274. String? token,
  275. }) : super(
  276. token: token,
  277. );
  278. factory UpdateExamRequest.fromJson(Map<String, dynamic> map) {
  279. return UpdateExamRequest(
  280. code: map['Code'],
  281. key: map['Key'],
  282. examData: map['ExamData'],
  283. token: map['Token'],
  284. );
  285. }
  286. Map<String, dynamic> toJson() {
  287. final map = super.toJson();
  288. if (code != null)
  289. map['Code'] = code;
  290. if (key != null)
  291. map['Key'] = key;
  292. if (examData != null)
  293. map['ExamData'] = examData;
  294. return map;
  295. }
  296. }
  297. class GetExamPageByKeyRequest extends PageRequest{
  298. String? key;
  299. String? patientCode;
  300. GetExamPageByKeyRequest({
  301. this.key,
  302. this.patientCode,
  303. int pageIndex = 0,
  304. int pageSize = 0,
  305. String? token,
  306. }) : super(
  307. pageIndex: pageIndex,
  308. pageSize: pageSize,
  309. token: token,
  310. );
  311. factory GetExamPageByKeyRequest.fromJson(Map<String, dynamic> map) {
  312. return GetExamPageByKeyRequest(
  313. key: map['Key'],
  314. patientCode: map['PatientCode'],
  315. pageIndex: map['PageIndex'],
  316. pageSize: map['PageSize'],
  317. token: map['Token'],
  318. );
  319. }
  320. Map<String, dynamic> toJson() {
  321. final map = super.toJson();
  322. if (key != null)
  323. map['Key'] = key;
  324. if (patientCode != null)
  325. map['PatientCode'] = patientCode;
  326. return map;
  327. }
  328. }
  329. class GetExamPatientPageByKeyRequest extends PageRequest{
  330. String? key;
  331. GetExamPatientPageByKeyRequest({
  332. this.key,
  333. int pageIndex = 0,
  334. int pageSize = 0,
  335. String? token,
  336. }) : super(
  337. pageIndex: pageIndex,
  338. pageSize: pageSize,
  339. token: token,
  340. );
  341. factory GetExamPatientPageByKeyRequest.fromJson(Map<String, dynamic> map) {
  342. return GetExamPatientPageByKeyRequest(
  343. key: map['Key'],
  344. pageIndex: map['PageIndex'],
  345. pageSize: map['PageSize'],
  346. token: map['Token'],
  347. );
  348. }
  349. Map<String, dynamic> toJson() {
  350. final map = super.toJson();
  351. if (key != null)
  352. map['Key'] = key;
  353. return map;
  354. }
  355. }
  356. class GetExamRecordPageRequest extends PageRequest{
  357. List<String>? keys;
  358. GetExamRecordPageRequest({
  359. this.keys,
  360. int pageIndex = 0,
  361. int pageSize = 0,
  362. String? token,
  363. }) : super(
  364. pageIndex: pageIndex,
  365. pageSize: pageSize,
  366. token: token,
  367. );
  368. factory GetExamRecordPageRequest.fromJson(Map<String, dynamic> map) {
  369. return GetExamRecordPageRequest(
  370. keys: map['Keys']?.cast<String>().toList(),
  371. pageIndex: map['PageIndex'],
  372. pageSize: map['PageSize'],
  373. token: map['Token'],
  374. );
  375. }
  376. Map<String, dynamic> toJson() {
  377. final map = super.toJson();
  378. if (keys != null)
  379. map['Keys'] = keys;
  380. return map;
  381. }
  382. }
  383. class ExamRecordDataDTO {
  384. String? key;
  385. String? code;
  386. String? examData;
  387. String? templateCode;
  388. ExamRecordDataDTO({
  389. this.key,
  390. this.code,
  391. this.examData,
  392. this.templateCode,
  393. });
  394. factory ExamRecordDataDTO.fromJson(Map<String, dynamic> map) {
  395. return ExamRecordDataDTO(
  396. key: map['Key'],
  397. code: map['Code'],
  398. examData: map['ExamData'],
  399. templateCode: map['TemplateCode'],
  400. );
  401. }
  402. Map<String, dynamic> toJson() {
  403. final map = Map<String, dynamic>();
  404. if (key != null) {
  405. map['Key'] = key;
  406. }
  407. if (code != null) {
  408. map['Code'] = code;
  409. }
  410. if (examData != null) {
  411. map['ExamData'] = examData;
  412. }
  413. if (templateCode != null) {
  414. map['TemplateCode'] = templateCode;
  415. }
  416. return map;
  417. }
  418. }
  419. class ExamRecordDTO {
  420. String? batchNumber;
  421. String? contractedDoctor;
  422. String? patientName;
  423. String? cardNo;
  424. GenderEnum patientGender;
  425. String? patientAddress;
  426. DateTime? birthday;
  427. ExamStateEnum examState;
  428. DateTime? examTime;
  429. String? examDoctor;
  430. List<ExamRecordDataDTO>? examRecordDatas;
  431. ExamRecordDTO({
  432. this.batchNumber,
  433. this.contractedDoctor,
  434. this.patientName,
  435. this.cardNo,
  436. this.patientGender = GenderEnum.Unknown,
  437. this.patientAddress,
  438. this.birthday,
  439. this.examState = ExamStateEnum.Unchecked,
  440. this.examTime,
  441. this.examDoctor,
  442. this.examRecordDatas,
  443. });
  444. factory ExamRecordDTO.fromJson(Map<String, dynamic> map) {
  445. return ExamRecordDTO(
  446. batchNumber: map['BatchNumber'],
  447. contractedDoctor: map['ContractedDoctor'],
  448. patientName: map['PatientName'],
  449. cardNo: map['CardNo'],
  450. patientGender: GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']),
  451. patientAddress: map['PatientAddress'],
  452. birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
  453. examState: ExamStateEnum.values.firstWhere((e) => e.index == map['ExamState']),
  454. examTime: map['ExamTime'] != null ? DateTime.parse(map['ExamTime']) : null,
  455. examDoctor: map['ExamDoctor'],
  456. examRecordDatas: map['ExamRecordDatas'] != null ? (map['ExamRecordDatas'] as List).map((e)=>ExamRecordDataDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  457. );
  458. }
  459. Map<String, dynamic> toJson() {
  460. final map = Map<String, dynamic>();
  461. if (batchNumber != null) {
  462. map['BatchNumber'] = batchNumber;
  463. }
  464. if (contractedDoctor != null) {
  465. map['ContractedDoctor'] = contractedDoctor;
  466. }
  467. if (patientName != null) {
  468. map['PatientName'] = patientName;
  469. }
  470. if (cardNo != null) {
  471. map['CardNo'] = cardNo;
  472. }
  473. map['PatientGender'] = patientGender.index;
  474. if (patientAddress != null) {
  475. map['PatientAddress'] = patientAddress;
  476. }
  477. if (birthday != null) {
  478. map['Birthday'] = JsonRpcUtils.dateFormat(birthday!);
  479. }
  480. map['ExamState'] = examState.index;
  481. if (examTime != null) {
  482. map['ExamTime'] = JsonRpcUtils.dateFormat(examTime!);
  483. }
  484. if (examDoctor != null) {
  485. map['ExamDoctor'] = examDoctor;
  486. }
  487. if (examRecordDatas != null) {
  488. map['ExamRecordDatas'] = examRecordDatas;
  489. }
  490. return map;
  491. }
  492. }
  493. class GetExamRecordListRequest extends TokenRequest{
  494. List<String>? keys;
  495. String? patientCode;
  496. GetExamRecordListRequest({
  497. this.keys,
  498. this.patientCode,
  499. String? token,
  500. }) : super(
  501. token: token,
  502. );
  503. factory GetExamRecordListRequest.fromJson(Map<String, dynamic> map) {
  504. return GetExamRecordListRequest(
  505. keys: map['Keys']?.cast<String>().toList(),
  506. patientCode: map['PatientCode'],
  507. token: map['Token'],
  508. );
  509. }
  510. Map<String, dynamic> toJson() {
  511. final map = super.toJson();
  512. if (keys != null)
  513. map['Keys'] = keys;
  514. if (patientCode != null)
  515. map['PatientCode'] = patientCode;
  516. return map;
  517. }
  518. }
  519. class SaveQuickCheckRecordRequest extends TokenRequest{
  520. String? patientCode;
  521. List<String>? keys;
  522. String? quickData;
  523. SaveQuickCheckRecordRequest({
  524. this.patientCode,
  525. this.keys,
  526. this.quickData,
  527. String? token,
  528. }) : super(
  529. token: token,
  530. );
  531. factory SaveQuickCheckRecordRequest.fromJson(Map<String, dynamic> map) {
  532. return SaveQuickCheckRecordRequest(
  533. patientCode: map['PatientCode'],
  534. keys: map['Keys']?.cast<String>().toList(),
  535. quickData: map['QuickData'],
  536. token: map['Token'],
  537. );
  538. }
  539. Map<String, dynamic> toJson() {
  540. final map = super.toJson();
  541. if (patientCode != null)
  542. map['PatientCode'] = patientCode;
  543. if (keys != null)
  544. map['Keys'] = keys;
  545. if (quickData != null)
  546. map['QuickData'] = quickData;
  547. return map;
  548. }
  549. }
  550. class UpdateExamByBatchNumberRequest extends TokenRequest{
  551. String? batchNumber;
  552. String? patientCode;
  553. String? key;
  554. String? examData;
  555. UpdateExamByBatchNumberRequest({
  556. this.batchNumber,
  557. this.patientCode,
  558. this.key,
  559. this.examData,
  560. String? token,
  561. }) : super(
  562. token: token,
  563. );
  564. factory UpdateExamByBatchNumberRequest.fromJson(Map<String, dynamic> map) {
  565. return UpdateExamByBatchNumberRequest(
  566. batchNumber: map['BatchNumber'],
  567. patientCode: map['PatientCode'],
  568. key: map['Key'],
  569. examData: map['ExamData'],
  570. token: map['Token'],
  571. );
  572. }
  573. Map<String, dynamic> toJson() {
  574. final map = super.toJson();
  575. if (batchNumber != null)
  576. map['BatchNumber'] = batchNumber;
  577. if (patientCode != null)
  578. map['PatientCode'] = patientCode;
  579. if (key != null)
  580. map['Key'] = key;
  581. if (examData != null)
  582. map['ExamData'] = examData;
  583. return map;
  584. }
  585. }
  586. class GetExamListByPhysicalExamNumberRequest {
  587. String? physicalExamNumber;
  588. GetExamListByPhysicalExamNumberRequest({
  589. this.physicalExamNumber,
  590. });
  591. factory GetExamListByPhysicalExamNumberRequest.fromJson(Map<String, dynamic> map) {
  592. return GetExamListByPhysicalExamNumberRequest(
  593. physicalExamNumber: map['PhysicalExamNumber'],
  594. );
  595. }
  596. Map<String, dynamic> toJson() {
  597. final map = Map<String, dynamic>();
  598. if (physicalExamNumber != null) {
  599. map['PhysicalExamNumber'] = physicalExamNumber;
  600. }
  601. return map;
  602. }
  603. }