remedical.m.dart 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. import 'package:fis_common/json_convert.dart';
  2. enum GenderTypeEnum {
  3. Male,
  4. Female,
  5. }
  6. enum PatientTypeEnum {
  7. Default,
  8. }
  9. class PatientInfo {
  10. String? patientCode;
  11. String? firstName;
  12. String? lastName;
  13. String? patientCardNo;
  14. DateTime? birthday;
  15. GenderTypeEnum genderType;
  16. String? patientCaseHistory;
  17. String? patientPhone;
  18. PatientTypeEnum patientType;
  19. String? id;
  20. DateTime? createTime;
  21. DateTime? updateTime;
  22. bool isDelete;
  23. PatientInfo({
  24. this.patientCode,
  25. this.firstName,
  26. this.lastName,
  27. this.patientCardNo,
  28. this.birthday,
  29. this.genderType=GenderTypeEnum.Male,
  30. this.patientCaseHistory,
  31. this.patientPhone,
  32. this.patientType=PatientTypeEnum.Default,
  33. this.id,
  34. this.createTime,
  35. this.updateTime,
  36. this.isDelete=false,
  37. });
  38. factory PatientInfo.fromJson(Map<String, dynamic> map) {
  39. return PatientInfo(
  40. patientCode: map['PatientCode'],
  41. firstName: map['FirstName'],
  42. lastName: map['LastName'],
  43. patientCardNo: map['PatientCardNo'],
  44. birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
  45. genderType: GenderTypeEnum.values.firstWhere((e) => e.index == map['GenderType']),
  46. patientCaseHistory: map['PatientCaseHistory'],
  47. patientPhone: map['PatientPhone'],
  48. patientType: PatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  49. id: map['Id'],
  50. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  51. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  52. isDelete: map['IsDelete'],
  53. );
  54. }
  55. Map<String, dynamic> toJson() {
  56. final map = Map<String, dynamic>();
  57. if(patientCode != null)
  58. map['PatientCode'] = patientCode;
  59. if(firstName != null)
  60. map['FirstName'] = firstName;
  61. if(lastName != null)
  62. map['LastName'] = lastName;
  63. if(patientCardNo != null)
  64. map['PatientCardNo'] = patientCardNo;
  65. if(birthday != null)
  66. map['Birthday'] = birthday;
  67. map['GenderType'] = genderType.index;
  68. if(patientCaseHistory != null)
  69. map['PatientCaseHistory'] = patientCaseHistory;
  70. if(patientPhone != null)
  71. map['PatientPhone'] = patientPhone;
  72. map['PatientType'] = patientType.index;
  73. if(id != null)
  74. map['Id'] = id;
  75. if(createTime != null)
  76. map['CreateTime'] = createTime;
  77. if(updateTime != null)
  78. map['UpdateTime'] = updateTime;
  79. map['IsDelete'] = isDelete;
  80. return map;
  81. }
  82. }
  83. class CreatePatientInfoRequest {
  84. PatientInfo? info;
  85. String? sessionId;
  86. CreatePatientInfoRequest({
  87. this.info,
  88. this.sessionId,
  89. });
  90. factory CreatePatientInfoRequest.fromJson(Map<String, dynamic> map) {
  91. return CreatePatientInfoRequest(
  92. info: map['Info'],
  93. sessionId: map['SessionId'],
  94. );
  95. }
  96. Map<String, dynamic> toJson() {
  97. final map = Map<String, dynamic>();
  98. if(info != null)
  99. map['Info'] = info;
  100. if(sessionId != null)
  101. map['SessionId'] = sessionId;
  102. return map;
  103. }
  104. }
  105. enum DeviceDataTypeEnum {
  106. Default,
  107. }
  108. class DeviceData {
  109. String? deviceDataCode;
  110. String? deviceCode;
  111. String? deviceFileCode;
  112. String? recordCode;
  113. String? patientCode;
  114. String? previewImageToken;
  115. String? dataToken;
  116. DeviceDataTypeEnum deviceDataType;
  117. String? processResult;
  118. String? id;
  119. DateTime? createTime;
  120. DateTime? updateTime;
  121. bool isDelete;
  122. DeviceData({
  123. this.deviceDataCode,
  124. this.deviceCode,
  125. this.deviceFileCode,
  126. this.recordCode,
  127. this.patientCode,
  128. this.previewImageToken,
  129. this.dataToken,
  130. this.deviceDataType=DeviceDataTypeEnum.Default,
  131. this.processResult,
  132. this.id,
  133. this.createTime,
  134. this.updateTime,
  135. this.isDelete=false,
  136. });
  137. factory DeviceData.fromJson(Map<String, dynamic> map) {
  138. return DeviceData(
  139. deviceDataCode: map['DeviceDataCode'],
  140. deviceCode: map['DeviceCode'],
  141. deviceFileCode: map['DeviceFileCode'],
  142. recordCode: map['RecordCode'],
  143. patientCode: map['PatientCode'],
  144. previewImageToken: map['PreviewImageToken'],
  145. dataToken: map['DataToken'],
  146. deviceDataType: DeviceDataTypeEnum.values.firstWhere((e) => e.index == map['DeviceDataType']),
  147. processResult: map['ProcessResult'],
  148. id: map['Id'],
  149. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  150. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  151. isDelete: map['IsDelete'],
  152. );
  153. }
  154. Map<String, dynamic> toJson() {
  155. final map = Map<String, dynamic>();
  156. if(deviceDataCode != null)
  157. map['DeviceDataCode'] = deviceDataCode;
  158. if(deviceCode != null)
  159. map['DeviceCode'] = deviceCode;
  160. if(deviceFileCode != null)
  161. map['DeviceFileCode'] = deviceFileCode;
  162. if(recordCode != null)
  163. map['RecordCode'] = recordCode;
  164. if(patientCode != null)
  165. map['PatientCode'] = patientCode;
  166. if(previewImageToken != null)
  167. map['PreviewImageToken'] = previewImageToken;
  168. if(dataToken != null)
  169. map['DataToken'] = dataToken;
  170. map['DeviceDataType'] = deviceDataType.index;
  171. if(processResult != null)
  172. map['ProcessResult'] = processResult;
  173. if(id != null)
  174. map['Id'] = id;
  175. if(createTime != null)
  176. map['CreateTime'] = createTime;
  177. if(updateTime != null)
  178. map['UpdateTime'] = updateTime;
  179. map['IsDelete'] = isDelete;
  180. return map;
  181. }
  182. }
  183. class CreateDeviceDataRequest {
  184. DeviceData? info;
  185. String? sessionId;
  186. CreateDeviceDataRequest({
  187. this.info,
  188. this.sessionId,
  189. });
  190. factory CreateDeviceDataRequest.fromJson(Map<String, dynamic> map) {
  191. return CreateDeviceDataRequest(
  192. info: map['Info'],
  193. sessionId: map['SessionId'],
  194. );
  195. }
  196. Map<String, dynamic> toJson() {
  197. final map = Map<String, dynamic>();
  198. if(info != null)
  199. map['Info'] = info;
  200. if(sessionId != null)
  201. map['SessionId'] = sessionId;
  202. return map;
  203. }
  204. }
  205. enum RecordTypeEnum {
  206. Ultrasound,
  207. Electrocardio,
  208. }
  209. enum CheckTypeEnum {
  210. Default,
  211. }
  212. enum RecordStatusEnum {
  213. Default,
  214. }
  215. class RecordInfo {
  216. String? recordCode;
  217. String? patientCode;
  218. String? patientName;
  219. String? orgName;
  220. RecordTypeEnum recordType;
  221. CheckTypeEnum checkType;
  222. String? localRecordCode;
  223. RecordStatusEnum recordStatus;
  224. String? recordRemark;
  225. String? tags;
  226. String? id;
  227. DateTime? createTime;
  228. DateTime? updateTime;
  229. bool isDelete;
  230. RecordInfo({
  231. this.recordCode,
  232. this.patientCode,
  233. this.patientName,
  234. this.orgName,
  235. this.recordType=RecordTypeEnum.Ultrasound,
  236. this.checkType=CheckTypeEnum.Default,
  237. this.localRecordCode,
  238. this.recordStatus=RecordStatusEnum.Default,
  239. this.recordRemark,
  240. this.tags,
  241. this.id,
  242. this.createTime,
  243. this.updateTime,
  244. this.isDelete=false,
  245. });
  246. factory RecordInfo.fromJson(Map<String, dynamic> map) {
  247. return RecordInfo(
  248. recordCode: map['RecordCode'],
  249. patientCode: map['PatientCode'],
  250. patientName: map['PatientName'],
  251. orgName: map['OrgName'],
  252. recordType: RecordTypeEnum.values.firstWhere((e) => e.index == map['RecordType']),
  253. checkType: CheckTypeEnum.values.firstWhere((e) => e.index == map['CheckType']),
  254. localRecordCode: map['LocalRecordCode'],
  255. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  256. recordRemark: map['RecordRemark'],
  257. tags: map['Tags'],
  258. id: map['Id'],
  259. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  260. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  261. isDelete: map['IsDelete'],
  262. );
  263. }
  264. Map<String, dynamic> toJson() {
  265. final map = Map<String, dynamic>();
  266. if(recordCode != null)
  267. map['RecordCode'] = recordCode;
  268. if(patientCode != null)
  269. map['PatientCode'] = patientCode;
  270. if(patientName != null)
  271. map['PatientName'] = patientName;
  272. if(orgName != null)
  273. map['OrgName'] = orgName;
  274. map['RecordType'] = recordType.index;
  275. map['CheckType'] = checkType.index;
  276. if(localRecordCode != null)
  277. map['LocalRecordCode'] = localRecordCode;
  278. map['RecordStatus'] = recordStatus.index;
  279. if(recordRemark != null)
  280. map['RecordRemark'] = recordRemark;
  281. if(tags != null)
  282. map['Tags'] = tags;
  283. if(id != null)
  284. map['Id'] = id;
  285. if(createTime != null)
  286. map['CreateTime'] = createTime;
  287. if(updateTime != null)
  288. map['UpdateTime'] = updateTime;
  289. map['IsDelete'] = isDelete;
  290. return map;
  291. }
  292. }
  293. class CreateRecordInfoRequest {
  294. RecordInfo? info;
  295. String? sessionId;
  296. CreateRecordInfoRequest({
  297. this.info,
  298. this.sessionId,
  299. });
  300. factory CreateRecordInfoRequest.fromJson(Map<String, dynamic> map) {
  301. return CreateRecordInfoRequest(
  302. info: map['Info'],
  303. sessionId: map['SessionId'],
  304. );
  305. }
  306. Map<String, dynamic> toJson() {
  307. final map = Map<String, dynamic>();
  308. if(info != null)
  309. map['Info'] = info;
  310. if(sessionId != null)
  311. map['SessionId'] = sessionId;
  312. return map;
  313. }
  314. }
  315. class GetDeviceDataDetailRequest {
  316. String? deviceDataCode;
  317. String? sessionId;
  318. GetDeviceDataDetailRequest({
  319. this.deviceDataCode,
  320. this.sessionId,
  321. });
  322. factory GetDeviceDataDetailRequest.fromJson(Map<String, dynamic> map) {
  323. return GetDeviceDataDetailRequest(
  324. deviceDataCode: map['DeviceDataCode'],
  325. sessionId: map['SessionId'],
  326. );
  327. }
  328. Map<String, dynamic> toJson() {
  329. final map = Map<String, dynamic>();
  330. if(deviceDataCode != null)
  331. map['DeviceDataCode'] = deviceDataCode;
  332. if(sessionId != null)
  333. map['SessionId'] = sessionId;
  334. return map;
  335. }
  336. }
  337. class GetRecordInfoDetailRequest {
  338. String? recordCode;
  339. String? sessionId;
  340. GetRecordInfoDetailRequest({
  341. this.recordCode,
  342. this.sessionId,
  343. });
  344. factory GetRecordInfoDetailRequest.fromJson(Map<String, dynamic> map) {
  345. return GetRecordInfoDetailRequest(
  346. recordCode: map['RecordCode'],
  347. sessionId: map['SessionId'],
  348. );
  349. }
  350. Map<String, dynamic> toJson() {
  351. final map = Map<String, dynamic>();
  352. if(recordCode != null)
  353. map['RecordCode'] = recordCode;
  354. if(sessionId != null)
  355. map['SessionId'] = sessionId;
  356. return map;
  357. }
  358. }
  359. class GetDeviceDataListRequest {
  360. String? recordCode;
  361. String? sessionId;
  362. GetDeviceDataListRequest({
  363. this.recordCode,
  364. this.sessionId,
  365. });
  366. factory GetDeviceDataListRequest.fromJson(Map<String, dynamic> map) {
  367. return GetDeviceDataListRequest(
  368. recordCode: map['RecordCode'],
  369. sessionId: map['SessionId'],
  370. );
  371. }
  372. Map<String, dynamic> toJson() {
  373. final map = Map<String, dynamic>();
  374. if(recordCode != null)
  375. map['RecordCode'] = recordCode;
  376. if(sessionId != null)
  377. map['SessionId'] = sessionId;
  378. return map;
  379. }
  380. }
  381. class PageCollection<T> {
  382. int currentPage;
  383. int pageSize;
  384. int dataCount;
  385. List<T>? pageData;
  386. PageCollection({
  387. this.currentPage=0,
  388. this.pageSize=0,
  389. this.dataCount=0,
  390. this.pageData,
  391. });
  392. factory PageCollection.fromJson(Map<String, dynamic> map) {
  393. List<T> pageDataList = [];
  394. if (map['PageData'] != null) {
  395. pageDataList.addAll(
  396. (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
  397. }
  398. return PageCollection(
  399. currentPage: map['CurrentPage'],
  400. pageSize: map['PageSize'],
  401. dataCount: map['DataCount'],
  402. pageData: pageDataList,
  403. );
  404. }
  405. Map<String, dynamic> toJson() {
  406. final map = Map<String, dynamic>();
  407. map['CurrentPage'] = currentPage;
  408. map['PageSize'] = pageSize;
  409. map['DataCount'] = dataCount;
  410. if(pageData != null)
  411. map['PageData'] = pageData;
  412. return map;
  413. }
  414. }
  415. class PageRequest {
  416. int currentPage;
  417. int pageSize;
  418. Map<String,String>? filter;
  419. String? sessionId;
  420. PageRequest({
  421. this.currentPage=0,
  422. this.pageSize=0,
  423. this.filter,
  424. this.sessionId,
  425. });
  426. factory PageRequest.fromJson(Map<String, dynamic> map) {
  427. return PageRequest(
  428. currentPage: map['CurrentPage'],
  429. pageSize: map['PageSize'],
  430. filter: map['Filter'].cast<String,String>(),
  431. sessionId: map['SessionId'],
  432. );
  433. }
  434. Map<String, dynamic> toJson() {
  435. final map = Map<String, dynamic>();
  436. map['CurrentPage'] = currentPage;
  437. map['PageSize'] = pageSize;
  438. if(filter != null)
  439. map['Filter'] = filter;
  440. if(sessionId != null)
  441. map['SessionId'] = sessionId;
  442. return map;
  443. }
  444. }
  445. class GetPatientInfoRequest {
  446. String? patientCode;
  447. String? sessionId;
  448. GetPatientInfoRequest({
  449. this.patientCode,
  450. this.sessionId,
  451. });
  452. factory GetPatientInfoRequest.fromJson(Map<String, dynamic> map) {
  453. return GetPatientInfoRequest(
  454. patientCode: map['PatientCode'],
  455. sessionId: map['SessionId'],
  456. );
  457. }
  458. Map<String, dynamic> toJson() {
  459. final map = Map<String, dynamic>();
  460. if(patientCode != null)
  461. map['PatientCode'] = patientCode;
  462. if(sessionId != null)
  463. map['SessionId'] = sessionId;
  464. return map;
  465. }
  466. }