user.m.dart 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'upgrade.m.dart';
  4. import 'package:fis_jsonrpc/utils.dart';
  5. class GetUserInfoRequest extends TokenRequest{
  6. GetUserInfoRequest({
  7. String? token,
  8. }) : super(
  9. token: token,
  10. );
  11. factory GetUserInfoRequest.fromJson(Map<String, dynamic> map) {
  12. return GetUserInfoRequest(
  13. token: map['Token'],
  14. );
  15. }
  16. Map<String, dynamic> toJson() {
  17. final map = super.toJson();
  18. return map;
  19. }
  20. }
  21. class AlterUserInfoRequest extends TokenRequest{
  22. String? phone;
  23. String? email;
  24. String? nickName;
  25. String? fullName;
  26. String? headImageUrl;
  27. String? organizationCode;
  28. String? extensionData;
  29. AlterUserInfoRequest({
  30. this.phone,
  31. this.email,
  32. this.nickName,
  33. this.fullName,
  34. this.headImageUrl,
  35. this.organizationCode,
  36. this.extensionData,
  37. String? token,
  38. }) : super(
  39. token: token,
  40. );
  41. factory AlterUserInfoRequest.fromJson(Map<String, dynamic> map) {
  42. return AlterUserInfoRequest(
  43. phone: map['Phone'],
  44. email: map['Email'],
  45. nickName: map['NickName'],
  46. fullName: map['FullName'],
  47. headImageUrl: map['HeadImageUrl'],
  48. organizationCode: map['OrganizationCode'],
  49. extensionData: map['ExtensionData'],
  50. token: map['Token'],
  51. );
  52. }
  53. Map<String, dynamic> toJson() {
  54. final map = super.toJson();
  55. if(phone != null)
  56. map['Phone'] = phone;
  57. if(email != null)
  58. map['Email'] = email;
  59. if(nickName != null)
  60. map['NickName'] = nickName;
  61. if(fullName != null)
  62. map['FullName'] = fullName;
  63. if(headImageUrl != null)
  64. map['HeadImageUrl'] = headImageUrl;
  65. if(organizationCode != null)
  66. map['OrganizationCode'] = organizationCode;
  67. if(extensionData != null)
  68. map['ExtensionData'] = extensionData;
  69. return map;
  70. }
  71. }
  72. class RemoveUsersFromOrganizationRequest extends TokenRequest{
  73. List<String >? userCodes;
  74. RemoveUsersFromOrganizationRequest({
  75. this.userCodes,
  76. String? token,
  77. }) : super(
  78. token: token,
  79. );
  80. factory RemoveUsersFromOrganizationRequest.fromJson(Map<String, dynamic> map) {
  81. return RemoveUsersFromOrganizationRequest(
  82. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  83. token: map['Token'],
  84. );
  85. }
  86. Map<String, dynamic> toJson() {
  87. final map = super.toJson();
  88. if(userCodes != null)
  89. map['UserCodes'] = userCodes;
  90. return map;
  91. }
  92. }
  93. class SetUserOrganizationInfoRequest extends TokenRequest{
  94. String? userCode;
  95. List<String >? roleCodes;
  96. List<String >? rankCodes;
  97. List<String >? positionCodes;
  98. String? organizationCode;
  99. SetUserOrganizationInfoRequest({
  100. this.userCode,
  101. this.roleCodes,
  102. this.rankCodes,
  103. this.positionCodes,
  104. this.organizationCode,
  105. String? token,
  106. }) : super(
  107. token: token,
  108. );
  109. factory SetUserOrganizationInfoRequest.fromJson(Map<String, dynamic> map) {
  110. return SetUserOrganizationInfoRequest(
  111. userCode: map['UserCode'],
  112. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  113. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  114. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  115. organizationCode: map['OrganizationCode'],
  116. token: map['Token'],
  117. );
  118. }
  119. Map<String, dynamic> toJson() {
  120. final map = super.toJson();
  121. if(userCode != null)
  122. map['UserCode'] = userCode;
  123. if(roleCodes != null)
  124. map['RoleCodes'] = roleCodes;
  125. if(rankCodes != null)
  126. map['RankCodes'] = rankCodes;
  127. if(positionCodes != null)
  128. map['PositionCodes'] = positionCodes;
  129. if(organizationCode != null)
  130. map['OrganizationCode'] = organizationCode;
  131. return map;
  132. }
  133. }
  134. class AlterPersonInfoRequest {
  135. String? token;
  136. String? nickName;
  137. String? headImageUrl;
  138. AlterPersonInfoRequest({
  139. this.token,
  140. this.nickName,
  141. this.headImageUrl,
  142. });
  143. factory AlterPersonInfoRequest.fromJson(Map<String, dynamic> map) {
  144. return AlterPersonInfoRequest(
  145. token: map['Token'],
  146. nickName: map['NickName'],
  147. headImageUrl: map['HeadImageUrl'],
  148. );
  149. }
  150. Map<String, dynamic> toJson() {
  151. final map = Map<String, dynamic>();
  152. if(token != null)
  153. map['Token'] = token;
  154. if(nickName != null)
  155. map['NickName'] = nickName;
  156. if(headImageUrl != null)
  157. map['HeadImageUrl'] = headImageUrl;
  158. return map;
  159. }
  160. }
  161. class ShareDeviceUserDTO extends BaseDTO{
  162. String? userCode;
  163. String? fullName;
  164. String? userName;
  165. String? displayName;
  166. String? phone;
  167. String? headImageUrl;
  168. List<String >? rankNames;
  169. String? rootOrganizationCode;
  170. String? rootOrganizationName;
  171. ShareDeviceUserDTO({
  172. this.userCode,
  173. this.fullName,
  174. this.userName,
  175. this.displayName,
  176. this.phone,
  177. this.headImageUrl,
  178. this.rankNames,
  179. this.rootOrganizationCode,
  180. this.rootOrganizationName,
  181. DateTime? createTime,
  182. DateTime? updateTime,
  183. }) : super(
  184. createTime: createTime,
  185. updateTime: updateTime,
  186. );
  187. factory ShareDeviceUserDTO.fromJson(Map<String, dynamic> map) {
  188. return ShareDeviceUserDTO(
  189. userCode: map['UserCode'],
  190. fullName: map['FullName'],
  191. userName: map['UserName'],
  192. displayName: map['DisplayName'],
  193. phone: map['Phone'],
  194. headImageUrl: map['HeadImageUrl'],
  195. rankNames: map['RankNames'] != null ? map['RankNames'].cast<String>().toList() : null,
  196. rootOrganizationCode: map['RootOrganizationCode'],
  197. rootOrganizationName: map['RootOrganizationName'],
  198. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  199. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  200. );
  201. }
  202. Map<String, dynamic> toJson() {
  203. final map = super.toJson();
  204. if(userCode != null)
  205. map['UserCode'] = userCode;
  206. if(fullName != null)
  207. map['FullName'] = fullName;
  208. if(userName != null)
  209. map['UserName'] = userName;
  210. if(displayName != null)
  211. map['DisplayName'] = displayName;
  212. if(phone != null)
  213. map['Phone'] = phone;
  214. if(headImageUrl != null)
  215. map['HeadImageUrl'] = headImageUrl;
  216. if(rankNames != null)
  217. map['RankNames'] = rankNames;
  218. if(rootOrganizationCode != null)
  219. map['RootOrganizationCode'] = rootOrganizationCode;
  220. if(rootOrganizationName != null)
  221. map['RootOrganizationName'] = rootOrganizationName;
  222. return map;
  223. }
  224. }
  225. class GetShareDeviceUsersPageRequest extends PageRequest{
  226. String? deviceCode;
  227. GetShareDeviceUsersPageRequest({
  228. this.deviceCode,
  229. int pageIndex = 0,
  230. int pageSize = 0,
  231. String? token,
  232. }) : super(
  233. pageIndex: pageIndex,
  234. pageSize: pageSize,
  235. token: token,
  236. );
  237. factory GetShareDeviceUsersPageRequest.fromJson(Map<String, dynamic> map) {
  238. return GetShareDeviceUsersPageRequest(
  239. deviceCode: map['DeviceCode'],
  240. pageIndex: map['PageIndex'],
  241. pageSize: map['PageSize'],
  242. token: map['Token'],
  243. );
  244. }
  245. Map<String, dynamic> toJson() {
  246. final map = super.toJson();
  247. if(deviceCode != null)
  248. map['DeviceCode'] = deviceCode;
  249. return map;
  250. }
  251. }
  252. class UserFeatureInfoResult {
  253. String? featureCode;
  254. String? featureName;
  255. String? fatherCode;
  256. String? uniqueCode;
  257. UserFeatureInfoResult({
  258. this.featureCode,
  259. this.featureName,
  260. this.fatherCode,
  261. this.uniqueCode,
  262. });
  263. factory UserFeatureInfoResult.fromJson(Map<String, dynamic> map) {
  264. return UserFeatureInfoResult(
  265. featureCode: map['FeatureCode'],
  266. featureName: map['FeatureName'],
  267. fatherCode: map['FatherCode'],
  268. uniqueCode: map['UniqueCode'],
  269. );
  270. }
  271. Map<String, dynamic> toJson() {
  272. final map = Map<String, dynamic>();
  273. if(featureCode != null)
  274. map['FeatureCode'] = featureCode;
  275. if(featureName != null)
  276. map['FeatureName'] = featureName;
  277. if(fatherCode != null)
  278. map['FatherCode'] = fatherCode;
  279. if(uniqueCode != null)
  280. map['UniqueCode'] = uniqueCode;
  281. return map;
  282. }
  283. }
  284. class UserInfoByCodeDTO extends UserDTO{
  285. String? bindAssistantUserName;
  286. String? bindAssistantDoctorUserName;
  287. UserInfoByCodeDTO({
  288. this.bindAssistantUserName,
  289. this.bindAssistantDoctorUserName,
  290. String? nickName,
  291. String? organizationCode,
  292. String? organizationName,
  293. String? rootOrganizationCode,
  294. String? rootOrganizationName,
  295. List<String >? authorityGroups,
  296. List<String >? bindDevices,
  297. String? lastIP,
  298. int logintimes = 0,
  299. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  300. List<String >? roleCodes,
  301. List<String >? rankCodes,
  302. List<String >? positionCodes,
  303. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  304. String? rankName,
  305. String? positionName,
  306. bool isDirector = false,
  307. List<String >? fieldList,
  308. List<String >? deletePatientCodes,
  309. bool isBatchExportDiagnoseData = false,
  310. String? bindAssistantUserCode,
  311. String? bindAssistantDoctorUserCode,
  312. LoginLockInfoDTO? loginLockInfo,
  313. String? signature,
  314. String? language,
  315. bool enableReportLabel = false,
  316. List<AssociatedInfoDTO >? associatedInfos,
  317. String? commonPlatformUserId,
  318. String? bindEmergencyDeviceCode,
  319. String? bindEmergencyExpertCode,
  320. List<String >? dashboardOrgCodes,
  321. String? phone,
  322. String? email,
  323. String? userCode,
  324. String? userName,
  325. String? fullName,
  326. String? headImageUrl,
  327. String? displayName,
  328. DateTime? createTime,
  329. DateTime? updateTime,
  330. }) : super(
  331. nickName: nickName,
  332. organizationCode: organizationCode,
  333. organizationName: organizationName,
  334. rootOrganizationCode: rootOrganizationCode,
  335. rootOrganizationName: rootOrganizationName,
  336. authorityGroups: authorityGroups,
  337. bindDevices: bindDevices,
  338. lastIP: lastIP,
  339. logintimes: logintimes,
  340. userState: userState,
  341. roleCodes: roleCodes,
  342. rankCodes: rankCodes,
  343. positionCodes: positionCodes,
  344. applyState: applyState,
  345. rankName: rankName,
  346. positionName: positionName,
  347. isDirector: isDirector,
  348. fieldList: fieldList,
  349. deletePatientCodes: deletePatientCodes,
  350. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  351. bindAssistantUserCode: bindAssistantUserCode,
  352. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  353. loginLockInfo: loginLockInfo,
  354. signature: signature,
  355. language: language,
  356. enableReportLabel: enableReportLabel,
  357. associatedInfos: associatedInfos,
  358. commonPlatformUserId: commonPlatformUserId,
  359. bindEmergencyDeviceCode: bindEmergencyDeviceCode,
  360. bindEmergencyExpertCode: bindEmergencyExpertCode,
  361. dashboardOrgCodes: dashboardOrgCodes,
  362. phone: phone,
  363. email: email,
  364. userCode: userCode,
  365. userName: userName,
  366. fullName: fullName,
  367. headImageUrl: headImageUrl,
  368. displayName: displayName,
  369. createTime: createTime,
  370. updateTime: updateTime,
  371. );
  372. factory UserInfoByCodeDTO.fromJson(Map<String, dynamic> map) {
  373. return UserInfoByCodeDTO(
  374. bindAssistantUserName: map['BindAssistantUserName'],
  375. bindAssistantDoctorUserName: map['BindAssistantDoctorUserName'],
  376. nickName: map['NickName'],
  377. organizationCode: map['OrganizationCode'],
  378. organizationName: map['OrganizationName'],
  379. rootOrganizationCode: map['RootOrganizationCode'],
  380. rootOrganizationName: map['RootOrganizationName'],
  381. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  382. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  383. lastIP: map['LastIP'],
  384. logintimes: map['Logintimes'],
  385. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  386. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  387. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  388. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  389. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  390. rankName: map['RankName'],
  391. positionName: map['PositionName'],
  392. isDirector: map['IsDirector'],
  393. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  394. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  395. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  396. bindAssistantUserCode: map['BindAssistantUserCode'],
  397. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  398. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  399. signature: map['Signature'],
  400. language: map['Language'],
  401. enableReportLabel: map['EnableReportLabel'],
  402. associatedInfos: map['AssociatedInfos'] != null ? (map['AssociatedInfos'] as List).map((e)=>AssociatedInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  403. commonPlatformUserId: map['CommonPlatformUserId'],
  404. bindEmergencyDeviceCode: map['BindEmergencyDeviceCode'],
  405. bindEmergencyExpertCode: map['BindEmergencyExpertCode'],
  406. dashboardOrgCodes: map['DashboardOrgCodes'] != null ? map['DashboardOrgCodes'].cast<String>().toList() : null,
  407. phone: map['Phone'],
  408. email: map['Email'],
  409. userCode: map['UserCode'],
  410. userName: map['UserName'],
  411. fullName: map['FullName'],
  412. headImageUrl: map['HeadImageUrl'],
  413. displayName: map['DisplayName'],
  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(bindAssistantUserName != null)
  421. map['BindAssistantUserName'] = bindAssistantUserName;
  422. if(bindAssistantDoctorUserName != null)
  423. map['BindAssistantDoctorUserName'] = bindAssistantDoctorUserName;
  424. return map;
  425. }
  426. }
  427. class GetUserByCodeRequest extends TokenRequest{
  428. String? userCode;
  429. GetUserByCodeRequest({
  430. this.userCode,
  431. String? token,
  432. }) : super(
  433. token: token,
  434. );
  435. factory GetUserByCodeRequest.fromJson(Map<String, dynamic> map) {
  436. return GetUserByCodeRequest(
  437. userCode: map['UserCode'],
  438. token: map['Token'],
  439. );
  440. }
  441. Map<String, dynamic> toJson() {
  442. final map = super.toJson();
  443. if(userCode != null)
  444. map['UserCode'] = userCode;
  445. return map;
  446. }
  447. }
  448. enum CommonSettingsEnum {
  449. Signature,
  450. Language,
  451. EnableReportLabel,
  452. }
  453. class CommonSettingsRequest extends TokenRequest{
  454. CommonSettingsEnum settingType;
  455. String? value;
  456. CommonSettingsRequest({
  457. this.settingType = CommonSettingsEnum.Signature,
  458. this.value,
  459. String? token,
  460. }) : super(
  461. token: token,
  462. );
  463. factory CommonSettingsRequest.fromJson(Map<String, dynamic> map) {
  464. return CommonSettingsRequest(
  465. settingType: CommonSettingsEnum.values.firstWhere((e) => e.index == map['SettingType']),
  466. value: map['Value'],
  467. token: map['Token'],
  468. );
  469. }
  470. Map<String, dynamic> toJson() {
  471. final map = super.toJson();
  472. map['SettingType'] = settingType.index;
  473. if(value != null)
  474. map['Value'] = value;
  475. return map;
  476. }
  477. }
  478. class RefreshStaticticRecordsRequest {
  479. String? userCode;
  480. bool inExecutor;
  481. RefreshStaticticRecordsRequest({
  482. this.userCode,
  483. this.inExecutor = false,
  484. });
  485. factory RefreshStaticticRecordsRequest.fromJson(Map<String, dynamic> map) {
  486. return RefreshStaticticRecordsRequest(
  487. userCode: map['UserCode'],
  488. inExecutor: map['InExecutor'],
  489. );
  490. }
  491. Map<String, dynamic> toJson() {
  492. final map = Map<String, dynamic>();
  493. if(userCode != null)
  494. map['UserCode'] = userCode;
  495. map['InExecutor'] = inExecutor;
  496. return map;
  497. }
  498. }
  499. enum ScheduleTypeEnum {
  500. Consultation,
  501. Training,
  502. }
  503. class ClientScheduleDTO {
  504. String? title;
  505. TransactionStatusEnum status;
  506. ScheduleTypeEnum scheduleType;
  507. DateTime? startTime;
  508. DateTime? endTime;
  509. String? relevanceCode;
  510. ClientScheduleDTO({
  511. this.title,
  512. this.status = TransactionStatusEnum.Applied,
  513. this.scheduleType = ScheduleTypeEnum.Consultation,
  514. this.startTime,
  515. this.endTime,
  516. this.relevanceCode,
  517. });
  518. factory ClientScheduleDTO.fromJson(Map<String, dynamic> map) {
  519. return ClientScheduleDTO(
  520. title: map['Title'],
  521. status: TransactionStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  522. scheduleType: ScheduleTypeEnum.values.firstWhere((e) => e.index == map['ScheduleType']),
  523. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  524. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  525. relevanceCode: map['RelevanceCode'],
  526. );
  527. }
  528. Map<String, dynamic> toJson() {
  529. final map = Map<String, dynamic>();
  530. if(title != null)
  531. map['Title'] = title;
  532. map['Status'] = status.index;
  533. map['ScheduleType'] = scheduleType.index;
  534. if(startTime != null)
  535. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  536. if(endTime != null)
  537. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  538. if(relevanceCode != null)
  539. map['RelevanceCode'] = relevanceCode;
  540. return map;
  541. }
  542. }
  543. class FindSchedulesRequest extends TokenRequest{
  544. DateTime? startTime;
  545. DateTime? endTime;
  546. FindSchedulesRequest({
  547. this.startTime,
  548. this.endTime,
  549. String? token,
  550. }) : super(
  551. token: token,
  552. );
  553. factory FindSchedulesRequest.fromJson(Map<String, dynamic> map) {
  554. return FindSchedulesRequest(
  555. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  556. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  557. token: map['Token'],
  558. );
  559. }
  560. Map<String, dynamic> toJson() {
  561. final map = super.toJson();
  562. if(startTime != null)
  563. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  564. if(endTime != null)
  565. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  566. return map;
  567. }
  568. }
  569. enum ApplicantTypeEnum {
  570. Client,
  571. Device,
  572. Management,
  573. ThirdParty,
  574. Server,
  575. }
  576. class MessageExtendInfoDTO extends BaseDTO{
  577. String? messageCode;
  578. NotificationTypeEnum notificationType;
  579. String? content;
  580. DateTime? notifyTime;
  581. ApplicantTypeEnum receiverType;
  582. String? relevanceCode;
  583. bool isReaded;
  584. DateTime? deliveryTime;
  585. DateTime? readTime;
  586. MessageExtendInfoDTO({
  587. this.messageCode,
  588. this.notificationType = NotificationTypeEnum.Unknown,
  589. this.content,
  590. this.notifyTime,
  591. this.receiverType = ApplicantTypeEnum.Client,
  592. this.relevanceCode,
  593. this.isReaded = false,
  594. this.deliveryTime,
  595. this.readTime,
  596. DateTime? createTime,
  597. DateTime? updateTime,
  598. }) : super(
  599. createTime: createTime,
  600. updateTime: updateTime,
  601. );
  602. factory MessageExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  603. return MessageExtendInfoDTO(
  604. messageCode: map['MessageCode'],
  605. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  606. content: map['Content'],
  607. notifyTime: map['NotifyTime'] != null ? DateTime.parse(map['NotifyTime']) : null,
  608. receiverType: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ReceiverType']),
  609. relevanceCode: map['RelevanceCode'],
  610. isReaded: map['IsReaded'],
  611. deliveryTime: map['DeliveryTime'] != null ? DateTime.parse(map['DeliveryTime']) : null,
  612. readTime: map['ReadTime'] != null ? DateTime.parse(map['ReadTime']) : null,
  613. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  614. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  615. );
  616. }
  617. Map<String, dynamic> toJson() {
  618. final map = super.toJson();
  619. if(messageCode != null)
  620. map['MessageCode'] = messageCode;
  621. map['NotificationType'] = notificationType.index;
  622. if(content != null)
  623. map['Content'] = content;
  624. if(notifyTime != null)
  625. map['NotifyTime'] = JsonRpcUtils.dateFormat(notifyTime!);
  626. map['ReceiverType'] = receiverType.index;
  627. if(relevanceCode != null)
  628. map['RelevanceCode'] = relevanceCode;
  629. map['IsReaded'] = isReaded;
  630. if(deliveryTime != null)
  631. map['DeliveryTime'] = JsonRpcUtils.dateFormat(deliveryTime!);
  632. if(readTime != null)
  633. map['ReadTime'] = JsonRpcUtils.dateFormat(readTime!);
  634. return map;
  635. }
  636. }
  637. class QueryMessageListRequest extends PageRequest{
  638. TransactionTypeEnum transactionType;
  639. String? keyword;
  640. QueryMessageListRequest({
  641. this.transactionType = TransactionTypeEnum.Consultion,
  642. this.keyword,
  643. int pageIndex = 0,
  644. int pageSize = 0,
  645. String? token,
  646. }) : super(
  647. pageIndex: pageIndex,
  648. pageSize: pageSize,
  649. token: token,
  650. );
  651. factory QueryMessageListRequest.fromJson(Map<String, dynamic> map) {
  652. return QueryMessageListRequest(
  653. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  654. keyword: map['Keyword'],
  655. pageIndex: map['PageIndex'],
  656. pageSize: map['PageSize'],
  657. token: map['Token'],
  658. );
  659. }
  660. Map<String, dynamic> toJson() {
  661. final map = super.toJson();
  662. map['TransactionType'] = transactionType.index;
  663. if(keyword != null)
  664. map['Keyword'] = keyword;
  665. return map;
  666. }
  667. }
  668. class SetMessageDeliveryRequest extends TokenRequest{
  669. String? messageCode;
  670. bool isReaded;
  671. SetMessageDeliveryRequest({
  672. this.messageCode,
  673. this.isReaded = false,
  674. String? token,
  675. }) : super(
  676. token: token,
  677. );
  678. factory SetMessageDeliveryRequest.fromJson(Map<String, dynamic> map) {
  679. return SetMessageDeliveryRequest(
  680. messageCode: map['MessageCode'],
  681. isReaded: map['IsReaded'],
  682. token: map['Token'],
  683. );
  684. }
  685. Map<String, dynamic> toJson() {
  686. final map = super.toJson();
  687. if(messageCode != null)
  688. map['MessageCode'] = messageCode;
  689. map['IsReaded'] = isReaded;
  690. return map;
  691. }
  692. }
  693. class SetMessageInfoReqeust extends TokenRequest{
  694. List<String >? messageCodes;
  695. SetMessageInfoReqeust({
  696. this.messageCodes,
  697. String? token,
  698. }) : super(
  699. token: token,
  700. );
  701. factory SetMessageInfoReqeust.fromJson(Map<String, dynamic> map) {
  702. return SetMessageInfoReqeust(
  703. messageCodes: map['MessageCodes'] != null ? map['MessageCodes'].cast<String>().toList() : null,
  704. token: map['Token'],
  705. );
  706. }
  707. Map<String, dynamic> toJson() {
  708. final map = super.toJson();
  709. if(messageCodes != null)
  710. map['MessageCodes'] = messageCodes;
  711. return map;
  712. }
  713. }
  714. class AnnouncementExtendInfoDTO extends BaseDTO{
  715. String? announcementCode;
  716. AnnouncementTypeEnum announcementType;
  717. String? language;
  718. String? title;
  719. String? content;
  720. AnnouncementExtendInfoDTO({
  721. this.announcementCode,
  722. this.announcementType = AnnouncementTypeEnum.Broadcast,
  723. this.language,
  724. this.title,
  725. this.content,
  726. DateTime? createTime,
  727. DateTime? updateTime,
  728. }) : super(
  729. createTime: createTime,
  730. updateTime: updateTime,
  731. );
  732. factory AnnouncementExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  733. return AnnouncementExtendInfoDTO(
  734. announcementCode: map['AnnouncementCode'],
  735. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  736. language: map['Language'],
  737. title: map['Title'],
  738. content: map['Content'],
  739. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  740. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  741. );
  742. }
  743. Map<String, dynamic> toJson() {
  744. final map = super.toJson();
  745. if(announcementCode != null)
  746. map['AnnouncementCode'] = announcementCode;
  747. map['AnnouncementType'] = announcementType.index;
  748. if(language != null)
  749. map['Language'] = language;
  750. if(title != null)
  751. map['Title'] = title;
  752. if(content != null)
  753. map['Content'] = content;
  754. return map;
  755. }
  756. }
  757. class QueryAnnouncementListRequest extends PageRequest{
  758. AnnouncementTypeEnum announcementType;
  759. String? language;
  760. String? keyword;
  761. DateTime? startTime;
  762. DateTime? endTime;
  763. QueryAnnouncementListRequest({
  764. this.announcementType = AnnouncementTypeEnum.Broadcast,
  765. this.language,
  766. this.keyword,
  767. this.startTime,
  768. this.endTime,
  769. int pageIndex = 0,
  770. int pageSize = 0,
  771. String? token,
  772. }) : super(
  773. pageIndex: pageIndex,
  774. pageSize: pageSize,
  775. token: token,
  776. );
  777. factory QueryAnnouncementListRequest.fromJson(Map<String, dynamic> map) {
  778. return QueryAnnouncementListRequest(
  779. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  780. language: map['Language'],
  781. keyword: map['Keyword'],
  782. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  783. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  784. pageIndex: map['PageIndex'],
  785. pageSize: map['PageSize'],
  786. token: map['Token'],
  787. );
  788. }
  789. Map<String, dynamic> toJson() {
  790. final map = super.toJson();
  791. map['AnnouncementType'] = announcementType.index;
  792. if(language != null)
  793. map['Language'] = language;
  794. if(keyword != null)
  795. map['Keyword'] = keyword;
  796. if(startTime != null)
  797. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  798. if(endTime != null)
  799. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  800. return map;
  801. }
  802. }
  803. class GetAnnouncementRequest extends TokenRequest{
  804. String? announcementCode;
  805. String? language;
  806. GetAnnouncementRequest({
  807. this.announcementCode,
  808. this.language,
  809. String? token,
  810. }) : super(
  811. token: token,
  812. );
  813. factory GetAnnouncementRequest.fromJson(Map<String, dynamic> map) {
  814. return GetAnnouncementRequest(
  815. announcementCode: map['AnnouncementCode'],
  816. language: map['Language'],
  817. token: map['Token'],
  818. );
  819. }
  820. Map<String, dynamic> toJson() {
  821. final map = super.toJson();
  822. if(announcementCode != null)
  823. map['AnnouncementCode'] = announcementCode;
  824. if(language != null)
  825. map['Language'] = language;
  826. return map;
  827. }
  828. }
  829. class NoReadMessagesDTO {
  830. int count;
  831. List<String >? noReadCodes;
  832. NoReadMessagesDTO({
  833. this.count = 0,
  834. this.noReadCodes,
  835. });
  836. factory NoReadMessagesDTO.fromJson(Map<String, dynamic> map) {
  837. return NoReadMessagesDTO(
  838. count: map['Count'],
  839. noReadCodes: map['NoReadCodes'] != null ? map['NoReadCodes'].cast<String>().toList() : null,
  840. );
  841. }
  842. Map<String, dynamic> toJson() {
  843. final map = Map<String, dynamic>();
  844. map['Count'] = count;
  845. if(noReadCodes != null)
  846. map['NoReadCodes'] = noReadCodes;
  847. return map;
  848. }
  849. }
  850. class GetNoReadMessagesRequest extends TokenRequest{
  851. TransactionTypeEnum transactionType;
  852. GetNoReadMessagesRequest({
  853. this.transactionType = TransactionTypeEnum.Consultion,
  854. String? token,
  855. }) : super(
  856. token: token,
  857. );
  858. factory GetNoReadMessagesRequest.fromJson(Map<String, dynamic> map) {
  859. return GetNoReadMessagesRequest(
  860. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  861. token: map['Token'],
  862. );
  863. }
  864. Map<String, dynamic> toJson() {
  865. final map = super.toJson();
  866. map['TransactionType'] = transactionType.index;
  867. return map;
  868. }
  869. }
  870. class RemoveUserSingleTokenRequest extends TokenRequest{
  871. String? wSToken;
  872. RemoveUserSingleTokenRequest({
  873. this.wSToken,
  874. String? token,
  875. }) : super(
  876. token: token,
  877. );
  878. factory RemoveUserSingleTokenRequest.fromJson(Map<String, dynamic> map) {
  879. return RemoveUserSingleTokenRequest(
  880. wSToken: map['WSToken'],
  881. token: map['Token'],
  882. );
  883. }
  884. Map<String, dynamic> toJson() {
  885. final map = super.toJson();
  886. if(wSToken != null)
  887. map['WSToken'] = wSToken;
  888. return map;
  889. }
  890. }
  891. enum UserMigratoryRoleEnum {
  892. Role_ExpertAssistant,
  893. Role_CertifiedExpert,
  894. Role_CertifiedPhysician,
  895. }
  896. class UserMigratoryInfo extends UserDTO{
  897. bool isDelete;
  898. String? secretPassword;
  899. DateTime? passwordUpdateTime;
  900. List<String >? passwordRecords;
  901. UserMigratoryRoleEnum userRole;
  902. UserMigratoryInfo({
  903. this.isDelete = false,
  904. this.secretPassword,
  905. this.passwordUpdateTime,
  906. this.passwordRecords,
  907. this.userRole = UserMigratoryRoleEnum.Role_ExpertAssistant,
  908. String? nickName,
  909. String? organizationCode,
  910. String? organizationName,
  911. String? rootOrganizationCode,
  912. String? rootOrganizationName,
  913. List<String >? authorityGroups,
  914. List<String >? bindDevices,
  915. String? lastIP,
  916. int logintimes = 0,
  917. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  918. List<String >? roleCodes,
  919. List<String >? rankCodes,
  920. List<String >? positionCodes,
  921. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  922. String? rankName,
  923. String? positionName,
  924. bool isDirector = false,
  925. List<String >? fieldList,
  926. List<String >? deletePatientCodes,
  927. bool isBatchExportDiagnoseData = false,
  928. String? bindAssistantUserCode,
  929. String? bindAssistantDoctorUserCode,
  930. LoginLockInfoDTO? loginLockInfo,
  931. String? signature,
  932. String? language,
  933. bool enableReportLabel = false,
  934. List<AssociatedInfoDTO >? associatedInfos,
  935. String? commonPlatformUserId,
  936. String? bindEmergencyDeviceCode,
  937. String? bindEmergencyExpertCode,
  938. List<String >? dashboardOrgCodes,
  939. String? phone,
  940. String? email,
  941. String? userCode,
  942. String? userName,
  943. String? fullName,
  944. String? headImageUrl,
  945. String? displayName,
  946. DateTime? createTime,
  947. DateTime? updateTime,
  948. }) : super(
  949. nickName: nickName,
  950. organizationCode: organizationCode,
  951. organizationName: organizationName,
  952. rootOrganizationCode: rootOrganizationCode,
  953. rootOrganizationName: rootOrganizationName,
  954. authorityGroups: authorityGroups,
  955. bindDevices: bindDevices,
  956. lastIP: lastIP,
  957. logintimes: logintimes,
  958. userState: userState,
  959. roleCodes: roleCodes,
  960. rankCodes: rankCodes,
  961. positionCodes: positionCodes,
  962. applyState: applyState,
  963. rankName: rankName,
  964. positionName: positionName,
  965. isDirector: isDirector,
  966. fieldList: fieldList,
  967. deletePatientCodes: deletePatientCodes,
  968. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  969. bindAssistantUserCode: bindAssistantUserCode,
  970. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  971. loginLockInfo: loginLockInfo,
  972. signature: signature,
  973. language: language,
  974. enableReportLabel: enableReportLabel,
  975. associatedInfos: associatedInfos,
  976. commonPlatformUserId: commonPlatformUserId,
  977. bindEmergencyDeviceCode: bindEmergencyDeviceCode,
  978. bindEmergencyExpertCode: bindEmergencyExpertCode,
  979. dashboardOrgCodes: dashboardOrgCodes,
  980. phone: phone,
  981. email: email,
  982. userCode: userCode,
  983. userName: userName,
  984. fullName: fullName,
  985. headImageUrl: headImageUrl,
  986. displayName: displayName,
  987. createTime: createTime,
  988. updateTime: updateTime,
  989. );
  990. factory UserMigratoryInfo.fromJson(Map<String, dynamic> map) {
  991. return UserMigratoryInfo(
  992. isDelete: map['IsDelete'],
  993. secretPassword: map['SecretPassword'],
  994. passwordUpdateTime: map['PasswordUpdateTime'] != null ? DateTime.parse(map['PasswordUpdateTime']) : null,
  995. passwordRecords: map['PasswordRecords'] != null ? map['PasswordRecords'].cast<String>().toList() : null,
  996. userRole: UserMigratoryRoleEnum.values.firstWhere((e) => e.index == map['UserRole']),
  997. nickName: map['NickName'],
  998. organizationCode: map['OrganizationCode'],
  999. organizationName: map['OrganizationName'],
  1000. rootOrganizationCode: map['RootOrganizationCode'],
  1001. rootOrganizationName: map['RootOrganizationName'],
  1002. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  1003. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  1004. lastIP: map['LastIP'],
  1005. logintimes: map['Logintimes'],
  1006. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  1007. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  1008. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  1009. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  1010. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  1011. rankName: map['RankName'],
  1012. positionName: map['PositionName'],
  1013. isDirector: map['IsDirector'],
  1014. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  1015. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  1016. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  1017. bindAssistantUserCode: map['BindAssistantUserCode'],
  1018. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  1019. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  1020. signature: map['Signature'],
  1021. language: map['Language'],
  1022. enableReportLabel: map['EnableReportLabel'],
  1023. associatedInfos: map['AssociatedInfos'] != null ? (map['AssociatedInfos'] as List).map((e)=>AssociatedInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1024. commonPlatformUserId: map['CommonPlatformUserId'],
  1025. bindEmergencyDeviceCode: map['BindEmergencyDeviceCode'],
  1026. bindEmergencyExpertCode: map['BindEmergencyExpertCode'],
  1027. dashboardOrgCodes: map['DashboardOrgCodes'] != null ? map['DashboardOrgCodes'].cast<String>().toList() : null,
  1028. phone: map['Phone'],
  1029. email: map['Email'],
  1030. userCode: map['UserCode'],
  1031. userName: map['UserName'],
  1032. fullName: map['FullName'],
  1033. headImageUrl: map['HeadImageUrl'],
  1034. displayName: map['DisplayName'],
  1035. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1036. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  1037. );
  1038. }
  1039. Map<String, dynamic> toJson() {
  1040. final map = super.toJson();
  1041. map['IsDelete'] = isDelete;
  1042. if(secretPassword != null)
  1043. map['SecretPassword'] = secretPassword;
  1044. if(passwordUpdateTime != null)
  1045. map['PasswordUpdateTime'] = JsonRpcUtils.dateFormat(passwordUpdateTime!);
  1046. if(passwordRecords != null)
  1047. map['PasswordRecords'] = passwordRecords;
  1048. map['UserRole'] = userRole.index;
  1049. return map;
  1050. }
  1051. }
  1052. class BatchInsertUserRequest extends TokenRequest{
  1053. List<UserMigratoryInfo >? userMigratorys;
  1054. BatchInsertUserRequest({
  1055. this.userMigratorys,
  1056. String? token,
  1057. }) : super(
  1058. token: token,
  1059. );
  1060. factory BatchInsertUserRequest.fromJson(Map<String, dynamic> map) {
  1061. return BatchInsertUserRequest(
  1062. userMigratorys: map['UserMigratorys'] != null ? (map['UserMigratorys'] as List).map((e)=>UserMigratoryInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1063. token: map['Token'],
  1064. );
  1065. }
  1066. Map<String, dynamic> toJson() {
  1067. final map = super.toJson();
  1068. if(userMigratorys != null)
  1069. map['UserMigratorys'] = userMigratorys;
  1070. return map;
  1071. }
  1072. }
  1073. enum MigrateRecordType {
  1074. Default,
  1075. MigrateDataCenter,
  1076. }
  1077. class MigrateRecordDTO {
  1078. DateTime? startTime;
  1079. DateTime? endTime;
  1080. MigrateRecordType type;
  1081. MigrateRecordDTO({
  1082. this.startTime,
  1083. this.endTime,
  1084. this.type = MigrateRecordType.Default,
  1085. });
  1086. factory MigrateRecordDTO.fromJson(Map<String, dynamic> map) {
  1087. return MigrateRecordDTO(
  1088. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1089. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  1090. type: MigrateRecordType.values.firstWhere((e) => e.index == map['Type']),
  1091. );
  1092. }
  1093. Map<String, dynamic> toJson() {
  1094. final map = Map<String, dynamic>();
  1095. if(startTime != null)
  1096. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1097. if(endTime != null)
  1098. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  1099. map['Type'] = type.index;
  1100. return map;
  1101. }
  1102. }
  1103. class QueryMigrateTimeRequest extends TokenRequest{
  1104. bool isInitMigreate;
  1105. QueryMigrateTimeRequest({
  1106. this.isInitMigreate = false,
  1107. String? token,
  1108. }) : super(
  1109. token: token,
  1110. );
  1111. factory QueryMigrateTimeRequest.fromJson(Map<String, dynamic> map) {
  1112. return QueryMigrateTimeRequest(
  1113. isInitMigreate: map['IsInitMigreate'],
  1114. token: map['Token'],
  1115. );
  1116. }
  1117. Map<String, dynamic> toJson() {
  1118. final map = super.toJson();
  1119. map['IsInitMigreate'] = isInitMigreate;
  1120. return map;
  1121. }
  1122. }