management.m.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. import 'package:fis_common/json_convert.dart';
  2. class AdminAccountInfo {
  3. String? adminCode;
  4. String? fatherCode;
  5. String? adminName;
  6. String? secretPassword;
  7. String? headImageToken;
  8. String? licenseKey;
  9. String? lastIP;
  10. String? phone;
  11. String? email;
  12. AdminAccountInfo({
  13. this.adminCode,
  14. this.fatherCode,
  15. this.adminName,
  16. this.secretPassword,
  17. this.headImageToken,
  18. this.licenseKey,
  19. this.lastIP,
  20. this.phone,
  21. this.email,
  22. });
  23. factory AdminAccountInfo.fromJson(Map<String, dynamic> map) {
  24. return AdminAccountInfo(
  25. adminCode: map['AdminCode'],
  26. fatherCode: map['FatherCode'],
  27. adminName: map['AdminName'],
  28. secretPassword: map['SecretPassword'],
  29. headImageToken: map['HeadImageToken'],
  30. licenseKey: map['LicenseKey'],
  31. lastIP: map['LastIP'],
  32. phone: map['Phone'],
  33. email: map['Email'],
  34. );
  35. }
  36. Map<String, dynamic> toJson() {
  37. final map = Map<String, dynamic>();
  38. if(adminCode != null)
  39. map['AdminCode'] = adminCode;
  40. if(fatherCode != null)
  41. map['FatherCode'] = fatherCode;
  42. if(adminName != null)
  43. map['AdminName'] = adminName;
  44. if(secretPassword != null)
  45. map['SecretPassword'] = secretPassword;
  46. if(headImageToken != null)
  47. map['HeadImageToken'] = headImageToken;
  48. if(licenseKey != null)
  49. map['LicenseKey'] = licenseKey;
  50. if(lastIP != null)
  51. map['LastIP'] = lastIP;
  52. if(phone != null)
  53. map['Phone'] = phone;
  54. if(email != null)
  55. map['Email'] = email;
  56. return map;
  57. }
  58. }
  59. class PageCollection<T> {
  60. int currentPage;
  61. int pageSize;
  62. int dataCount;
  63. List<T>? pageData;
  64. PageCollection({
  65. this.currentPage=0,
  66. this.pageSize=0,
  67. this.dataCount=0,
  68. this.pageData,
  69. });
  70. factory PageCollection.fromJson(Map<String, dynamic> map) {
  71. List<T> pageDataList = [];
  72. if (map['PageData'] != null) {
  73. pageDataList.addAll(
  74. (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
  75. }
  76. return PageCollection(
  77. currentPage: map['CurrentPage'],
  78. pageSize: map['PageSize'],
  79. dataCount: map['DataCount'],
  80. pageData: pageDataList,
  81. );
  82. }
  83. Map<String, dynamic> toJson() {
  84. final map = Map<String, dynamic>();
  85. map['CurrentPage'] = currentPage;
  86. map['PageSize'] = pageSize;
  87. map['DataCount'] = dataCount;
  88. if(pageData != null)
  89. map['PageData'] = pageData;
  90. return map;
  91. }
  92. }
  93. enum UserInfoStateEnum {
  94. Nonactivated,
  95. Activated,
  96. }
  97. class UserInfo {
  98. String? userCode;
  99. String? userName;
  100. String? phone;
  101. String? email;
  102. String? nickName;
  103. String? fullName;
  104. String? headImageToken;
  105. String? organizationCode;
  106. List<String>? authorityGroups;
  107. List<String>? bindDevices;
  108. int score;
  109. String? lastIP;
  110. UserInfoStateEnum userState;
  111. String? securityQuestion;
  112. String? securityAnswers;
  113. DateTime? createTime;
  114. DateTime? updateTime;
  115. UserInfo({
  116. this.userCode,
  117. this.userName,
  118. this.phone,
  119. this.email,
  120. this.nickName,
  121. this.fullName,
  122. this.headImageToken,
  123. this.organizationCode,
  124. this.authorityGroups,
  125. this.bindDevices,
  126. this.score=0,
  127. this.lastIP,
  128. this.userState=UserInfoStateEnum.Nonactivated,
  129. this.securityQuestion,
  130. this.securityAnswers,
  131. this.createTime,
  132. this.updateTime,
  133. });
  134. factory UserInfo.fromJson(Map<String, dynamic> map) {
  135. return UserInfo(
  136. userCode: map['UserCode'],
  137. userName: map['UserName'],
  138. phone: map['Phone'],
  139. email: map['Email'],
  140. nickName: map['NickName'],
  141. fullName: map['FullName'],
  142. headImageToken: map['HeadImageToken'],
  143. organizationCode: map['OrganizationCode'],
  144. authorityGroups: map['AuthorityGroups'].cast<String>().toList(),
  145. bindDevices: map['BindDevices'].cast<String>().toList(),
  146. score: map['Score'],
  147. lastIP: map['LastIP'],
  148. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  149. securityQuestion: map['SecurityQuestion'],
  150. securityAnswers: map['SecurityAnswers'],
  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 = Map<String, dynamic>();
  157. if(userCode != null)
  158. map['UserCode'] = userCode;
  159. if(userName != null)
  160. map['UserName'] = userName;
  161. if(phone != null)
  162. map['Phone'] = phone;
  163. if(email != null)
  164. map['Email'] = email;
  165. if(nickName != null)
  166. map['NickName'] = nickName;
  167. if(fullName != null)
  168. map['FullName'] = fullName;
  169. if(headImageToken != null)
  170. map['HeadImageToken'] = headImageToken;
  171. if(organizationCode != null)
  172. map['OrganizationCode'] = organizationCode;
  173. if(authorityGroups != null)
  174. map['AuthorityGroups'] = authorityGroups;
  175. if(bindDevices != null)
  176. map['BindDevices'] = bindDevices;
  177. map['Score'] = score;
  178. if(lastIP != null)
  179. map['LastIP'] = lastIP;
  180. map['UserState'] = userState.index;
  181. if(securityQuestion != null)
  182. map['SecurityQuestion'] = securityQuestion;
  183. if(securityAnswers != null)
  184. map['SecurityAnswers'] = securityAnswers;
  185. if(createTime != null)
  186. map['CreateTime'] = createTime;
  187. if(updateTime != null)
  188. map['UpdateTime'] = updateTime;
  189. return map;
  190. }
  191. }
  192. class ReportInfo {
  193. String? reportCode;
  194. String? snapShotReportTemplate;
  195. String? reportValuesJson;
  196. String? recordCode;
  197. String? reportUser;
  198. String? tags;
  199. String? reportImageUrl;
  200. String? reportHtmlRaw;
  201. ReportInfo({
  202. this.reportCode,
  203. this.snapShotReportTemplate,
  204. this.reportValuesJson,
  205. this.recordCode,
  206. this.reportUser,
  207. this.tags,
  208. this.reportImageUrl,
  209. this.reportHtmlRaw,
  210. });
  211. factory ReportInfo.fromJson(Map<String, dynamic> map) {
  212. return ReportInfo(
  213. reportCode: map['ReportCode'],
  214. snapShotReportTemplate: map['SnapShotReportTemplate'],
  215. reportValuesJson: map['ReportValuesJson'],
  216. recordCode: map['RecordCode'],
  217. reportUser: map['ReportUser'],
  218. tags: map['Tags'],
  219. reportImageUrl: map['ReportImageUrl'],
  220. reportHtmlRaw: map['ReportHtmlRaw'],
  221. );
  222. }
  223. Map<String, dynamic> toJson() {
  224. final map = Map<String, dynamic>();
  225. if(reportCode != null)
  226. map['ReportCode'] = reportCode;
  227. if(snapShotReportTemplate != null)
  228. map['SnapShotReportTemplate'] = snapShotReportTemplate;
  229. if(reportValuesJson != null)
  230. map['ReportValuesJson'] = reportValuesJson;
  231. if(recordCode != null)
  232. map['RecordCode'] = recordCode;
  233. if(reportUser != null)
  234. map['ReportUser'] = reportUser;
  235. if(tags != null)
  236. map['Tags'] = tags;
  237. if(reportImageUrl != null)
  238. map['ReportImageUrl'] = reportImageUrl;
  239. if(reportHtmlRaw != null)
  240. map['ReportHtmlRaw'] = reportHtmlRaw;
  241. return map;
  242. }
  243. }
  244. enum RecordTypeEnum {
  245. Ultrasound,
  246. Electrocardio,
  247. }
  248. enum CheckTypeEnum {
  249. Default,
  250. }
  251. enum RecordStatusEnum {
  252. Default,
  253. }
  254. class RecordInfo {
  255. String? recordCode;
  256. String? patientCode;
  257. String? patientName;
  258. String? orgName;
  259. RecordTypeEnum recordType;
  260. CheckTypeEnum checkType;
  261. String? localRecordCode;
  262. RecordStatusEnum recordStatus;
  263. String? recordRemark;
  264. String? tags;
  265. DateTime? createTime;
  266. DateTime? updateTime;
  267. RecordInfo({
  268. this.recordCode,
  269. this.patientCode,
  270. this.patientName,
  271. this.orgName,
  272. this.recordType=RecordTypeEnum.Ultrasound,
  273. this.checkType=CheckTypeEnum.Default,
  274. this.localRecordCode,
  275. this.recordStatus=RecordStatusEnum.Default,
  276. this.recordRemark,
  277. this.tags,
  278. this.createTime,
  279. this.updateTime,
  280. });
  281. factory RecordInfo.fromJson(Map<String, dynamic> map) {
  282. return RecordInfo(
  283. recordCode: map['RecordCode'],
  284. patientCode: map['PatientCode'],
  285. patientName: map['PatientName'],
  286. orgName: map['OrgName'],
  287. recordType: RecordTypeEnum.values.firstWhere((e) => e.index == map['RecordType']),
  288. checkType: CheckTypeEnum.values.firstWhere((e) => e.index == map['CheckType']),
  289. localRecordCode: map['LocalRecordCode'],
  290. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  291. recordRemark: map['RecordRemark'],
  292. tags: map['Tags'],
  293. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  294. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  295. );
  296. }
  297. Map<String, dynamic> toJson() {
  298. final map = Map<String, dynamic>();
  299. if(recordCode != null)
  300. map['RecordCode'] = recordCode;
  301. if(patientCode != null)
  302. map['PatientCode'] = patientCode;
  303. if(patientName != null)
  304. map['PatientName'] = patientName;
  305. if(orgName != null)
  306. map['OrgName'] = orgName;
  307. map['RecordType'] = recordType.index;
  308. map['CheckType'] = checkType.index;
  309. if(localRecordCode != null)
  310. map['LocalRecordCode'] = localRecordCode;
  311. map['RecordStatus'] = recordStatus.index;
  312. if(recordRemark != null)
  313. map['RecordRemark'] = recordRemark;
  314. if(tags != null)
  315. map['Tags'] = tags;
  316. if(createTime != null)
  317. map['CreateTime'] = createTime;
  318. if(updateTime != null)
  319. map['UpdateTime'] = updateTime;
  320. return map;
  321. }
  322. }
  323. enum DeviceDataTypeEnum {
  324. Default,
  325. }
  326. class DeviceData {
  327. String? deviceDataCode;
  328. String? deviceCode;
  329. String? deviceFileCode;
  330. String? recordCode;
  331. String? patientCode;
  332. String? previewImageToken;
  333. String? dataToken;
  334. DeviceDataTypeEnum deviceDataType;
  335. String? processResult;
  336. DateTime? createTime;
  337. DateTime? updateTime;
  338. DeviceData({
  339. this.deviceDataCode,
  340. this.deviceCode,
  341. this.deviceFileCode,
  342. this.recordCode,
  343. this.patientCode,
  344. this.previewImageToken,
  345. this.dataToken,
  346. this.deviceDataType=DeviceDataTypeEnum.Default,
  347. this.processResult,
  348. this.createTime,
  349. this.updateTime,
  350. });
  351. factory DeviceData.fromJson(Map<String, dynamic> map) {
  352. return DeviceData(
  353. deviceDataCode: map['DeviceDataCode'],
  354. deviceCode: map['DeviceCode'],
  355. deviceFileCode: map['DeviceFileCode'],
  356. recordCode: map['RecordCode'],
  357. patientCode: map['PatientCode'],
  358. previewImageToken: map['PreviewImageToken'],
  359. dataToken: map['DataToken'],
  360. deviceDataType: DeviceDataTypeEnum.values.firstWhere((e) => e.index == map['DeviceDataType']),
  361. processResult: map['ProcessResult'],
  362. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  363. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  364. );
  365. }
  366. Map<String, dynamic> toJson() {
  367. final map = Map<String, dynamic>();
  368. if(deviceDataCode != null)
  369. map['DeviceDataCode'] = deviceDataCode;
  370. if(deviceCode != null)
  371. map['DeviceCode'] = deviceCode;
  372. if(deviceFileCode != null)
  373. map['DeviceFileCode'] = deviceFileCode;
  374. if(recordCode != null)
  375. map['RecordCode'] = recordCode;
  376. if(patientCode != null)
  377. map['PatientCode'] = patientCode;
  378. if(previewImageToken != null)
  379. map['PreviewImageToken'] = previewImageToken;
  380. if(dataToken != null)
  381. map['DataToken'] = dataToken;
  382. map['DeviceDataType'] = deviceDataType.index;
  383. if(processResult != null)
  384. map['ProcessResult'] = processResult;
  385. if(createTime != null)
  386. map['CreateTime'] = createTime;
  387. if(updateTime != null)
  388. map['UpdateTime'] = updateTime;
  389. return map;
  390. }
  391. }
  392. enum GenderTypeEnum {
  393. Male,
  394. Female,
  395. }
  396. enum PatientTypeEnum {
  397. Default,
  398. }
  399. class PatientInfo {
  400. String? patientCode;
  401. String? firstName;
  402. String? lastName;
  403. String? patientCardNo;
  404. DateTime? birthday;
  405. GenderTypeEnum genderType;
  406. String? patientCaseHistory;
  407. String? patientPhone;
  408. PatientTypeEnum patientType;
  409. DateTime? createTime;
  410. DateTime? updateTime;
  411. PatientInfo({
  412. this.patientCode,
  413. this.firstName,
  414. this.lastName,
  415. this.patientCardNo,
  416. this.birthday,
  417. this.genderType=GenderTypeEnum.Male,
  418. this.patientCaseHistory,
  419. this.patientPhone,
  420. this.patientType=PatientTypeEnum.Default,
  421. this.createTime,
  422. this.updateTime,
  423. });
  424. factory PatientInfo.fromJson(Map<String, dynamic> map) {
  425. return PatientInfo(
  426. patientCode: map['PatientCode'],
  427. firstName: map['FirstName'],
  428. lastName: map['LastName'],
  429. patientCardNo: map['PatientCardNo'],
  430. birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
  431. genderType: GenderTypeEnum.values.firstWhere((e) => e.index == map['GenderType']),
  432. patientCaseHistory: map['PatientCaseHistory'],
  433. patientPhone: map['PatientPhone'],
  434. patientType: PatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  435. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  436. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  437. );
  438. }
  439. Map<String, dynamic> toJson() {
  440. final map = Map<String, dynamic>();
  441. if(patientCode != null)
  442. map['PatientCode'] = patientCode;
  443. if(firstName != null)
  444. map['FirstName'] = firstName;
  445. if(lastName != null)
  446. map['LastName'] = lastName;
  447. if(patientCardNo != null)
  448. map['PatientCardNo'] = patientCardNo;
  449. if(birthday != null)
  450. map['Birthday'] = birthday;
  451. map['GenderType'] = genderType.index;
  452. if(patientCaseHistory != null)
  453. map['PatientCaseHistory'] = patientCaseHistory;
  454. if(patientPhone != null)
  455. map['PatientPhone'] = patientPhone;
  456. map['PatientType'] = patientType.index;
  457. if(createTime != null)
  458. map['CreateTime'] = createTime;
  459. if(updateTime != null)
  460. map['UpdateTime'] = updateTime;
  461. return map;
  462. }
  463. }
  464. class MenuInfo {
  465. String? menuCode;
  466. String? menuName;
  467. String? menuType;
  468. String? menuShowName;
  469. int menuSort;
  470. String? menuFatherCode;
  471. MenuInfo({
  472. this.menuCode,
  473. this.menuName,
  474. this.menuType,
  475. this.menuShowName,
  476. this.menuSort=0,
  477. this.menuFatherCode,
  478. });
  479. factory MenuInfo.fromJson(Map<String, dynamic> map) {
  480. return MenuInfo(
  481. menuCode: map['MenuCode'],
  482. menuName: map['MenuName'],
  483. menuType: map['MenuType'],
  484. menuShowName: map['MenuShowName'],
  485. menuSort: map['MenuSort'],
  486. menuFatherCode: map['MenuFatherCode'],
  487. );
  488. }
  489. Map<String, dynamic> toJson() {
  490. final map = Map<String, dynamic>();
  491. if(menuCode != null)
  492. map['MenuCode'] = menuCode;
  493. if(menuName != null)
  494. map['MenuName'] = menuName;
  495. if(menuType != null)
  496. map['MenuType'] = menuType;
  497. if(menuShowName != null)
  498. map['MenuShowName'] = menuShowName;
  499. map['MenuSort'] = menuSort;
  500. if(menuFatherCode != null)
  501. map['MenuFatherCode'] = menuFatherCode;
  502. return map;
  503. }
  504. }
  505. class FrontAuthorityGroupInfo {
  506. String? frontGroupCode;
  507. String? description;
  508. List<String>? adminCodes;
  509. List<String>? features;
  510. bool isShow;
  511. FrontAuthorityGroupInfo({
  512. this.frontGroupCode,
  513. this.description,
  514. this.adminCodes,
  515. this.features,
  516. this.isShow=false,
  517. });
  518. factory FrontAuthorityGroupInfo.fromJson(Map<String, dynamic> map) {
  519. return FrontAuthorityGroupInfo(
  520. frontGroupCode: map['FrontGroupCode'],
  521. description: map['Description'],
  522. adminCodes: map['AdminCodes'].cast<String>().toList(),
  523. features: map['Features'].cast<String>().toList(),
  524. isShow: map['IsShow'],
  525. );
  526. }
  527. Map<String, dynamic> toJson() {
  528. final map = Map<String, dynamic>();
  529. if(frontGroupCode != null)
  530. map['FrontGroupCode'] = frontGroupCode;
  531. if(description != null)
  532. map['Description'] = description;
  533. if(adminCodes != null)
  534. map['AdminCodes'] = adminCodes;
  535. if(features != null)
  536. map['Features'] = features;
  537. map['IsShow'] = isShow;
  538. return map;
  539. }
  540. }