remedical.m.dart 11 KB

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