vitalExam.m.dart 14 KB

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