patient.m.dart 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. class CreatePatientRequest extends TokenRequest{
  5. List<DataItemDTO>? patientData;
  6. List<String>? assignmentUserCodes;
  7. CreatePatientRequest({
  8. this.patientData,
  9. this.assignmentUserCodes,
  10. String? token,
  11. }) : super(
  12. token: token,
  13. );
  14. factory CreatePatientRequest.fromJson(Map<String, dynamic> map) {
  15. return CreatePatientRequest(
  16. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  17. assignmentUserCodes: map['AssignmentUserCodes']?.cast<String>().toList(),
  18. token: map['Token'],
  19. );
  20. }
  21. Map<String, dynamic> toJson() {
  22. final map = super.toJson();
  23. if (patientData != null)
  24. map['PatientData'] = patientData;
  25. if (assignmentUserCodes != null)
  26. map['AssignmentUserCodes'] = assignmentUserCodes;
  27. return map;
  28. }
  29. }
  30. class CreatePatientByUnregisteredRequest extends TokenRequest{
  31. String? unregisteredPatientCode;
  32. String? patientName;
  33. CreatePatientByUnregisteredRequest({
  34. this.unregisteredPatientCode,
  35. this.patientName,
  36. String? token,
  37. }) : super(
  38. token: token,
  39. );
  40. factory CreatePatientByUnregisteredRequest.fromJson(Map<String, dynamic> map) {
  41. return CreatePatientByUnregisteredRequest(
  42. unregisteredPatientCode: map['UnregisteredPatientCode'],
  43. patientName: map['PatientName'],
  44. token: map['Token'],
  45. );
  46. }
  47. Map<String, dynamic> toJson() {
  48. final map = super.toJson();
  49. if (unregisteredPatientCode != null)
  50. map['UnregisteredPatientCode'] = unregisteredPatientCode;
  51. if (patientName != null)
  52. map['PatientName'] = patientName;
  53. return map;
  54. }
  55. }
  56. class UpdatePatientRequest extends TokenRequest{
  57. String? code;
  58. List<DataItemDTO>? patientData;
  59. List<String>? assignmentUserCodes;
  60. UpdatePatientRequest({
  61. this.code,
  62. this.patientData,
  63. this.assignmentUserCodes,
  64. String? token,
  65. }) : super(
  66. token: token,
  67. );
  68. factory UpdatePatientRequest.fromJson(Map<String, dynamic> map) {
  69. return UpdatePatientRequest(
  70. code: map['Code'],
  71. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  72. assignmentUserCodes: map['AssignmentUserCodes']?.cast<String>().toList(),
  73. token: map['Token'],
  74. );
  75. }
  76. Map<String, dynamic> toJson() {
  77. final map = super.toJson();
  78. if (code != null)
  79. map['Code'] = code;
  80. if (patientData != null)
  81. map['PatientData'] = patientData;
  82. if (assignmentUserCodes != null)
  83. map['AssignmentUserCodes'] = assignmentUserCodes;
  84. return map;
  85. }
  86. }
  87. class PatientInfoBaseDTO extends BaseDTO{
  88. String? patientCode;
  89. String? name;
  90. String? phone;
  91. String? identityCard;
  92. String? insuranceCode;
  93. String? age;
  94. int gender;
  95. bool isValid;
  96. String? organizationCode;
  97. String? rootOrganizationCode;
  98. List<String>? assignmentUserCodes;
  99. List<DataItemDTO>? patientData;
  100. int unReadRecordCount;
  101. String? headImgUrl;
  102. String? patientType;
  103. bool isReferral;
  104. List<String>? devicePatientIDs;
  105. bool isFromDicom;
  106. PatientInfoBaseDTO({
  107. this.patientCode,
  108. this.name,
  109. this.phone,
  110. this.identityCard,
  111. this.insuranceCode,
  112. this.age,
  113. this.gender = 0,
  114. this.isValid = false,
  115. this.organizationCode,
  116. this.rootOrganizationCode,
  117. this.assignmentUserCodes,
  118. this.patientData,
  119. this.unReadRecordCount = 0,
  120. this.headImgUrl,
  121. this.patientType,
  122. this.isReferral = false,
  123. this.devicePatientIDs,
  124. this.isFromDicom = false,
  125. DateTime? createTime,
  126. DateTime? updateTime,
  127. }) : super(
  128. createTime: createTime,
  129. updateTime: updateTime,
  130. );
  131. factory PatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
  132. return PatientInfoBaseDTO(
  133. patientCode: map['PatientCode'],
  134. name: map['Name'],
  135. phone: map['Phone'],
  136. identityCard: map['IdentityCard'],
  137. insuranceCode: map['InsuranceCode'],
  138. age: map['Age'],
  139. gender: map['Gender'],
  140. isValid: map['IsValid'],
  141. organizationCode: map['OrganizationCode'],
  142. rootOrganizationCode: map['RootOrganizationCode'],
  143. assignmentUserCodes: map['AssignmentUserCodes']?.cast<String>().toList(),
  144. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  145. unReadRecordCount: map['UnReadRecordCount'],
  146. headImgUrl: map['HeadImgUrl'],
  147. patientType: map['PatientType'],
  148. isReferral: map['IsReferral'],
  149. devicePatientIDs: map['DevicePatientIDs']?.cast<String>().toList(),
  150. isFromDicom: map['IsFromDicom'],
  151. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  152. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  153. );
  154. }
  155. Map<String, dynamic> toJson() {
  156. final map = super.toJson();
  157. if (patientCode != null)
  158. map['PatientCode'] = patientCode;
  159. if (name != null)
  160. map['Name'] = name;
  161. if (phone != null)
  162. map['Phone'] = phone;
  163. if (identityCard != null)
  164. map['IdentityCard'] = identityCard;
  165. if (insuranceCode != null)
  166. map['InsuranceCode'] = insuranceCode;
  167. if (age != null)
  168. map['Age'] = age;
  169. map['Gender'] = gender;
  170. map['IsValid'] = isValid;
  171. if (organizationCode != null)
  172. map['OrganizationCode'] = organizationCode;
  173. if (rootOrganizationCode != null)
  174. map['RootOrganizationCode'] = rootOrganizationCode;
  175. if (assignmentUserCodes != null)
  176. map['AssignmentUserCodes'] = assignmentUserCodes;
  177. if (patientData != null)
  178. map['PatientData'] = patientData;
  179. map['UnReadRecordCount'] = unReadRecordCount;
  180. if (headImgUrl != null)
  181. map['HeadImgUrl'] = headImgUrl;
  182. if (patientType != null)
  183. map['PatientType'] = patientType;
  184. map['IsReferral'] = isReferral;
  185. if (devicePatientIDs != null)
  186. map['DevicePatientIDs'] = devicePatientIDs;
  187. map['IsFromDicom'] = isFromDicom;
  188. return map;
  189. }
  190. }
  191. class PatientInfoDTO extends PatientInfoBaseDTO{
  192. String? creatorCode;
  193. String? deviceCode;
  194. List<String>? updateUsers;
  195. PatientInfoDTO({
  196. this.creatorCode,
  197. this.deviceCode,
  198. this.updateUsers,
  199. String? patientCode,
  200. String? name,
  201. String? phone,
  202. String? identityCard,
  203. String? insuranceCode,
  204. String? age,
  205. int gender = 0,
  206. bool isValid = false,
  207. String? organizationCode,
  208. String? rootOrganizationCode,
  209. List<String>? assignmentUserCodes,
  210. List<DataItemDTO>? patientData,
  211. int unReadRecordCount = 0,
  212. String? headImgUrl,
  213. String? patientType,
  214. bool isReferral = false,
  215. List<String>? devicePatientIDs,
  216. bool isFromDicom = false,
  217. DateTime? createTime,
  218. DateTime? updateTime,
  219. }) : super(
  220. patientCode: patientCode,
  221. name: name,
  222. phone: phone,
  223. identityCard: identityCard,
  224. insuranceCode: insuranceCode,
  225. age: age,
  226. gender: gender,
  227. isValid: isValid,
  228. organizationCode: organizationCode,
  229. rootOrganizationCode: rootOrganizationCode,
  230. assignmentUserCodes: assignmentUserCodes,
  231. patientData: patientData,
  232. unReadRecordCount: unReadRecordCount,
  233. headImgUrl: headImgUrl,
  234. patientType: patientType,
  235. isReferral: isReferral,
  236. devicePatientIDs: devicePatientIDs,
  237. isFromDicom: isFromDicom,
  238. createTime: createTime,
  239. updateTime: updateTime,
  240. );
  241. factory PatientInfoDTO.fromJson(Map<String, dynamic> map) {
  242. return PatientInfoDTO(
  243. creatorCode: map['CreatorCode'],
  244. deviceCode: map['DeviceCode'],
  245. updateUsers: map['UpdateUsers']?.cast<String>().toList(),
  246. patientCode: map['PatientCode'],
  247. name: map['Name'],
  248. phone: map['Phone'],
  249. identityCard: map['IdentityCard'],
  250. insuranceCode: map['InsuranceCode'],
  251. age: map['Age'],
  252. gender: map['Gender'],
  253. isValid: map['IsValid'],
  254. organizationCode: map['OrganizationCode'],
  255. rootOrganizationCode: map['RootOrganizationCode'],
  256. assignmentUserCodes: map['AssignmentUserCodes']?.cast<String>().toList(),
  257. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  258. unReadRecordCount: map['UnReadRecordCount'],
  259. headImgUrl: map['HeadImgUrl'],
  260. patientType: map['PatientType'],
  261. isReferral: map['IsReferral'],
  262. devicePatientIDs: map['DevicePatientIDs']?.cast<String>().toList(),
  263. isFromDicom: map['IsFromDicom'],
  264. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  265. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  266. );
  267. }
  268. Map<String, dynamic> toJson() {
  269. final map = super.toJson();
  270. if (creatorCode != null)
  271. map['CreatorCode'] = creatorCode;
  272. if (deviceCode != null)
  273. map['DeviceCode'] = deviceCode;
  274. if (updateUsers != null)
  275. map['UpdateUsers'] = updateUsers;
  276. return map;
  277. }
  278. }
  279. class CreatePatientsRequest extends TokenRequest{
  280. List<PatientInfoDTO>? patients;
  281. CreatePatientsRequest({
  282. this.patients,
  283. String? token,
  284. }) : super(
  285. token: token,
  286. );
  287. factory CreatePatientsRequest.fromJson(Map<String, dynamic> map) {
  288. return CreatePatientsRequest(
  289. patients: map['Patients'] != null ? (map['Patients'] as List).map((e)=>PatientInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  290. token: map['Token'],
  291. );
  292. }
  293. Map<String, dynamic> toJson() {
  294. final map = super.toJson();
  295. if (patients != null)
  296. map['Patients'] = patients;
  297. return map;
  298. }
  299. }
  300. enum PatientValidStatusEnum {
  301. All,
  302. CheckOut,
  303. CheckIn,
  304. }
  305. class FindPatientsPageRequest extends PageRequest{
  306. String? keyWord;
  307. DateTime? startTime;
  308. DateTime? endTime;
  309. PatientValidStatusEnum isValid;
  310. List<String>? organizationCodes;
  311. List<String>? deviceCodes;
  312. String? patientCode;
  313. FindPatientsPageRequest({
  314. this.keyWord,
  315. this.startTime,
  316. this.endTime,
  317. this.isValid = PatientValidStatusEnum.All,
  318. this.organizationCodes,
  319. this.deviceCodes,
  320. this.patientCode,
  321. int pageIndex = 0,
  322. int pageSize = 0,
  323. String? token,
  324. }) : super(
  325. pageIndex: pageIndex,
  326. pageSize: pageSize,
  327. token: token,
  328. );
  329. factory FindPatientsPageRequest.fromJson(Map<String, dynamic> map) {
  330. return FindPatientsPageRequest(
  331. keyWord: map['KeyWord'],
  332. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  333. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  334. isValid: PatientValidStatusEnum.values.firstWhere((e) => e.index == map['IsValid']),
  335. organizationCodes: map['OrganizationCodes']?.cast<String>().toList(),
  336. deviceCodes: map['DeviceCodes']?.cast<String>().toList(),
  337. patientCode: map['PatientCode'],
  338. pageIndex: map['PageIndex'],
  339. pageSize: map['PageSize'],
  340. token: map['Token'],
  341. );
  342. }
  343. Map<String, dynamic> toJson() {
  344. final map = super.toJson();
  345. if (keyWord != null)
  346. map['KeyWord'] = keyWord;
  347. if (startTime != null)
  348. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  349. if (endTime != null)
  350. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  351. map['IsValid'] = isValid.index;
  352. if (organizationCodes != null)
  353. map['OrganizationCodes'] = organizationCodes;
  354. if (deviceCodes != null)
  355. map['DeviceCodes'] = deviceCodes;
  356. if (patientCode != null)
  357. map['PatientCode'] = patientCode;
  358. return map;
  359. }
  360. }
  361. enum RecordStatusEnum {
  362. NotScanned,
  363. Uploaded,
  364. NotReport,
  365. Completed,
  366. }
  367. enum DiagnosisStatusEnum {
  368. NotRequired,
  369. Under,
  370. Completed,
  371. }
  372. enum DiagnosisReportStatusEnum {
  373. NotRequired,
  374. Reporting,
  375. Reported,
  376. }
  377. class DiagnosisInfoDTO {
  378. DiagnosisOrganEnum diagnosisOrgan;
  379. DiagnosisConclusionEnum conclusion;
  380. DiagnosisReportStatusEnum reportStatus;
  381. DiagnosisInfoDTO({
  382. this.diagnosisOrgan = DiagnosisOrganEnum.Null,
  383. this.conclusion = DiagnosisConclusionEnum.NotRequired,
  384. this.reportStatus = DiagnosisReportStatusEnum.NotRequired,
  385. });
  386. factory DiagnosisInfoDTO.fromJson(Map<String, dynamic> map) {
  387. return DiagnosisInfoDTO(
  388. diagnosisOrgan: DiagnosisOrganEnum.values.firstWhere((e) => e.index == map['DiagnosisOrgan']),
  389. conclusion: DiagnosisConclusionEnum.values.firstWhere((e) => e.index == map['Conclusion']),
  390. reportStatus: DiagnosisReportStatusEnum.values.firstWhere((e) => e.index == map['ReportStatus']),
  391. );
  392. }
  393. Map<String, dynamic> toJson() {
  394. final map = Map<String, dynamic>();
  395. map['DiagnosisOrgan'] = diagnosisOrgan.index;
  396. map['Conclusion'] = conclusion.index;
  397. map['ReportStatus'] = reportStatus.index;
  398. return map;
  399. }
  400. }
  401. enum ReferralStatusEnum {
  402. Wait,
  403. Withdrawn,
  404. TimedOut,
  405. Accepted,
  406. Rejected,
  407. }
  408. class GetRecordsPageDTO {
  409. DateTime? createTime;
  410. String? deptName;
  411. String? creatorName;
  412. String? deviceName;
  413. String? displayName;
  414. String? reportNum;
  415. String? recordCode;
  416. RecordStatusEnum recordStatus;
  417. bool isRead;
  418. List<RemedicalInfoDTO>? remedicalList;
  419. DiagnosisStatusEnum diagnosisStatus;
  420. List<DiagnosisInfoDTO>? diagnosisInfos;
  421. bool isReferral;
  422. ReferralStatusEnum referralStatus;
  423. bool canCreateReport;
  424. String? deviceCode;
  425. bool isCollecting;
  426. bool canCollcetImg;
  427. String? customDoctor;
  428. String? customOrganzation;
  429. String? equipmentSN;
  430. GetRecordsPageDTO({
  431. this.createTime,
  432. this.deptName,
  433. this.creatorName,
  434. this.deviceName,
  435. this.displayName,
  436. this.reportNum,
  437. this.recordCode,
  438. this.recordStatus = RecordStatusEnum.NotScanned,
  439. this.isRead = false,
  440. this.remedicalList,
  441. this.diagnosisStatus = DiagnosisStatusEnum.NotRequired,
  442. this.diagnosisInfos,
  443. this.isReferral = false,
  444. this.referralStatus = ReferralStatusEnum.Wait,
  445. this.canCreateReport = false,
  446. this.deviceCode,
  447. this.isCollecting = false,
  448. this.canCollcetImg = false,
  449. this.customDoctor,
  450. this.customOrganzation,
  451. this.equipmentSN,
  452. });
  453. factory GetRecordsPageDTO.fromJson(Map<String, dynamic> map) {
  454. return GetRecordsPageDTO(
  455. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  456. deptName: map['DeptName'],
  457. creatorName: map['CreatorName'],
  458. deviceName: map['DeviceName'],
  459. displayName: map['DisplayName'],
  460. reportNum: map['ReportNum'],
  461. recordCode: map['RecordCode'],
  462. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  463. isRead: map['IsRead'],
  464. remedicalList: map['RemedicalList'] != null ? (map['RemedicalList'] as List).map((e)=>RemedicalInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  465. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  466. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  467. isReferral: map['IsReferral'],
  468. referralStatus: ReferralStatusEnum.values.firstWhere((e) => e.index == map['ReferralStatus']),
  469. canCreateReport: map['CanCreateReport'],
  470. deviceCode: map['DeviceCode'],
  471. isCollecting: map['IsCollecting'],
  472. canCollcetImg: map['CanCollcetImg'],
  473. customDoctor: map['CustomDoctor'],
  474. customOrganzation: map['CustomOrganzation'],
  475. equipmentSN: map['EquipmentSN'],
  476. );
  477. }
  478. Map<String, dynamic> toJson() {
  479. final map = Map<String, dynamic>();
  480. if (createTime != null) {
  481. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  482. }
  483. if (deptName != null) {
  484. map['DeptName'] = deptName;
  485. }
  486. if (creatorName != null) {
  487. map['CreatorName'] = creatorName;
  488. }
  489. if (deviceName != null) {
  490. map['DeviceName'] = deviceName;
  491. }
  492. if (displayName != null) {
  493. map['DisplayName'] = displayName;
  494. }
  495. if (reportNum != null) {
  496. map['ReportNum'] = reportNum;
  497. }
  498. if (recordCode != null) {
  499. map['RecordCode'] = recordCode;
  500. }
  501. map['RecordStatus'] = recordStatus.index;
  502. map['IsRead'] = isRead;
  503. if (remedicalList != null) {
  504. map['RemedicalList'] = remedicalList;
  505. }
  506. map['DiagnosisStatus'] = diagnosisStatus.index;
  507. if (diagnosisInfos != null) {
  508. map['DiagnosisInfos'] = diagnosisInfos;
  509. }
  510. map['IsReferral'] = isReferral;
  511. map['ReferralStatus'] = referralStatus.index;
  512. map['CanCreateReport'] = canCreateReport;
  513. if (deviceCode != null) {
  514. map['DeviceCode'] = deviceCode;
  515. }
  516. map['IsCollecting'] = isCollecting;
  517. map['CanCollcetImg'] = canCollcetImg;
  518. if (customDoctor != null) {
  519. map['CustomDoctor'] = customDoctor;
  520. }
  521. if (customOrganzation != null) {
  522. map['CustomOrganzation'] = customOrganzation;
  523. }
  524. if (equipmentSN != null) {
  525. map['EquipmentSN'] = equipmentSN;
  526. }
  527. return map;
  528. }
  529. }
  530. class ClientPatientInfoDTO extends ClientPatientInfoBaseDTO{
  531. String? creatorCode;
  532. String? creatorName;
  533. String? deviceCode;
  534. List<UserBaseDTO>? assignmentUserList;
  535. GetRecordsPageDTO? lastRecord;
  536. String? encryptFullName;
  537. ClientPatientInfoDTO({
  538. this.creatorCode,
  539. this.creatorName,
  540. this.deviceCode,
  541. this.assignmentUserList,
  542. this.lastRecord,
  543. this.encryptFullName,
  544. String? patientCode,
  545. bool isValid = false,
  546. List<DataItemDTO>? patientData,
  547. int unReadRecordCount = 0,
  548. bool isReferral = false,
  549. List<String>? devicePatientIDs,
  550. String? organizationCode,
  551. String? organizationName,
  552. DateTime? createTime,
  553. DateTime? updateTime,
  554. }) : super(
  555. patientCode: patientCode,
  556. isValid: isValid,
  557. patientData: patientData,
  558. unReadRecordCount: unReadRecordCount,
  559. isReferral: isReferral,
  560. devicePatientIDs: devicePatientIDs,
  561. organizationCode: organizationCode,
  562. organizationName: organizationName,
  563. createTime: createTime,
  564. updateTime: updateTime,
  565. );
  566. factory ClientPatientInfoDTO.fromJson(Map<String, dynamic> map) {
  567. return ClientPatientInfoDTO(
  568. creatorCode: map['CreatorCode'],
  569. creatorName: map['CreatorName'],
  570. deviceCode: map['DeviceCode'],
  571. assignmentUserList: map['AssignmentUserList'] != null ? (map['AssignmentUserList'] as List).map((e)=>UserBaseDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  572. lastRecord: map['LastRecord'] != null ? GetRecordsPageDTO.fromJson(map['LastRecord']) : null,
  573. encryptFullName: map['EncryptFullName'],
  574. patientCode: map['PatientCode'],
  575. isValid: map['IsValid'],
  576. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  577. unReadRecordCount: map['UnReadRecordCount'],
  578. isReferral: map['IsReferral'],
  579. devicePatientIDs: map['DevicePatientIDs']?.cast<String>().toList(),
  580. organizationCode: map['OrganizationCode'],
  581. organizationName: map['OrganizationName'],
  582. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  583. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  584. );
  585. }
  586. Map<String, dynamic> toJson() {
  587. final map = super.toJson();
  588. if (creatorCode != null)
  589. map['CreatorCode'] = creatorCode;
  590. if (creatorName != null)
  591. map['CreatorName'] = creatorName;
  592. if (deviceCode != null)
  593. map['DeviceCode'] = deviceCode;
  594. if (assignmentUserList != null)
  595. map['AssignmentUserList'] = assignmentUserList;
  596. if (lastRecord != null)
  597. map['LastRecord'] = lastRecord;
  598. if (encryptFullName != null)
  599. map['EncryptFullName'] = encryptFullName;
  600. return map;
  601. }
  602. }
  603. class FindPatientByCodeRequest extends TokenRequest{
  604. String? code;
  605. FindPatientByCodeRequest({
  606. this.code,
  607. String? token,
  608. }) : super(
  609. token: token,
  610. );
  611. factory FindPatientByCodeRequest.fromJson(Map<String, dynamic> map) {
  612. return FindPatientByCodeRequest(
  613. code: map['Code'],
  614. token: map['Token'],
  615. );
  616. }
  617. Map<String, dynamic> toJson() {
  618. final map = super.toJson();
  619. if (code != null)
  620. map['Code'] = code;
  621. return map;
  622. }
  623. }
  624. class FindValidPatientsByNameRequest extends TokenRequest{
  625. String? name;
  626. FindValidPatientsByNameRequest({
  627. this.name,
  628. String? token,
  629. }) : super(
  630. token: token,
  631. );
  632. factory FindValidPatientsByNameRequest.fromJson(Map<String, dynamic> map) {
  633. return FindValidPatientsByNameRequest(
  634. name: map['Name'],
  635. token: map['Token'],
  636. );
  637. }
  638. Map<String, dynamic> toJson() {
  639. final map = super.toJson();
  640. if (name != null)
  641. map['Name'] = name;
  642. return map;
  643. }
  644. }
  645. class SetValidPatientRequest extends TokenRequest{
  646. String? newPatientCode;
  647. String? oldPatientCode;
  648. bool isFinishExam;
  649. SetValidPatientRequest({
  650. this.newPatientCode,
  651. this.oldPatientCode,
  652. this.isFinishExam = false,
  653. String? token,
  654. }) : super(
  655. token: token,
  656. );
  657. factory SetValidPatientRequest.fromJson(Map<String, dynamic> map) {
  658. return SetValidPatientRequest(
  659. newPatientCode: map['NewPatientCode'],
  660. oldPatientCode: map['OldPatientCode'],
  661. isFinishExam: map['IsFinishExam'],
  662. token: map['Token'],
  663. );
  664. }
  665. Map<String, dynamic> toJson() {
  666. final map = super.toJson();
  667. if (newPatientCode != null)
  668. map['NewPatientCode'] = newPatientCode;
  669. if (oldPatientCode != null)
  670. map['OldPatientCode'] = oldPatientCode;
  671. map['IsFinishExam'] = isFinishExam;
  672. return map;
  673. }
  674. }
  675. class RemovePatientsRequest extends TokenRequest{
  676. List<String>? patientCodes;
  677. RemovePatientsRequest({
  678. this.patientCodes,
  679. String? token,
  680. }) : super(
  681. token: token,
  682. );
  683. factory RemovePatientsRequest.fromJson(Map<String, dynamic> map) {
  684. return RemovePatientsRequest(
  685. patientCodes: map['PatientCodes']?.cast<String>().toList(),
  686. token: map['Token'],
  687. );
  688. }
  689. Map<String, dynamic> toJson() {
  690. final map = super.toJson();
  691. if (patientCodes != null)
  692. map['PatientCodes'] = patientCodes;
  693. return map;
  694. }
  695. }