patient.m.dart 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  1. import 'liveConsultation.m.dart';
  2. import 'aIDiagnosis.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. class CreatePatientRequest extends TokenRequest{
  5. List<DataItemDTO >? patientData;
  6. List<String >? assignmentUserCodes;
  7. CreatePatientRequest({
  8. this.patientData,
  9. this.assignmentUserCodes,
  10. String? token,
  11. }) : super(
  12. token: token,
  13. );
  14. factory CreatePatientRequest.fromJson(Map<String, dynamic> map) {
  15. return CreatePatientRequest(
  16. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  17. assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
  18. token: map['Token'],
  19. );
  20. }
  21. Map<String, dynamic> toJson() {
  22. final map = super.toJson();
  23. if(patientData != null)
  24. map['PatientData'] = patientData;
  25. if(assignmentUserCodes != null)
  26. map['AssignmentUserCodes'] = assignmentUserCodes;
  27. return map;
  28. }
  29. }
  30. class CreatePatientByUnregisteredRequest extends TokenRequest{
  31. String? unregisteredPatientCode;
  32. String? patientName;
  33. CreatePatientByUnregisteredRequest({
  34. this.unregisteredPatientCode,
  35. this.patientName,
  36. String? token,
  37. }) : super(
  38. token: token,
  39. );
  40. factory CreatePatientByUnregisteredRequest.fromJson(Map<String, dynamic> map) {
  41. return CreatePatientByUnregisteredRequest(
  42. unregisteredPatientCode: map['UnregisteredPatientCode'],
  43. patientName: map['PatientName'],
  44. token: map['Token'],
  45. );
  46. }
  47. Map<String, dynamic> toJson() {
  48. final map = super.toJson();
  49. if(unregisteredPatientCode != null)
  50. map['UnregisteredPatientCode'] = unregisteredPatientCode;
  51. if(patientName != null)
  52. map['PatientName'] = patientName;
  53. return map;
  54. }
  55. }
  56. class UpdatePatientRequest extends TokenRequest{
  57. String? code;
  58. List<DataItemDTO >? patientData;
  59. List<String >? assignmentUserCodes;
  60. UpdatePatientRequest({
  61. this.code,
  62. this.patientData,
  63. this.assignmentUserCodes,
  64. String? token,
  65. }) : super(
  66. token: token,
  67. );
  68. factory UpdatePatientRequest.fromJson(Map<String, dynamic> map) {
  69. return UpdatePatientRequest(
  70. code: map['Code'],
  71. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  72. assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
  73. token: map['Token'],
  74. );
  75. }
  76. Map<String, dynamic> toJson() {
  77. final map = super.toJson();
  78. if(code != null)
  79. map['Code'] = code;
  80. if(patientData != null)
  81. map['PatientData'] = patientData;
  82. if(assignmentUserCodes != null)
  83. map['AssignmentUserCodes'] = assignmentUserCodes;
  84. return map;
  85. }
  86. }
  87. class PatientInfoBaseDTO extends BaseDTO{
  88. String? patientCode;
  89. String? name;
  90. String? phone;
  91. String? identityCard;
  92. String? insuranceCode;
  93. String? age;
  94. int gender;
  95. bool isValid;
  96. String? organizationCode;
  97. String? rootOrganizationCode;
  98. List<String >? assignmentUserCodes;
  99. List<DataItemDTO >? patientData;
  100. int unReadRecordCount;
  101. String? headImgUrl;
  102. String? patientType;
  103. bool isReferral;
  104. List<String >? devicePatientIDs;
  105. PatientInfoBaseDTO({
  106. this.patientCode,
  107. this.name,
  108. this.phone,
  109. this.identityCard,
  110. this.insuranceCode,
  111. this.age,
  112. this.gender = 0,
  113. this.isValid = false,
  114. this.organizationCode,
  115. this.rootOrganizationCode,
  116. this.assignmentUserCodes,
  117. this.patientData,
  118. this.unReadRecordCount = 0,
  119. this.headImgUrl,
  120. this.patientType,
  121. this.isReferral = false,
  122. this.devicePatientIDs,
  123. DateTime? createTime,
  124. DateTime? updateTime,
  125. }) : super(
  126. createTime: createTime,
  127. updateTime: updateTime,
  128. );
  129. factory PatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
  130. return PatientInfoBaseDTO(
  131. patientCode: map['PatientCode'],
  132. name: map['Name'],
  133. phone: map['Phone'],
  134. identityCard: map['IdentityCard'],
  135. insuranceCode: map['InsuranceCode'],
  136. age: map['Age'],
  137. gender: map['Gender'],
  138. isValid: map['IsValid'],
  139. organizationCode: map['OrganizationCode'],
  140. rootOrganizationCode: map['RootOrganizationCode'],
  141. assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
  142. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  143. unReadRecordCount: map['UnReadRecordCount'],
  144. headImgUrl: map['HeadImgUrl'],
  145. patientType: map['PatientType'],
  146. isReferral: map['IsReferral'],
  147. devicePatientIDs: map['DevicePatientIDs'] != null ? map['DevicePatientIDs'].cast<String>().toList() : null,
  148. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  149. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  150. );
  151. }
  152. Map<String, dynamic> toJson() {
  153. final map = super.toJson();
  154. if(patientCode != null)
  155. map['PatientCode'] = patientCode;
  156. if(name != null)
  157. map['Name'] = name;
  158. if(phone != null)
  159. map['Phone'] = phone;
  160. if(identityCard != null)
  161. map['IdentityCard'] = identityCard;
  162. if(insuranceCode != null)
  163. map['InsuranceCode'] = insuranceCode;
  164. if(age != null)
  165. map['Age'] = age;
  166. map['Gender'] = gender;
  167. map['IsValid'] = isValid;
  168. if(organizationCode != null)
  169. map['OrganizationCode'] = organizationCode;
  170. if(rootOrganizationCode != null)
  171. map['RootOrganizationCode'] = rootOrganizationCode;
  172. if(assignmentUserCodes != null)
  173. map['AssignmentUserCodes'] = assignmentUserCodes;
  174. if(patientData != null)
  175. map['PatientData'] = patientData;
  176. map['UnReadRecordCount'] = unReadRecordCount;
  177. if(headImgUrl != null)
  178. map['HeadImgUrl'] = headImgUrl;
  179. if(patientType != null)
  180. map['PatientType'] = patientType;
  181. map['IsReferral'] = isReferral;
  182. if(devicePatientIDs != null)
  183. map['DevicePatientIDs'] = devicePatientIDs;
  184. return map;
  185. }
  186. }
  187. class PatientInfoDTO extends PatientInfoBaseDTO{
  188. String? creatorCode;
  189. String? deviceCode;
  190. List<String >? updateUsers;
  191. PatientInfoDTO({
  192. this.creatorCode,
  193. this.deviceCode,
  194. this.updateUsers,
  195. String? patientCode,
  196. String? name,
  197. String? phone,
  198. String? identityCard,
  199. String? insuranceCode,
  200. String? age,
  201. int gender = 0,
  202. bool isValid = false,
  203. String? organizationCode,
  204. String? rootOrganizationCode,
  205. List<String >? assignmentUserCodes,
  206. List<DataItemDTO >? patientData,
  207. int unReadRecordCount = 0,
  208. String? headImgUrl,
  209. String? patientType,
  210. bool isReferral = false,
  211. List<String >? devicePatientIDs,
  212. DateTime? createTime,
  213. DateTime? updateTime,
  214. }) : super(
  215. patientCode: patientCode,
  216. name: name,
  217. phone: phone,
  218. identityCard: identityCard,
  219. insuranceCode: insuranceCode,
  220. age: age,
  221. gender: gender,
  222. isValid: isValid,
  223. organizationCode: organizationCode,
  224. rootOrganizationCode: rootOrganizationCode,
  225. assignmentUserCodes: assignmentUserCodes,
  226. patientData: patientData,
  227. unReadRecordCount: unReadRecordCount,
  228. headImgUrl: headImgUrl,
  229. patientType: patientType,
  230. isReferral: isReferral,
  231. devicePatientIDs: devicePatientIDs,
  232. createTime: createTime,
  233. updateTime: updateTime,
  234. );
  235. factory PatientInfoDTO.fromJson(Map<String, dynamic> map) {
  236. return PatientInfoDTO(
  237. creatorCode: map['CreatorCode'],
  238. deviceCode: map['DeviceCode'],
  239. updateUsers: map['UpdateUsers'] != null ? map['UpdateUsers'].cast<String>().toList() : null,
  240. patientCode: map['PatientCode'],
  241. name: map['Name'],
  242. phone: map['Phone'],
  243. identityCard: map['IdentityCard'],
  244. insuranceCode: map['InsuranceCode'],
  245. age: map['Age'],
  246. gender: map['Gender'],
  247. isValid: map['IsValid'],
  248. organizationCode: map['OrganizationCode'],
  249. rootOrganizationCode: map['RootOrganizationCode'],
  250. assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
  251. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  252. unReadRecordCount: map['UnReadRecordCount'],
  253. headImgUrl: map['HeadImgUrl'],
  254. patientType: map['PatientType'],
  255. isReferral: map['IsReferral'],
  256. devicePatientIDs: map['DevicePatientIDs'] != null ? map['DevicePatientIDs'].cast<String>().toList() : null,
  257. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  258. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  259. );
  260. }
  261. Map<String, dynamic> toJson() {
  262. final map = super.toJson();
  263. if(creatorCode != null)
  264. map['CreatorCode'] = creatorCode;
  265. if(deviceCode != null)
  266. map['DeviceCode'] = deviceCode;
  267. if(updateUsers != null)
  268. map['UpdateUsers'] = updateUsers;
  269. return map;
  270. }
  271. }
  272. class CreatePatientsRequest extends TokenRequest{
  273. List<PatientInfoDTO >? patients;
  274. CreatePatientsRequest({
  275. this.patients,
  276. String? token,
  277. }) : super(
  278. token: token,
  279. );
  280. factory CreatePatientsRequest.fromJson(Map<String, dynamic> map) {
  281. return CreatePatientsRequest(
  282. patients: map['Patients'] != null ? (map['Patients'] as List).map((e)=>PatientInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  283. token: map['Token'],
  284. );
  285. }
  286. Map<String, dynamic> toJson() {
  287. final map = super.toJson();
  288. if(patients != null)
  289. map['Patients'] = patients;
  290. return map;
  291. }
  292. }
  293. enum PatientValidStatusEnum {
  294. All,
  295. CheckOut,
  296. CheckIn,
  297. }
  298. class FindPatientsPageRequest extends PageRequest{
  299. String? keyWord;
  300. DateTime? startTime;
  301. DateTime? endTime;
  302. PatientValidStatusEnum isValid;
  303. FindPatientsPageRequest({
  304. this.keyWord,
  305. this.startTime,
  306. this.endTime,
  307. this.isValid = PatientValidStatusEnum.All,
  308. int pageIndex = 0,
  309. int pageSize = 0,
  310. String? token,
  311. }) : super(
  312. pageIndex: pageIndex,
  313. pageSize: pageSize,
  314. token: token,
  315. );
  316. factory FindPatientsPageRequest.fromJson(Map<String, dynamic> map) {
  317. return FindPatientsPageRequest(
  318. keyWord: map['KeyWord'],
  319. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  320. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  321. isValid: PatientValidStatusEnum.values.firstWhere((e) => e.index == map['IsValid']),
  322. pageIndex: map['PageIndex'],
  323. pageSize: map['PageSize'],
  324. token: map['Token'],
  325. );
  326. }
  327. Map<String, dynamic> toJson() {
  328. final map = super.toJson();
  329. if(keyWord != null)
  330. map['KeyWord'] = keyWord;
  331. if(startTime != null)
  332. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  333. if(endTime != null)
  334. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  335. map['IsValid'] = isValid.index;
  336. return map;
  337. }
  338. }
  339. enum RecordStatusEnum {
  340. NotScanned,
  341. Uploaded,
  342. NotReport,
  343. Completed,
  344. }
  345. class TerminalImageDTO {
  346. String? previewUrl;
  347. String? imageUrl;
  348. String? coverImageUrl;
  349. RecommendedDownloadModeEnum recommendedDownloadMode;
  350. String? originImageUrl;
  351. int imageSize;
  352. TerminalImageDTO({
  353. this.previewUrl,
  354. this.imageUrl,
  355. this.coverImageUrl,
  356. this.recommendedDownloadMode = RecommendedDownloadModeEnum.Origin,
  357. this.originImageUrl,
  358. this.imageSize = 0,
  359. });
  360. factory TerminalImageDTO.fromJson(Map<String, dynamic> map) {
  361. return TerminalImageDTO(
  362. previewUrl: map['PreviewUrl'],
  363. imageUrl: map['ImageUrl'],
  364. coverImageUrl: map['CoverImageUrl'],
  365. recommendedDownloadMode: RecommendedDownloadModeEnum.values.firstWhere((e) => e.index == map['RecommendedDownloadMode']),
  366. originImageUrl: map['OriginImageUrl'],
  367. imageSize: map['ImageSize'],
  368. );
  369. }
  370. Map<String, dynamic> toJson() {
  371. final map = Map<String, dynamic>();
  372. if(previewUrl != null)
  373. map['PreviewUrl'] = previewUrl;
  374. if(imageUrl != null)
  375. map['ImageUrl'] = imageUrl;
  376. if(coverImageUrl != null)
  377. map['CoverImageUrl'] = coverImageUrl;
  378. map['RecommendedDownloadMode'] = recommendedDownloadMode.index;
  379. if(originImageUrl != null)
  380. map['OriginImageUrl'] = originImageUrl;
  381. map['ImageSize'] = imageSize;
  382. return map;
  383. }
  384. }
  385. class ImageLocationDTO {
  386. String? group;
  387. String? position;
  388. String? quadrant;
  389. ImageLocationDTO({
  390. this.group,
  391. this.position,
  392. this.quadrant,
  393. });
  394. factory ImageLocationDTO.fromJson(Map<String, dynamic> map) {
  395. return ImageLocationDTO(
  396. group: map['Group'],
  397. position: map['Position'],
  398. quadrant: map['Quadrant'],
  399. );
  400. }
  401. Map<String, dynamic> toJson() {
  402. final map = Map<String, dynamic>();
  403. if(group != null)
  404. map['Group'] = group;
  405. if(position != null)
  406. map['Position'] = position;
  407. if(quadrant != null)
  408. map['Quadrant'] = quadrant;
  409. return map;
  410. }
  411. }
  412. class ChildrenFetusNodeDTO {
  413. String? typeName;
  414. String? folderName;
  415. String? folderDescription;
  416. String? modeName;
  417. String? applicationId;
  418. String? application;
  419. List<String >? children;
  420. ChildrenFetusNodeDTO({
  421. this.typeName,
  422. this.folderName,
  423. this.folderDescription,
  424. this.modeName,
  425. this.applicationId,
  426. this.application,
  427. this.children,
  428. });
  429. factory ChildrenFetusNodeDTO.fromJson(Map<String, dynamic> map) {
  430. return ChildrenFetusNodeDTO(
  431. typeName: map['TypeName'],
  432. folderName: map['FolderName'],
  433. folderDescription: map['FolderDescription'],
  434. modeName: map['ModeName'],
  435. applicationId: map['ApplicationId'],
  436. application: map['Application'],
  437. children: map['Children'] != null ? map['Children'].cast<String>().toList() : null,
  438. );
  439. }
  440. Map<String, dynamic> toJson() {
  441. final map = Map<String, dynamic>();
  442. if(typeName != null)
  443. map['TypeName'] = typeName;
  444. if(folderName != null)
  445. map['FolderName'] = folderName;
  446. if(folderDescription != null)
  447. map['FolderDescription'] = folderDescription;
  448. if(modeName != null)
  449. map['ModeName'] = modeName;
  450. if(applicationId != null)
  451. map['ApplicationId'] = applicationId;
  452. if(application != null)
  453. map['Application'] = application;
  454. if(children != null)
  455. map['Children'] = children;
  456. return map;
  457. }
  458. }
  459. class FetusNodeDTO {
  460. String? typeName;
  461. String? fetusIndex;
  462. List<ChildrenFetusNodeDTO >? children;
  463. FetusNodeDTO({
  464. this.typeName,
  465. this.fetusIndex,
  466. this.children,
  467. });
  468. factory FetusNodeDTO.fromJson(Map<String, dynamic> map) {
  469. return FetusNodeDTO(
  470. typeName: map['TypeName'],
  471. fetusIndex: map['FetusIndex'],
  472. children: map['Children'] != null ? (map['Children'] as List).map((e)=>ChildrenFetusNodeDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  473. );
  474. }
  475. Map<String, dynamic> toJson() {
  476. final map = Map<String, dynamic>();
  477. if(typeName != null)
  478. map['TypeName'] = typeName;
  479. if(fetusIndex != null)
  480. map['FetusIndex'] = fetusIndex;
  481. if(children != null)
  482. map['Children'] = children;
  483. return map;
  484. }
  485. }
  486. class MeasuredResultsDTO {
  487. String? version;
  488. List<FetusNodeDTO >? fetusNodes;
  489. MeasuredResultsDTO({
  490. this.version,
  491. this.fetusNodes,
  492. });
  493. factory MeasuredResultsDTO.fromJson(Map<String, dynamic> map) {
  494. return MeasuredResultsDTO(
  495. version: map['Version'],
  496. fetusNodes: map['FetusNodes'] != null ? (map['FetusNodes'] as List).map((e)=>FetusNodeDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  497. );
  498. }
  499. Map<String, dynamic> toJson() {
  500. final map = Map<String, dynamic>();
  501. if(version != null)
  502. map['Version'] = version;
  503. if(fetusNodes != null)
  504. map['FetusNodes'] = fetusNodes;
  505. return map;
  506. }
  507. }
  508. class PointDTO {
  509. double x;
  510. double y;
  511. PointDTO({
  512. this.x = 0,
  513. this.y = 0,
  514. });
  515. factory PointDTO.fromJson(Map<String, dynamic> map) {
  516. return PointDTO(
  517. x: double.parse(map['x'].toString()),
  518. y: double.parse(map['y'].toString()),
  519. );
  520. }
  521. Map<String, dynamic> toJson() {
  522. final map = Map<String, dynamic>();
  523. map['x'] = x;
  524. map['y'] = y;
  525. return map;
  526. }
  527. }
  528. class AdornerDTO {
  529. String? adornerTypeName;
  530. PointDTO? topLeft;
  531. String? content;
  532. AdornerDTO({
  533. this.adornerTypeName,
  534. this.topLeft,
  535. this.content,
  536. });
  537. factory AdornerDTO.fromJson(Map<String, dynamic> map) {
  538. return AdornerDTO(
  539. adornerTypeName: map['AdornerTypeName'],
  540. topLeft: map['TopLeft'] != null ? PointDTO.fromJson(map['TopLeft']) : null,
  541. content: map['Content'],
  542. );
  543. }
  544. Map<String, dynamic> toJson() {
  545. final map = Map<String, dynamic>();
  546. if(adornerTypeName != null)
  547. map['AdornerTypeName'] = adornerTypeName;
  548. if(topLeft != null)
  549. map['TopLeft'] = topLeft;
  550. if(content != null)
  551. map['Content'] = content;
  552. return map;
  553. }
  554. }
  555. class BaseAreaDTO {
  556. String? visualAreaTypeName;
  557. List<AdornerDTO >? adorner;
  558. BaseAreaDTO({
  559. this.visualAreaTypeName,
  560. this.adorner,
  561. });
  562. factory BaseAreaDTO.fromJson(Map<String, dynamic> map) {
  563. return BaseAreaDTO(
  564. visualAreaTypeName: map['VisualAreaTypeName'],
  565. adorner: map['Adorner'] != null ? (map['Adorner'] as List).map((e)=>AdornerDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  566. );
  567. }
  568. Map<String, dynamic> toJson() {
  569. final map = Map<String, dynamic>();
  570. if(visualAreaTypeName != null)
  571. map['VisualAreaTypeName'] = visualAreaTypeName;
  572. if(adorner != null)
  573. map['Adorner'] = adorner;
  574. return map;
  575. }
  576. }
  577. class VisualAreaDTO {
  578. List<BaseAreaDTO >? children;
  579. VisualAreaDTO({
  580. this.children,
  581. });
  582. factory VisualAreaDTO.fromJson(Map<String, dynamic> map) {
  583. return VisualAreaDTO(
  584. children: map['Children'] != null ? (map['Children'] as List).map((e)=>BaseAreaDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  585. );
  586. }
  587. Map<String, dynamic> toJson() {
  588. final map = Map<String, dynamic>();
  589. if(children != null)
  590. map['Children'] = children;
  591. return map;
  592. }
  593. }
  594. class VisualKeyDTO {
  595. String? visualKeyTypeName;
  596. VisualAreaDTO? visualArea;
  597. VisualKeyDTO({
  598. this.visualKeyTypeName,
  599. this.visualArea,
  600. });
  601. factory VisualKeyDTO.fromJson(Map<String, dynamic> map) {
  602. return VisualKeyDTO(
  603. visualKeyTypeName: map['VisualKeyTypeName'],
  604. visualArea: map['VisualArea'] != null ? VisualAreaDTO.fromJson(map['VisualArea']) : null,
  605. );
  606. }
  607. Map<String, dynamic> toJson() {
  608. final map = Map<String, dynamic>();
  609. if(visualKeyTypeName != null)
  610. map['VisualKeyTypeName'] = visualKeyTypeName;
  611. if(visualArea != null)
  612. map['VisualArea'] = visualArea;
  613. return map;
  614. }
  615. }
  616. class VisualDTO {
  617. List<VisualKeyDTO >? children;
  618. VisualDTO({
  619. this.children,
  620. });
  621. factory VisualDTO.fromJson(Map<String, dynamic> map) {
  622. return VisualDTO(
  623. children: map['Children'] != null ? (map['Children'] as List).map((e)=>VisualKeyDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  624. );
  625. }
  626. Map<String, dynamic> toJson() {
  627. final map = Map<String, dynamic>();
  628. if(children != null)
  629. map['Children'] = children;
  630. return map;
  631. }
  632. }
  633. class ScanImageDTO {
  634. VisualDTO? visual;
  635. ScanImageDTO({
  636. this.visual,
  637. });
  638. factory ScanImageDTO.fromJson(Map<String, dynamic> map) {
  639. return ScanImageDTO(
  640. visual: map['Visual'] != null ? VisualDTO.fromJson(map['Visual']) : null,
  641. );
  642. }
  643. Map<String, dynamic> toJson() {
  644. final map = Map<String, dynamic>();
  645. if(visual != null)
  646. map['Visual'] = visual;
  647. return map;
  648. }
  649. }
  650. class RemedicalInfoDTO extends BaseDTO{
  651. String? remedicalCode;
  652. String? deviceCode;
  653. String? recordCode;
  654. String? patientScanType;
  655. String? applicationCategory;
  656. String? application;
  657. TerminalImageDTO? terminalImages;
  658. RemedicalFileDataTypeEnum fileDataType;
  659. ImageLocationDTO? imageLocation;
  660. DiagnosisConclusionEnum diagnosisConclusion;
  661. String? diagnosisResult;
  662. List<DiagnosisOrganEnum >? diagnosisOrgans;
  663. MeasuredResultsDTO? measuredResult;
  664. ScanImageDTO? commentResult;
  665. CarotidResultDTO? carotidResult;
  666. RemedicalInfoDTO({
  667. this.remedicalCode,
  668. this.deviceCode,
  669. this.recordCode,
  670. this.patientScanType,
  671. this.applicationCategory,
  672. this.application,
  673. this.terminalImages,
  674. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  675. this.imageLocation,
  676. this.diagnosisConclusion = DiagnosisConclusionEnum.NotRequired,
  677. this.diagnosisResult,
  678. this.diagnosisOrgans,
  679. this.measuredResult,
  680. this.commentResult,
  681. this.carotidResult,
  682. DateTime? createTime,
  683. DateTime? updateTime,
  684. }) : super(
  685. createTime: createTime,
  686. updateTime: updateTime,
  687. );
  688. factory RemedicalInfoDTO.fromJson(Map<String, dynamic> map) {
  689. return RemedicalInfoDTO(
  690. remedicalCode: map['RemedicalCode'],
  691. deviceCode: map['DeviceCode'],
  692. recordCode: map['RecordCode'],
  693. patientScanType: map['PatientScanType'],
  694. applicationCategory: map['ApplicationCategory'],
  695. application: map['Application'],
  696. terminalImages: map['TerminalImages'] != null ? TerminalImageDTO.fromJson(map['TerminalImages']) : null,
  697. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  698. imageLocation: map['ImageLocation'] != null ? ImageLocationDTO.fromJson(map['ImageLocation']) : null,
  699. diagnosisConclusion: DiagnosisConclusionEnum.values.firstWhere((e) => e.index == map['DiagnosisConclusion']),
  700. diagnosisResult: map['DiagnosisResult'],
  701. diagnosisOrgans: map['DiagnosisOrgans'] != null ? (map['DiagnosisOrgans'] as List).map((e)=>DiagnosisOrganEnum.values.firstWhere((i) => i.index == e)).toList() : null,
  702. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  703. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  704. carotidResult: map['CarotidResult'] != null ? CarotidResultDTO.fromJson(map['CarotidResult']) : null,
  705. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  706. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  707. );
  708. }
  709. Map<String, dynamic> toJson() {
  710. final map = super.toJson();
  711. if(remedicalCode != null)
  712. map['RemedicalCode'] = remedicalCode;
  713. if(deviceCode != null)
  714. map['DeviceCode'] = deviceCode;
  715. if(recordCode != null)
  716. map['RecordCode'] = recordCode;
  717. if(patientScanType != null)
  718. map['PatientScanType'] = patientScanType;
  719. if(applicationCategory != null)
  720. map['ApplicationCategory'] = applicationCategory;
  721. if(application != null)
  722. map['Application'] = application;
  723. if(terminalImages != null)
  724. map['TerminalImages'] = terminalImages;
  725. map['FileDataType'] = fileDataType.index;
  726. if(imageLocation != null)
  727. map['ImageLocation'] = imageLocation;
  728. map['DiagnosisConclusion'] = diagnosisConclusion.index;
  729. if(diagnosisResult != null)
  730. map['DiagnosisResult'] = diagnosisResult;
  731. if(diagnosisOrgans != null)
  732. map['DiagnosisOrgans'] = diagnosisOrgans;
  733. if(measuredResult != null)
  734. map['MeasuredResult'] = measuredResult;
  735. if(commentResult != null)
  736. map['CommentResult'] = commentResult;
  737. if(carotidResult != null)
  738. map['CarotidResult'] = carotidResult;
  739. return map;
  740. }
  741. }
  742. enum DiagnosisStatusEnum {
  743. NotRequired,
  744. Under,
  745. Completed,
  746. }
  747. enum DiagnosisReportStatusEnum {
  748. NotRequired,
  749. Reporting,
  750. Reported,
  751. }
  752. class DiagnosisInfoDTO {
  753. DiagnosisOrganEnum diagnosisOrgan;
  754. DiagnosisConclusionEnum conclusion;
  755. DiagnosisReportStatusEnum reportStatus;
  756. DiagnosisInfoDTO({
  757. this.diagnosisOrgan = DiagnosisOrganEnum.Null,
  758. this.conclusion = DiagnosisConclusionEnum.NotRequired,
  759. this.reportStatus = DiagnosisReportStatusEnum.NotRequired,
  760. });
  761. factory DiagnosisInfoDTO.fromJson(Map<String, dynamic> map) {
  762. return DiagnosisInfoDTO(
  763. diagnosisOrgan: DiagnosisOrganEnum.values.firstWhere((e) => e.index == map['DiagnosisOrgan']),
  764. conclusion: DiagnosisConclusionEnum.values.firstWhere((e) => e.index == map['Conclusion']),
  765. reportStatus: DiagnosisReportStatusEnum.values.firstWhere((e) => e.index == map['ReportStatus']),
  766. );
  767. }
  768. Map<String, dynamic> toJson() {
  769. final map = Map<String, dynamic>();
  770. map['DiagnosisOrgan'] = diagnosisOrgan.index;
  771. map['Conclusion'] = conclusion.index;
  772. map['ReportStatus'] = reportStatus.index;
  773. return map;
  774. }
  775. }
  776. enum ReferralStatusEnum {
  777. Wait,
  778. Withdrawn,
  779. TimedOut,
  780. Accepted,
  781. Rejected,
  782. }
  783. class GetRecordsPageDTO {
  784. DateTime? createTime;
  785. String? deptName;
  786. String? creatorName;
  787. String? deviceName;
  788. String? reportNum;
  789. String? recordCode;
  790. RecordStatusEnum recordStatus;
  791. bool isRead;
  792. List<RemedicalInfoDTO >? remedicalList;
  793. DiagnosisStatusEnum diagnosisStatus;
  794. List<DiagnosisInfoDTO >? diagnosisInfos;
  795. bool isReferral;
  796. ReferralStatusEnum referralStatus;
  797. bool canCreateReport;
  798. GetRecordsPageDTO({
  799. this.createTime,
  800. this.deptName,
  801. this.creatorName,
  802. this.deviceName,
  803. this.reportNum,
  804. this.recordCode,
  805. this.recordStatus = RecordStatusEnum.NotScanned,
  806. this.isRead = false,
  807. this.remedicalList,
  808. this.diagnosisStatus = DiagnosisStatusEnum.NotRequired,
  809. this.diagnosisInfos,
  810. this.isReferral = false,
  811. this.referralStatus = ReferralStatusEnum.Wait,
  812. this.canCreateReport = false,
  813. });
  814. factory GetRecordsPageDTO.fromJson(Map<String, dynamic> map) {
  815. return GetRecordsPageDTO(
  816. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  817. deptName: map['DeptName'],
  818. creatorName: map['CreatorName'],
  819. deviceName: map['DeviceName'],
  820. reportNum: map['ReportNum'],
  821. recordCode: map['RecordCode'],
  822. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  823. isRead: map['IsRead'],
  824. remedicalList: map['RemedicalList'] != null ? (map['RemedicalList'] as List).map((e)=>RemedicalInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  825. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  826. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  827. isReferral: map['IsReferral'],
  828. referralStatus: ReferralStatusEnum.values.firstWhere((e) => e.index == map['ReferralStatus']),
  829. canCreateReport: map['CanCreateReport'],
  830. );
  831. }
  832. Map<String, dynamic> toJson() {
  833. final map = Map<String, dynamic>();
  834. if(createTime != null)
  835. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  836. if(deptName != null)
  837. map['DeptName'] = deptName;
  838. if(creatorName != null)
  839. map['CreatorName'] = creatorName;
  840. if(deviceName != null)
  841. map['DeviceName'] = deviceName;
  842. if(reportNum != null)
  843. map['ReportNum'] = reportNum;
  844. if(recordCode != null)
  845. map['RecordCode'] = recordCode;
  846. map['RecordStatus'] = recordStatus.index;
  847. map['IsRead'] = isRead;
  848. if(remedicalList != null)
  849. map['RemedicalList'] = remedicalList;
  850. map['DiagnosisStatus'] = diagnosisStatus.index;
  851. if(diagnosisInfos != null)
  852. map['DiagnosisInfos'] = diagnosisInfos;
  853. map['IsReferral'] = isReferral;
  854. map['ReferralStatus'] = referralStatus.index;
  855. map['CanCreateReport'] = canCreateReport;
  856. return map;
  857. }
  858. }
  859. class ClientPatientInfoDTO extends ClientPatientInfoBaseDTO{
  860. String? creatorCode;
  861. String? creatorName;
  862. String? deviceCode;
  863. List<UserBaseDTO >? assignmentUserList;
  864. GetRecordsPageDTO? lastRecord;
  865. String? encryptFullName;
  866. ClientPatientInfoDTO({
  867. this.creatorCode,
  868. this.creatorName,
  869. this.deviceCode,
  870. this.assignmentUserList,
  871. this.lastRecord,
  872. this.encryptFullName,
  873. String? patientCode,
  874. bool isValid = false,
  875. List<DataItemDTO >? patientData,
  876. int unReadRecordCount = 0,
  877. bool isReferral = false,
  878. List<String >? devicePatientIDs,
  879. DateTime? createTime,
  880. DateTime? updateTime,
  881. }) : super(
  882. patientCode: patientCode,
  883. isValid: isValid,
  884. patientData: patientData,
  885. unReadRecordCount: unReadRecordCount,
  886. isReferral: isReferral,
  887. devicePatientIDs: devicePatientIDs,
  888. createTime: createTime,
  889. updateTime: updateTime,
  890. );
  891. factory ClientPatientInfoDTO.fromJson(Map<String, dynamic> map) {
  892. return ClientPatientInfoDTO(
  893. creatorCode: map['CreatorCode'],
  894. creatorName: map['CreatorName'],
  895. deviceCode: map['DeviceCode'],
  896. assignmentUserList: map['AssignmentUserList'] != null ? (map['AssignmentUserList'] as List).map((e)=>UserBaseDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  897. lastRecord: map['LastRecord'] != null ? GetRecordsPageDTO.fromJson(map['LastRecord']) : null,
  898. encryptFullName: map['EncryptFullName'],
  899. patientCode: map['PatientCode'],
  900. isValid: map['IsValid'],
  901. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  902. unReadRecordCount: map['UnReadRecordCount'],
  903. isReferral: map['IsReferral'],
  904. devicePatientIDs: map['DevicePatientIDs'] != null ? map['DevicePatientIDs'].cast<String>().toList() : null,
  905. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  906. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  907. );
  908. }
  909. Map<String, dynamic> toJson() {
  910. final map = super.toJson();
  911. if(creatorCode != null)
  912. map['CreatorCode'] = creatorCode;
  913. if(creatorName != null)
  914. map['CreatorName'] = creatorName;
  915. if(deviceCode != null)
  916. map['DeviceCode'] = deviceCode;
  917. if(assignmentUserList != null)
  918. map['AssignmentUserList'] = assignmentUserList;
  919. if(lastRecord != null)
  920. map['LastRecord'] = lastRecord;
  921. if(encryptFullName != null)
  922. map['EncryptFullName'] = encryptFullName;
  923. return map;
  924. }
  925. }
  926. class FindPatientByCodeRequest extends TokenRequest{
  927. String? code;
  928. FindPatientByCodeRequest({
  929. this.code,
  930. String? token,
  931. }) : super(
  932. token: token,
  933. );
  934. factory FindPatientByCodeRequest.fromJson(Map<String, dynamic> map) {
  935. return FindPatientByCodeRequest(
  936. code: map['Code'],
  937. token: map['Token'],
  938. );
  939. }
  940. Map<String, dynamic> toJson() {
  941. final map = super.toJson();
  942. if(code != null)
  943. map['Code'] = code;
  944. return map;
  945. }
  946. }
  947. class FindValidPatientsByNameRequest extends TokenRequest{
  948. String? name;
  949. FindValidPatientsByNameRequest({
  950. this.name,
  951. String? token,
  952. }) : super(
  953. token: token,
  954. );
  955. factory FindValidPatientsByNameRequest.fromJson(Map<String, dynamic> map) {
  956. return FindValidPatientsByNameRequest(
  957. name: map['Name'],
  958. token: map['Token'],
  959. );
  960. }
  961. Map<String, dynamic> toJson() {
  962. final map = super.toJson();
  963. if(name != null)
  964. map['Name'] = name;
  965. return map;
  966. }
  967. }
  968. class SetValidPatientRequest extends TokenRequest{
  969. String? newPatientCode;
  970. String? oldPatientCode;
  971. bool isFinishExam;
  972. SetValidPatientRequest({
  973. this.newPatientCode,
  974. this.oldPatientCode,
  975. this.isFinishExam = false,
  976. String? token,
  977. }) : super(
  978. token: token,
  979. );
  980. factory SetValidPatientRequest.fromJson(Map<String, dynamic> map) {
  981. return SetValidPatientRequest(
  982. newPatientCode: map['NewPatientCode'],
  983. oldPatientCode: map['OldPatientCode'],
  984. isFinishExam: map['IsFinishExam'],
  985. token: map['Token'],
  986. );
  987. }
  988. Map<String, dynamic> toJson() {
  989. final map = super.toJson();
  990. if(newPatientCode != null)
  991. map['NewPatientCode'] = newPatientCode;
  992. if(oldPatientCode != null)
  993. map['OldPatientCode'] = oldPatientCode;
  994. map['IsFinishExam'] = isFinishExam;
  995. return map;
  996. }
  997. }
  998. class RemovePatientsRequest extends TokenRequest{
  999. List<String >? patientCodes;
  1000. RemovePatientsRequest({
  1001. this.patientCodes,
  1002. String? token,
  1003. }) : super(
  1004. token: token,
  1005. );
  1006. factory RemovePatientsRequest.fromJson(Map<String, dynamic> map) {
  1007. return RemovePatientsRequest(
  1008. patientCodes: map['PatientCodes'] != null ? map['PatientCodes'].cast<String>().toList() : null,
  1009. token: map['Token'],
  1010. );
  1011. }
  1012. Map<String, dynamic> toJson() {
  1013. final map = super.toJson();
  1014. if(patientCodes != null)
  1015. map['PatientCodes'] = patientCodes;
  1016. return map;
  1017. }
  1018. }