patient.m.dart 31 KB

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