vitalExam.m.dart 14 KB

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