recordInfo.m.dart 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. import 'aIDiagnosis.m.dart';
  2. import 'patient.m.dart';
  3. import 'connect.m.dart';
  4. import 'authentication.m.dart';
  5. import 'organization.m.dart';
  6. import 'package:fis_jsonrpc/utils.dart';
  7. class PatientInfoExt {
  8. String? patientScanType;
  9. List<DataItemDTO>? content;
  10. PatientInfoExt({
  11. this.patientScanType,
  12. this.content,
  13. });
  14. factory PatientInfoExt.fromJson(Map<String, dynamic> map) {
  15. return PatientInfoExt(
  16. patientScanType: map['PatientScanType'],
  17. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  18. );
  19. }
  20. Map<String, dynamic> toJson() {
  21. final map = Map<String, dynamic>();
  22. if(patientScanType != null)
  23. map['PatientScanType'] = patientScanType;
  24. if(content != null)
  25. map['Content'] = content;
  26. return map;
  27. }
  28. }
  29. class CreateRecordRequest extends TokenRequest{
  30. String? patientCode;
  31. String? deviceCode;
  32. List<PatientInfoExt>? patientInfoExtList;
  33. CreateRecordRequest({
  34. this.patientCode,
  35. this.deviceCode,
  36. this.patientInfoExtList,
  37. String? token,
  38. }) : super(
  39. token: token,
  40. );
  41. factory CreateRecordRequest.fromJson(Map<String, dynamic> map) {
  42. return CreateRecordRequest(
  43. patientCode: map['PatientCode'],
  44. deviceCode: map['DeviceCode'],
  45. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  46. token: map['Token'],
  47. );
  48. }
  49. Map<String, dynamic> toJson() {
  50. final map = super.toJson();
  51. if(patientCode != null)
  52. map['PatientCode'] = patientCode;
  53. if(deviceCode != null)
  54. map['DeviceCode'] = deviceCode;
  55. if(patientInfoExtList != null)
  56. map['PatientInfoExtList'] = patientInfoExtList;
  57. return map;
  58. }
  59. }
  60. enum QueryRecordStatusEnum {
  61. All,
  62. NotScanned,
  63. Uploaded,
  64. NotReport,
  65. Completed,
  66. NotCompleted,
  67. }
  68. enum QueryRecordCreateTypeEnum {
  69. All,
  70. Reservation,
  71. Normal,
  72. }
  73. class GetRecordsPageRequest extends PageRequest{
  74. String? patientCode;
  75. QueryRecordStatusEnum queryRecordStatus;
  76. QueryRecordCreateTypeEnum queryRecordCreateType;
  77. GetRecordsPageRequest({
  78. this.patientCode,
  79. this.queryRecordStatus = QueryRecordStatusEnum.All,
  80. this.queryRecordCreateType = QueryRecordCreateTypeEnum.All,
  81. int pageIndex = 0,
  82. int pageSize = 0,
  83. String? token,
  84. }) : super(
  85. pageIndex: pageIndex,
  86. pageSize: pageSize,
  87. token: token,
  88. );
  89. factory GetRecordsPageRequest.fromJson(Map<String, dynamic> map) {
  90. return GetRecordsPageRequest(
  91. patientCode: map['PatientCode'],
  92. queryRecordStatus: QueryRecordStatusEnum.values.firstWhere((e) => e.index == map['QueryRecordStatus']),
  93. queryRecordCreateType: QueryRecordCreateTypeEnum.values.firstWhere((e) => e.index == map['QueryRecordCreateType']),
  94. pageIndex: map['PageIndex'],
  95. pageSize: map['PageSize'],
  96. token: map['Token'],
  97. );
  98. }
  99. Map<String, dynamic> toJson() {
  100. final map = super.toJson();
  101. if(patientCode != null)
  102. map['PatientCode'] = patientCode;
  103. map['QueryRecordStatus'] = queryRecordStatus.index;
  104. map['QueryRecordCreateType'] = queryRecordCreateType.index;
  105. return map;
  106. }
  107. }
  108. class QueryRecordResult {
  109. DateTime? createTime;
  110. String? deptName;
  111. String? patientName;
  112. String? patientAge;
  113. int patientSex;
  114. String? creatorName;
  115. String? deviceName;
  116. RecordStatusEnum recordStatus;
  117. List<PatientInfoExt>? patientInfoExtList;
  118. DiagnosisStatusEnum diagnosisStatus;
  119. List<DiagnosisInfoDTO>? diagnosisInfos;
  120. QueryRecordResult({
  121. this.createTime,
  122. this.deptName,
  123. this.patientName,
  124. this.patientAge,
  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. patientSex: map['PatientSex'],
  140. creatorName: map['CreatorName'],
  141. deviceName: map['DeviceName'],
  142. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  143. patientInfoExtList: map['PatientInfoExtList'] != null ? (map['PatientInfoExtList'] as List).map((e)=>PatientInfoExt.fromJson(e as Map<String,dynamic>)).toList() : null,
  144. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  145. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  146. );
  147. }
  148. Map<String, dynamic> toJson() {
  149. final map = Map<String, dynamic>();
  150. if(createTime != null)
  151. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  152. if(deptName != null)
  153. map['DeptName'] = deptName;
  154. if(patientName != null)
  155. map['PatientName'] = patientName;
  156. if(patientAge != null)
  157. map['PatientAge'] = patientAge;
  158. map['PatientSex'] = patientSex;
  159. if(creatorName != null)
  160. map['CreatorName'] = creatorName;
  161. if(deviceName != null)
  162. map['DeviceName'] = deviceName;
  163. map['RecordStatus'] = recordStatus.index;
  164. if(patientInfoExtList != null)
  165. map['PatientInfoExtList'] = patientInfoExtList;
  166. map['DiagnosisStatus'] = diagnosisStatus.index;
  167. if(diagnosisInfos != null)
  168. map['DiagnosisInfos'] = diagnosisInfos;
  169. return map;
  170. }
  171. }
  172. class QueryRecordRequest extends TokenRequest{
  173. String? recordCode;
  174. QueryRecordRequest({
  175. this.recordCode,
  176. String? token,
  177. }) : super(
  178. token: token,
  179. );
  180. factory QueryRecordRequest.fromJson(Map<String, dynamic> map) {
  181. return QueryRecordRequest(
  182. recordCode: map['RecordCode'],
  183. token: map['Token'],
  184. );
  185. }
  186. Map<String, dynamic> toJson() {
  187. final map = super.toJson();
  188. if(recordCode != null)
  189. map['RecordCode'] = recordCode;
  190. return map;
  191. }
  192. }
  193. class ProcessRecordDataResult {
  194. List<DataItemDTO>? content;
  195. ProcessRecordDataResult({
  196. this.content,
  197. });
  198. factory ProcessRecordDataResult.fromJson(Map<String, dynamic> map) {
  199. return ProcessRecordDataResult(
  200. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  201. );
  202. }
  203. Map<String, dynamic> toJson() {
  204. final map = Map<String, dynamic>();
  205. if(content != null)
  206. map['Content'] = content;
  207. return map;
  208. }
  209. }
  210. enum AnimalSpeciesEnum {
  211. Bovine,
  212. Canidae,
  213. Equidae,
  214. Felidae,
  215. Caprinae,
  216. Suidae,
  217. }
  218. class ProcessRecordDataRequest extends TokenRequest{
  219. String? methodName;
  220. List<DataItemDTO>? content;
  221. OrganizationPatientTypeEnum patientType;
  222. AnimalSpeciesEnum speciesEnum;
  223. ProcessRecordDataRequest({
  224. this.methodName,
  225. this.content,
  226. this.patientType = OrganizationPatientTypeEnum.Person,
  227. this.speciesEnum = AnimalSpeciesEnum.Bovine,
  228. String? token,
  229. }) : super(
  230. token: token,
  231. );
  232. factory ProcessRecordDataRequest.fromJson(Map<String, dynamic> map) {
  233. return ProcessRecordDataRequest(
  234. methodName: map['MethodName'],
  235. content: map['Content'] != null ? (map['Content'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  236. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  237. speciesEnum: AnimalSpeciesEnum.values.firstWhere((e) => e.index == map['SpeciesEnum']),
  238. token: map['Token'],
  239. );
  240. }
  241. Map<String, dynamic> toJson() {
  242. final map = super.toJson();
  243. if(methodName != null)
  244. map['MethodName'] = methodName;
  245. if(content != null)
  246. map['Content'] = content;
  247. map['PatientType'] = patientType.index;
  248. map['SpeciesEnum'] = speciesEnum.index;
  249. return map;
  250. }
  251. }
  252. class RelevanceRecordRequest extends TokenRequest{
  253. String? examCode;
  254. String? rservationCode;
  255. RelevanceRecordRequest({
  256. this.examCode,
  257. this.rservationCode,
  258. String? token,
  259. }) : super(
  260. token: token,
  261. );
  262. factory RelevanceRecordRequest.fromJson(Map<String, dynamic> map) {
  263. return RelevanceRecordRequest(
  264. examCode: map['ExamCode'],
  265. rservationCode: map['RservationCode'],
  266. token: map['Token'],
  267. );
  268. }
  269. Map<String, dynamic> toJson() {
  270. final map = super.toJson();
  271. if(examCode != null)
  272. map['ExamCode'] = examCode;
  273. if(rservationCode != null)
  274. map['RservationCode'] = rservationCode;
  275. return map;
  276. }
  277. }
  278. class FinishRecordRequest extends TokenRequest{
  279. String? recordCode;
  280. FinishRecordRequest({
  281. this.recordCode,
  282. String? token,
  283. }) : super(
  284. token: token,
  285. );
  286. factory FinishRecordRequest.fromJson(Map<String, dynamic> map) {
  287. return FinishRecordRequest(
  288. recordCode: map['RecordCode'],
  289. token: map['Token'],
  290. );
  291. }
  292. Map<String, dynamic> toJson() {
  293. final map = super.toJson();
  294. if(recordCode != null)
  295. map['RecordCode'] = recordCode;
  296. return map;
  297. }
  298. }