recordInfo.m.dart 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. import 'liveConsultation.m.dart';
  2. import 'patient.m.dart';
  3. import 'notification.m.dart';
  4. import 'package:fis_jsonrpc/utils.dart';
  5. class PatientInfoExt {
  6. String? patientScanType;
  7. List<DataItemDTO >? content;
  8. PatientInfoExt({
  9. this.patientScanType,
  10. this.content,
  11. });
  12. factory PatientInfoExt.fromJson(Map<String, dynamic> map) {
  13. return PatientInfoExt(
  14. patientScanType: map['PatientScanType'],
  15. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  16. );
  17. }
  18. Map<String, dynamic> toJson() {
  19. final map = Map<String, dynamic>();
  20. if(patientScanType != null)
  21. map['PatientScanType'] = patientScanType;
  22. if(content != null)
  23. map['Content'] = content;
  24. return map;
  25. }
  26. }
  27. class CreateRecordRequest extends TokenRequest{
  28. String? patientCode;
  29. String? deviceCode;
  30. List<PatientInfoExt >? patientInfoExtList;
  31. CreateRecordRequest({
  32. this.patientCode,
  33. this.deviceCode,
  34. this.patientInfoExtList,
  35. String? token,
  36. }) : super(
  37. token: token,
  38. );
  39. factory CreateRecordRequest.fromJson(Map<String, dynamic> map) {
  40. return CreateRecordRequest(
  41. patientCode: map['PatientCode'],
  42. deviceCode: map['DeviceCode'],
  43. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  44. token: map['Token'],
  45. );
  46. }
  47. Map<String, dynamic> toJson() {
  48. final map = super.toJson();
  49. if(patientCode != null)
  50. map['PatientCode'] = patientCode;
  51. if(deviceCode != null)
  52. map['DeviceCode'] = deviceCode;
  53. if(patientInfoExtList != null)
  54. map['PatientInfoExtList'] = patientInfoExtList;
  55. return map;
  56. }
  57. }
  58. enum QueryRecordStatusEnum {
  59. All,
  60. NotScanned,
  61. Uploaded,
  62. NotReport,
  63. Completed,
  64. NotCompleted,
  65. }
  66. enum QueryRecordCreateTypeEnum {
  67. All,
  68. Reservation,
  69. Normal,
  70. }
  71. class GetRecordsPageRequest extends PageRequest{
  72. String? patientCode;
  73. QueryRecordStatusEnum queryRecordStatus;
  74. QueryRecordCreateTypeEnum queryRecordCreateType;
  75. GetRecordsPageRequest({
  76. this.patientCode,
  77. this.queryRecordStatus = QueryRecordStatusEnum.All,
  78. this.queryRecordCreateType = QueryRecordCreateTypeEnum.All,
  79. int pageIndex = 0,
  80. int pageSize = 0,
  81. String? token,
  82. }) : super(
  83. pageIndex: pageIndex,
  84. pageSize: pageSize,
  85. token: token,
  86. );
  87. factory GetRecordsPageRequest.fromJson(Map<String, dynamic> map) {
  88. return GetRecordsPageRequest(
  89. patientCode: map['PatientCode'],
  90. queryRecordStatus: QueryRecordStatusEnum.values.firstWhere((e) => e.index == map['QueryRecordStatus']),
  91. queryRecordCreateType: QueryRecordCreateTypeEnum.values.firstWhere((e) => e.index == map['QueryRecordCreateType']),
  92. pageIndex: map['PageIndex'],
  93. pageSize: map['PageSize'],
  94. token: map['Token'],
  95. );
  96. }
  97. Map<String, dynamic> toJson() {
  98. final map = super.toJson();
  99. if(patientCode != null)
  100. map['PatientCode'] = patientCode;
  101. map['QueryRecordStatus'] = queryRecordStatus.index;
  102. map['QueryRecordCreateType'] = queryRecordCreateType.index;
  103. return map;
  104. }
  105. }
  106. class QueryRecordResult {
  107. DateTime? createTime;
  108. String? deptName;
  109. String? patientName;
  110. String? patientAge;
  111. List<DataItemDTO >? patientAgeInfo;
  112. int patientSex;
  113. String? creatorName;
  114. String? deviceName;
  115. RecordStatusEnum recordStatus;
  116. List<PatientInfoExt >? patientInfoExtList;
  117. DiagnosisStatusEnum diagnosisStatus;
  118. List<DiagnosisInfoDTO >? diagnosisInfos;
  119. QueryRecordResult({
  120. this.createTime,
  121. this.deptName,
  122. this.patientName,
  123. this.patientAge,
  124. this.patientAgeInfo,
  125. this.patientSex = 0,
  126. this.creatorName,
  127. this.deviceName,
  128. this.recordStatus = RecordStatusEnum.NotScanned,
  129. this.patientInfoExtList,
  130. this.diagnosisStatus = DiagnosisStatusEnum.NotRequired,
  131. this.diagnosisInfos,
  132. });
  133. factory QueryRecordResult.fromJson(Map<String, dynamic> map) {
  134. return QueryRecordResult(
  135. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  136. deptName: map['DeptName'],
  137. patientName: map['PatientName'],
  138. patientAge: map['PatientAge'],
  139. patientAgeInfo: map['PatientAgeInfo'] != null ? (map['PatientAgeInfo'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  140. patientSex: map['PatientSex'],
  141. creatorName: map['CreatorName'],
  142. deviceName: map['DeviceName'],
  143. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  144. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  145. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  146. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  147. );
  148. }
  149. Map<String, dynamic> toJson() {
  150. final map = Map<String, dynamic>();
  151. if(createTime != null)
  152. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  153. if(deptName != null)
  154. map['DeptName'] = deptName;
  155. if(patientName != null)
  156. map['PatientName'] = patientName;
  157. if(patientAge != null)
  158. map['PatientAge'] = patientAge;
  159. if(patientAgeInfo != null)
  160. map['PatientAgeInfo'] = patientAgeInfo;
  161. map['PatientSex'] = patientSex;
  162. if(creatorName != null)
  163. map['CreatorName'] = creatorName;
  164. if(deviceName != null)
  165. map['DeviceName'] = deviceName;
  166. map['RecordStatus'] = recordStatus.index;
  167. if(patientInfoExtList != null)
  168. map['PatientInfoExtList'] = patientInfoExtList;
  169. map['DiagnosisStatus'] = diagnosisStatus.index;
  170. if(diagnosisInfos != null)
  171. map['DiagnosisInfos'] = diagnosisInfos;
  172. return map;
  173. }
  174. }
  175. class QueryRecordRequest extends TokenRequest{
  176. String? recordCode;
  177. QueryRecordRequest({
  178. this.recordCode,
  179. String? token,
  180. }) : super(
  181. token: token,
  182. );
  183. factory QueryRecordRequest.fromJson(Map<String, dynamic> map) {
  184. return QueryRecordRequest(
  185. recordCode: map['RecordCode'],
  186. token: map['Token'],
  187. );
  188. }
  189. Map<String, dynamic> toJson() {
  190. final map = super.toJson();
  191. if(recordCode != null)
  192. map['RecordCode'] = recordCode;
  193. return map;
  194. }
  195. }
  196. class ProcessRecordDataResult {
  197. List<DataItemDTO >? content;
  198. ProcessRecordDataResult({
  199. this.content,
  200. });
  201. factory ProcessRecordDataResult.fromJson(Map<String, dynamic> map) {
  202. return ProcessRecordDataResult(
  203. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  204. );
  205. }
  206. Map<String, dynamic> toJson() {
  207. final map = Map<String, dynamic>();
  208. if(content != null)
  209. map['Content'] = content;
  210. return map;
  211. }
  212. }
  213. enum AnimalSpeciesEnum {
  214. Bovine,
  215. Canidae,
  216. Equidae,
  217. Felidae,
  218. Caprinae,
  219. Suidae,
  220. }
  221. class ProcessRecordDataRequest extends TokenRequest{
  222. String? methodName;
  223. List<DataItemDTO >? content;
  224. OrganizationPatientTypeEnum patientType;
  225. AnimalSpeciesEnum speciesEnum;
  226. ProcessRecordDataRequest({
  227. this.methodName,
  228. this.content,
  229. this.patientType = OrganizationPatientTypeEnum.Person,
  230. this.speciesEnum = AnimalSpeciesEnum.Bovine,
  231. String? token,
  232. }) : super(
  233. token: token,
  234. );
  235. factory ProcessRecordDataRequest.fromJson(Map<String, dynamic> map) {
  236. return ProcessRecordDataRequest(
  237. methodName: map['MethodName'],
  238. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  239. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  240. speciesEnum: AnimalSpeciesEnum.values.firstWhere((e) => e.index == map['SpeciesEnum']),
  241. token: map['Token'],
  242. );
  243. }
  244. Map<String, dynamic> toJson() {
  245. final map = super.toJson();
  246. if(methodName != null)
  247. map['MethodName'] = methodName;
  248. if(content != null)
  249. map['Content'] = content;
  250. map['PatientType'] = patientType.index;
  251. map['SpeciesEnum'] = speciesEnum.index;
  252. return map;
  253. }
  254. }
  255. class RelevanceRecordRequest extends TokenRequest{
  256. String? examCode;
  257. String? rservationCode;
  258. RelevanceRecordRequest({
  259. this.examCode,
  260. this.rservationCode,
  261. String? token,
  262. }) : super(
  263. token: token,
  264. );
  265. factory RelevanceRecordRequest.fromJson(Map<String, dynamic> map) {
  266. return RelevanceRecordRequest(
  267. examCode: map['ExamCode'],
  268. rservationCode: map['RservationCode'],
  269. token: map['Token'],
  270. );
  271. }
  272. Map<String, dynamic> toJson() {
  273. final map = super.toJson();
  274. if(examCode != null)
  275. map['ExamCode'] = examCode;
  276. if(rservationCode != null)
  277. map['RservationCode'] = rservationCode;
  278. return map;
  279. }
  280. }
  281. class FinishRecordRequest extends TokenRequest{
  282. String? recordCode;
  283. FinishRecordRequest({
  284. this.recordCode,
  285. String? token,
  286. }) : super(
  287. token: token,
  288. );
  289. factory FinishRecordRequest.fromJson(Map<String, dynamic> map) {
  290. return FinishRecordRequest(
  291. recordCode: map['RecordCode'],
  292. token: map['Token'],
  293. );
  294. }
  295. Map<String, dynamic> toJson() {
  296. final map = super.toJson();
  297. if(recordCode != null)
  298. map['RecordCode'] = recordCode;
  299. return map;
  300. }
  301. }
  302. class AddRemedicalMeasuredInfoDTO {
  303. String? remedicalCode;
  304. int frameIndex;
  305. String? measuredFileToken;
  306. String? previewFileToken;
  307. String? measuredData;
  308. AddRemedicalMeasuredInfoDTO({
  309. this.remedicalCode,
  310. this.frameIndex = 0,
  311. this.measuredFileToken,
  312. this.previewFileToken,
  313. this.measuredData,
  314. });
  315. factory AddRemedicalMeasuredInfoDTO.fromJson(Map<String, dynamic> map) {
  316. return AddRemedicalMeasuredInfoDTO(
  317. remedicalCode: map['RemedicalCode'],
  318. frameIndex: map['FrameIndex'],
  319. measuredFileToken: map['MeasuredFileToken'],
  320. previewFileToken: map['PreviewFileToken'],
  321. measuredData: map['MeasuredData'],
  322. );
  323. }
  324. Map<String, dynamic> toJson() {
  325. final map = Map<String, dynamic>();
  326. if(remedicalCode != null)
  327. map['RemedicalCode'] = remedicalCode;
  328. map['FrameIndex'] = frameIndex;
  329. if(measuredFileToken != null)
  330. map['MeasuredFileToken'] = measuredFileToken;
  331. if(previewFileToken != null)
  332. map['PreviewFileToken'] = previewFileToken;
  333. if(measuredData != null)
  334. map['MeasuredData'] = measuredData;
  335. return map;
  336. }
  337. }
  338. class AddRemedicalMeasuredInfoRequest extends TokenRequest{
  339. BusinessTypeEnum businessType;
  340. String? recordCode;
  341. List<AddRemedicalMeasuredInfoDTO >? remedicalMeasuredInfos;
  342. AddRemedicalMeasuredInfoRequest({
  343. this.businessType = BusinessTypeEnum.RemoteDiagnosis,
  344. this.recordCode,
  345. this.remedicalMeasuredInfos,
  346. String? token,
  347. }) : super(
  348. token: token,
  349. );
  350. factory AddRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  351. return AddRemedicalMeasuredInfoRequest(
  352. businessType: BusinessTypeEnum.values.firstWhere((e) => e.index == map['BusinessType']),
  353. recordCode: map['RecordCode'],
  354. remedicalMeasuredInfos: map['RemedicalMeasuredInfos'] != null ? (map['RemedicalMeasuredInfos'] as List).map((e)=>AddRemedicalMeasuredInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  355. token: map['Token'],
  356. );
  357. }
  358. Map<String, dynamic> toJson() {
  359. final map = super.toJson();
  360. map['BusinessType'] = businessType.index;
  361. if(recordCode != null)
  362. map['RecordCode'] = recordCode;
  363. if(remedicalMeasuredInfos != null)
  364. map['RemedicalMeasuredInfos'] = remedicalMeasuredInfos;
  365. return map;
  366. }
  367. }
  368. class FindRemedicalMeasuredInfoRequest extends TokenRequest{
  369. BusinessTypeEnum businessType;
  370. String? recordCode;
  371. FindRemedicalMeasuredInfoRequest({
  372. this.businessType = BusinessTypeEnum.RemoteDiagnosis,
  373. this.recordCode,
  374. String? token,
  375. }) : super(
  376. token: token,
  377. );
  378. factory FindRemedicalMeasuredInfoRequest.fromJson(Map<String, dynamic> map) {
  379. return FindRemedicalMeasuredInfoRequest(
  380. businessType: BusinessTypeEnum.values.firstWhere((e) => e.index == map['BusinessType']),
  381. recordCode: map['RecordCode'],
  382. token: map['Token'],
  383. );
  384. }
  385. Map<String, dynamic> toJson() {
  386. final map = super.toJson();
  387. map['BusinessType'] = businessType.index;
  388. if(recordCode != null)
  389. map['RecordCode'] = recordCode;
  390. return map;
  391. }
  392. }