patient.m.dart 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  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? application;
  733. TerminalImageDTO? terminalImages;
  734. RemedicalFileDataTypeEnum fileDataType;
  735. ImageLocationDTO? imageLocation;
  736. DiagnosisConclusionEnum diagnosisConclusion;
  737. String? diagnosisResult;
  738. List<DiagnosisOrganEnum >? diagnosisOrgans;
  739. MeasuredResultsDTO? measuredResult;
  740. ScanImageDTO? commentResult;
  741. CarotidResultDTO? carotidResult;
  742. DateTime? createTime;
  743. DateTime? updateTime;
  744. RemedicalInfoDTO({
  745. this.remedicalCode,
  746. this.deviceCode,
  747. this.recordCode,
  748. this.patientScanType,
  749. this.application,
  750. this.terminalImages,
  751. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  752. this.imageLocation,
  753. this.diagnosisConclusion = DiagnosisConclusionEnum.NotRequired,
  754. this.diagnosisResult,
  755. this.diagnosisOrgans,
  756. this.measuredResult,
  757. this.commentResult,
  758. this.carotidResult,
  759. this.createTime,
  760. this.updateTime,
  761. });
  762. factory RemedicalInfoDTO.fromJson(Map<String, dynamic> map) {
  763. return RemedicalInfoDTO(
  764. remedicalCode: map['RemedicalCode'],
  765. deviceCode: map['DeviceCode'],
  766. recordCode: map['RecordCode'],
  767. patientScanType: map['PatientScanType'],
  768. application: map['Application'],
  769. terminalImages: map['TerminalImages'] != null ? TerminalImageDTO.fromJson(map['TerminalImages']) : null,
  770. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  771. imageLocation: map['ImageLocation'] != null ? ImageLocationDTO.fromJson(map['ImageLocation']) : null,
  772. diagnosisConclusion: DiagnosisConclusionEnum.values.firstWhere((e) => e.index == map['DiagnosisConclusion']),
  773. diagnosisResult: map['DiagnosisResult'],
  774. diagnosisOrgans: map['DiagnosisOrgans'] != null ? (map['DiagnosisOrgans'] as List).map((e)=>DiagnosisOrganEnum.values.firstWhere((i) => i.index == e)).toList() : null,
  775. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  776. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  777. carotidResult: map['CarotidResult'] != null ? CarotidResultDTO.fromJson(map['CarotidResult']) : null,
  778. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  779. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  780. );
  781. }
  782. Map<String, dynamic> toJson() {
  783. final map = super.toJson();
  784. return map;
  785. }
  786. }
  787. enum DiagnosisStatusEnum {
  788. NotRequired,
  789. Under,
  790. Completed,
  791. }
  792. enum DiagnosisReportStatusEnum {
  793. NotRequired,
  794. Reporting,
  795. Reported,
  796. }
  797. class DiagnosisInfoDTO {
  798. DiagnosisOrganEnum diagnosisOrgan;
  799. DiagnosisConclusionEnum conclusion;
  800. DiagnosisReportStatusEnum reportStatus;
  801. DiagnosisInfoDTO({
  802. this.diagnosisOrgan = DiagnosisOrganEnum.Null,
  803. this.conclusion = DiagnosisConclusionEnum.NotRequired,
  804. this.reportStatus = DiagnosisReportStatusEnum.NotRequired,
  805. });
  806. factory DiagnosisInfoDTO.fromJson(Map<String, dynamic> map) {
  807. return DiagnosisInfoDTO(
  808. diagnosisOrgan: DiagnosisOrganEnum.values.firstWhere((e) => e.index == map['DiagnosisOrgan']),
  809. conclusion: DiagnosisConclusionEnum.values.firstWhere((e) => e.index == map['Conclusion']),
  810. reportStatus: DiagnosisReportStatusEnum.values.firstWhere((e) => e.index == map['ReportStatus']),
  811. );
  812. }
  813. Map<String, dynamic> toJson() {
  814. final map = Map<String, dynamic>();
  815. map['DiagnosisOrgan'] = diagnosisOrgan.index;
  816. map['Conclusion'] = conclusion.index;
  817. map['ReportStatus'] = reportStatus.index;
  818. return map;
  819. }
  820. }
  821. enum ReferralStatusEnum {
  822. Wait,
  823. Withdrawn,
  824. TimedOut,
  825. Accepted,
  826. Rejected,
  827. }
  828. class GetRecordsPageDTO {
  829. DateTime? createTime;
  830. String? deptName;
  831. String? creatorName;
  832. String? deviceName;
  833. String? reportNum;
  834. String? recordCode;
  835. RecordStatusEnum recordStatus;
  836. bool isRead;
  837. List<RemedicalInfoDTO >? remedicalList;
  838. DiagnosisStatusEnum diagnosisStatus;
  839. List<DiagnosisInfoDTO >? diagnosisInfos;
  840. bool isReferral;
  841. ReferralStatusEnum referralStatus;
  842. GetRecordsPageDTO({
  843. this.createTime,
  844. this.deptName,
  845. this.creatorName,
  846. this.deviceName,
  847. this.reportNum,
  848. this.recordCode,
  849. this.recordStatus = RecordStatusEnum.NotScanned,
  850. this.isRead = false,
  851. this.remedicalList,
  852. this.diagnosisStatus = DiagnosisStatusEnum.NotRequired,
  853. this.diagnosisInfos,
  854. this.isReferral = false,
  855. this.referralStatus = ReferralStatusEnum.Wait,
  856. });
  857. factory GetRecordsPageDTO.fromJson(Map<String, dynamic> map) {
  858. return GetRecordsPageDTO(
  859. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  860. deptName: map['DeptName'],
  861. creatorName: map['CreatorName'],
  862. deviceName: map['DeviceName'],
  863. reportNum: map['ReportNum'],
  864. recordCode: map['RecordCode'],
  865. recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
  866. isRead: map['IsRead'],
  867. remedicalList: map['RemedicalList'] != null ? (map['RemedicalList'] as List).map((e)=>RemedicalInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  868. diagnosisStatus: DiagnosisStatusEnum.values.firstWhere((e) => e.index == map['DiagnosisStatus']),
  869. diagnosisInfos: map['DiagnosisInfos'] != null ? (map['DiagnosisInfos'] as List).map((e)=>DiagnosisInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  870. isReferral: map['IsReferral'],
  871. referralStatus: ReferralStatusEnum.values.firstWhere((e) => e.index == map['ReferralStatus']),
  872. );
  873. }
  874. Map<String, dynamic> toJson() {
  875. final map = Map<String, dynamic>();
  876. if(createTime != null)
  877. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  878. if(deptName != null)
  879. map['DeptName'] = deptName;
  880. if(creatorName != null)
  881. map['CreatorName'] = creatorName;
  882. if(deviceName != null)
  883. map['DeviceName'] = deviceName;
  884. if(reportNum != null)
  885. map['ReportNum'] = reportNum;
  886. if(recordCode != null)
  887. map['RecordCode'] = recordCode;
  888. map['RecordStatus'] = recordStatus.index;
  889. map['IsRead'] = isRead;
  890. if(remedicalList != null)
  891. map['RemedicalList'] = remedicalList;
  892. map['DiagnosisStatus'] = diagnosisStatus.index;
  893. if(diagnosisInfos != null)
  894. map['DiagnosisInfos'] = diagnosisInfos;
  895. map['IsReferral'] = isReferral;
  896. map['ReferralStatus'] = referralStatus.index;
  897. return map;
  898. }
  899. }
  900. class ClientPatientInfoDTO extends ClientPatientInfoBaseDTO{
  901. String? creatorCode;
  902. String? creatorName;
  903. String? deviceCode;
  904. List<UserBaseDTO >? assignmentUserList;
  905. GetRecordsPageDTO? lastRecord;
  906. String? encryptFullName;
  907. ClientPatientInfoDTO({
  908. this.creatorCode,
  909. this.creatorName,
  910. this.deviceCode,
  911. this.assignmentUserList,
  912. this.lastRecord,
  913. this.encryptFullName,
  914. String? patientCode,
  915. bool isValid = false,
  916. List<DataItemDTO >? patientData,
  917. int unReadRecordCount = 0,
  918. bool isReferral = false,
  919. DateTime? createTime,
  920. DateTime? updateTime,
  921. }) : super(
  922. patientCode: patientCode,
  923. isValid: isValid,
  924. patientData: patientData,
  925. unReadRecordCount: unReadRecordCount,
  926. isReferral: isReferral,
  927. createTime: createTime,
  928. updateTime: updateTime,
  929. );
  930. factory ClientPatientInfoDTO.fromJson(Map<String, dynamic> map) {
  931. return ClientPatientInfoDTO(
  932. creatorCode: map['CreatorCode'],
  933. creatorName: map['CreatorName'],
  934. deviceCode: map['DeviceCode'],
  935. assignmentUserList: map['AssignmentUserList'] != null ? (map['AssignmentUserList'] as List).map((e)=>UserBaseDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  936. lastRecord: map['LastRecord'] != null ? GetRecordsPageDTO.fromJson(map['LastRecord']) : null,
  937. encryptFullName: map['EncryptFullName'],
  938. patientCode: map['PatientCode'],
  939. isValid: map['IsValid'],
  940. patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  941. unReadRecordCount: map['UnReadRecordCount'],
  942. isReferral: map['IsReferral'],
  943. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  944. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  945. );
  946. }
  947. Map<String, dynamic> toJson() {
  948. final map = super.toJson();
  949. if(creatorCode != null)
  950. map['CreatorCode'] = creatorCode;
  951. if(creatorName != null)
  952. map['CreatorName'] = creatorName;
  953. if(deviceCode != null)
  954. map['DeviceCode'] = deviceCode;
  955. if(assignmentUserList != null)
  956. map['AssignmentUserList'] = assignmentUserList;
  957. if(lastRecord != null)
  958. map['LastRecord'] = lastRecord;
  959. if(encryptFullName != null)
  960. map['EncryptFullName'] = encryptFullName;
  961. return map;
  962. }
  963. }
  964. class FindPatientByCodeRequest extends TokenRequest{
  965. String? code;
  966. FindPatientByCodeRequest({
  967. this.code,
  968. String? token,
  969. }) : super(
  970. token: token,
  971. );
  972. factory FindPatientByCodeRequest.fromJson(Map<String, dynamic> map) {
  973. return FindPatientByCodeRequest(
  974. code: map['Code'],
  975. token: map['Token'],
  976. );
  977. }
  978. Map<String, dynamic> toJson() {
  979. final map = super.toJson();
  980. if(code != null)
  981. map['Code'] = code;
  982. return map;
  983. }
  984. }
  985. class FindValidPatientsByNameRequest extends TokenRequest{
  986. String? name;
  987. FindValidPatientsByNameRequest({
  988. this.name,
  989. String? token,
  990. }) : super(
  991. token: token,
  992. );
  993. factory FindValidPatientsByNameRequest.fromJson(Map<String, dynamic> map) {
  994. return FindValidPatientsByNameRequest(
  995. name: map['Name'],
  996. token: map['Token'],
  997. );
  998. }
  999. Map<String, dynamic> toJson() {
  1000. final map = super.toJson();
  1001. if(name != null)
  1002. map['Name'] = name;
  1003. return map;
  1004. }
  1005. }
  1006. class SetValidPatientRequest extends TokenRequest{
  1007. String? newPatientCode;
  1008. String? oldPatientCode;
  1009. bool isFinishExam;
  1010. SetValidPatientRequest({
  1011. this.newPatientCode,
  1012. this.oldPatientCode,
  1013. this.isFinishExam = false,
  1014. String? token,
  1015. }) : super(
  1016. token: token,
  1017. );
  1018. factory SetValidPatientRequest.fromJson(Map<String, dynamic> map) {
  1019. return SetValidPatientRequest(
  1020. newPatientCode: map['NewPatientCode'],
  1021. oldPatientCode: map['OldPatientCode'],
  1022. isFinishExam: map['IsFinishExam'],
  1023. token: map['Token'],
  1024. );
  1025. }
  1026. Map<String, dynamic> toJson() {
  1027. final map = super.toJson();
  1028. if(newPatientCode != null)
  1029. map['NewPatientCode'] = newPatientCode;
  1030. if(oldPatientCode != null)
  1031. map['OldPatientCode'] = oldPatientCode;
  1032. map['IsFinishExam'] = isFinishExam;
  1033. return map;
  1034. }
  1035. }
  1036. class RemovePatientsRequest extends TokenRequest{
  1037. List<String >? patientCodes;
  1038. RemovePatientsRequest({
  1039. this.patientCodes,
  1040. String? token,
  1041. }) : super(
  1042. token: token,
  1043. );
  1044. factory RemovePatientsRequest.fromJson(Map<String, dynamic> map) {
  1045. return RemovePatientsRequest(
  1046. patientCodes: map['PatientCodes'] != null ? map['PatientCodes'].cast<String>().toList() : null,
  1047. token: map['Token'],
  1048. );
  1049. }
  1050. Map<String, dynamic> toJson() {
  1051. final map = super.toJson();
  1052. if(patientCodes != null)
  1053. map['PatientCodes'] = patientCodes;
  1054. return map;
  1055. }
  1056. }