appletAPI.m.dart 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. class AppletAPIBaseRequest {
  5. String? openId;
  6. AppletAPIBaseRequest({
  7. this.openId,
  8. });
  9. factory AppletAPIBaseRequest.fromJson(Map<String, dynamic> map) {
  10. return AppletAPIBaseRequest(
  11. openId: map['OpenId'],
  12. );
  13. }
  14. Map<String, dynamic> toJson() {
  15. final map = Map<String, dynamic>();
  16. if (openId != null) {
  17. map['OpenId'] = openId;
  18. }
  19. return map;
  20. }
  21. }
  22. class LiveMemberLeaveRequest extends AppletAPIBaseRequest{
  23. String? consultationId;
  24. LiveMemberLeaveRequest({
  25. this.consultationId,
  26. String? openId,
  27. }) : super(
  28. openId: openId,
  29. );
  30. factory LiveMemberLeaveRequest.fromJson(Map<String, dynamic> map) {
  31. return LiveMemberLeaveRequest(
  32. consultationId: map['ConsultationId'],
  33. openId: map['OpenId'],
  34. );
  35. }
  36. Map<String, dynamic> toJson() {
  37. final map = super.toJson();
  38. if (consultationId != null)
  39. map['ConsultationId'] = consultationId;
  40. return map;
  41. }
  42. }
  43. class LiveMemberRejectRequest extends AppletAPIBaseRequest{
  44. String? consultationId;
  45. String? userId;
  46. LiveMemberRejectRequest({
  47. this.consultationId,
  48. this.userId,
  49. String? openId,
  50. }) : super(
  51. openId: openId,
  52. );
  53. factory LiveMemberRejectRequest.fromJson(Map<String, dynamic> map) {
  54. return LiveMemberRejectRequest(
  55. consultationId: map['ConsultationId'],
  56. userId: map['UserId'],
  57. openId: map['OpenId'],
  58. );
  59. }
  60. Map<String, dynamic> toJson() {
  61. final map = super.toJson();
  62. if (consultationId != null)
  63. map['ConsultationId'] = consultationId;
  64. if (userId != null)
  65. map['UserId'] = userId;
  66. return map;
  67. }
  68. }
  69. class LiveMemberAcceptRequest extends AppletAPIBaseRequest{
  70. String? consultationId;
  71. String? userId;
  72. LiveMemberAcceptRequest({
  73. this.consultationId,
  74. this.userId,
  75. String? openId,
  76. }) : super(
  77. openId: openId,
  78. );
  79. factory LiveMemberAcceptRequest.fromJson(Map<String, dynamic> map) {
  80. return LiveMemberAcceptRequest(
  81. consultationId: map['ConsultationId'],
  82. userId: map['UserId'],
  83. openId: map['OpenId'],
  84. );
  85. }
  86. Map<String, dynamic> toJson() {
  87. final map = super.toJson();
  88. if (consultationId != null)
  89. map['ConsultationId'] = consultationId;
  90. if (userId != null)
  91. map['UserId'] = userId;
  92. return map;
  93. }
  94. }
  95. class LiveMemberTimeoutRequest extends AppletAPIBaseRequest{
  96. String? consultationId;
  97. String? userId;
  98. LiveMemberTimeoutRequest({
  99. this.consultationId,
  100. this.userId,
  101. String? openId,
  102. }) : super(
  103. openId: openId,
  104. );
  105. factory LiveMemberTimeoutRequest.fromJson(Map<String, dynamic> map) {
  106. return LiveMemberTimeoutRequest(
  107. consultationId: map['ConsultationId'],
  108. userId: map['UserId'],
  109. openId: map['OpenId'],
  110. );
  111. }
  112. Map<String, dynamic> toJson() {
  113. final map = super.toJson();
  114. if (consultationId != null)
  115. map['ConsultationId'] = consultationId;
  116. if (userId != null)
  117. map['UserId'] = userId;
  118. return map;
  119. }
  120. }
  121. class GetUserInfoByOpenIdResult {
  122. String? nickName;
  123. String? hospital;
  124. String? userId;
  125. GetUserInfoByOpenIdResult({
  126. this.nickName,
  127. this.hospital,
  128. this.userId,
  129. });
  130. factory GetUserInfoByOpenIdResult.fromJson(Map<String, dynamic> map) {
  131. return GetUserInfoByOpenIdResult(
  132. nickName: map['NickName'],
  133. hospital: map['Hospital'],
  134. userId: map['UserId'],
  135. );
  136. }
  137. Map<String, dynamic> toJson() {
  138. final map = Map<String, dynamic>();
  139. if (nickName != null) {
  140. map['NickName'] = nickName;
  141. }
  142. if (hospital != null) {
  143. map['Hospital'] = hospital;
  144. }
  145. if (userId != null) {
  146. map['UserId'] = userId;
  147. }
  148. return map;
  149. }
  150. }
  151. class GetUserInfoByOpenIdRequest extends AppletAPIBaseRequest{
  152. GetUserInfoByOpenIdRequest({
  153. String? openId,
  154. }) : super(
  155. openId: openId,
  156. );
  157. factory GetUserInfoByOpenIdRequest.fromJson(Map<String, dynamic> map) {
  158. return GetUserInfoByOpenIdRequest(
  159. openId: map['OpenId'],
  160. );
  161. }
  162. Map<String, dynamic> toJson() {
  163. final map = super.toJson();
  164. return map;
  165. }
  166. }
  167. class BindVcloudAccountAndOpenIdRequest {
  168. String? account;
  169. String? password;
  170. String? openId;
  171. BindVcloudAccountAndOpenIdRequest({
  172. this.account,
  173. this.password,
  174. this.openId,
  175. });
  176. factory BindVcloudAccountAndOpenIdRequest.fromJson(Map<String, dynamic> map) {
  177. return BindVcloudAccountAndOpenIdRequest(
  178. account: map['Account'],
  179. password: map['Password'],
  180. openId: map['OpenId'],
  181. );
  182. }
  183. Map<String, dynamic> toJson() {
  184. final map = Map<String, dynamic>();
  185. if (account != null) {
  186. map['Account'] = account;
  187. }
  188. if (password != null) {
  189. map['Password'] = password;
  190. }
  191. if (openId != null) {
  192. map['OpenId'] = openId;
  193. }
  194. return map;
  195. }
  196. }
  197. enum PatientGenderEnum {
  198. NotFilled,
  199. Male,
  200. Female,
  201. }
  202. enum RemedicalAIDiagnosisStatusEnum {
  203. Null,
  204. NoObviousLesion,
  205. Benign,
  206. Malignant,
  207. BenignAndMalignant,
  208. }
  209. class RemedicalRecordInfo {
  210. String? remedicalRecordId;
  211. String? terminalDesc;
  212. String? organizationDesc;
  213. DateTime? createTime;
  214. String? patientId;
  215. String? patientName;
  216. PatientGenderEnum patientGender;
  217. String? patientAge;
  218. String? examDoctor;
  219. String? customDoctor;
  220. bool reportUploadStatus;
  221. RemedicalAIDiagnosisStatusEnum aIDiagnosisStatus;
  222. RemedicalRecordInfo({
  223. this.remedicalRecordId,
  224. this.terminalDesc,
  225. this.organizationDesc,
  226. this.createTime,
  227. this.patientId,
  228. this.patientName,
  229. this.patientGender = PatientGenderEnum.NotFilled,
  230. this.patientAge,
  231. this.examDoctor,
  232. this.customDoctor,
  233. this.reportUploadStatus = false,
  234. this.aIDiagnosisStatus = RemedicalAIDiagnosisStatusEnum.Null,
  235. });
  236. factory RemedicalRecordInfo.fromJson(Map<String, dynamic> map) {
  237. return RemedicalRecordInfo(
  238. remedicalRecordId: map['RemedicalRecordId'],
  239. terminalDesc: map['TerminalDesc'],
  240. organizationDesc: map['OrganizationDesc'],
  241. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  242. patientId: map['PatientId'],
  243. patientName: map['PatientName'],
  244. patientGender: PatientGenderEnum.values.firstWhere((e) => e.index == map['PatientGender']),
  245. patientAge: map['PatientAge'],
  246. examDoctor: map['ExamDoctor'],
  247. customDoctor: map['CustomDoctor'],
  248. reportUploadStatus: map['ReportUploadStatus'],
  249. aIDiagnosisStatus: RemedicalAIDiagnosisStatusEnum.values.firstWhere((e) => e.index == map['AIDiagnosisStatus']),
  250. );
  251. }
  252. Map<String, dynamic> toJson() {
  253. final map = Map<String, dynamic>();
  254. if (remedicalRecordId != null) {
  255. map['RemedicalRecordId'] = remedicalRecordId;
  256. }
  257. if (terminalDesc != null) {
  258. map['TerminalDesc'] = terminalDesc;
  259. }
  260. if (organizationDesc != null) {
  261. map['OrganizationDesc'] = organizationDesc;
  262. }
  263. if (createTime != null) {
  264. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  265. }
  266. if (patientId != null) {
  267. map['PatientId'] = patientId;
  268. }
  269. if (patientName != null) {
  270. map['PatientName'] = patientName;
  271. }
  272. map['PatientGender'] = patientGender.index;
  273. if (patientAge != null) {
  274. map['PatientAge'] = patientAge;
  275. }
  276. if (examDoctor != null) {
  277. map['ExamDoctor'] = examDoctor;
  278. }
  279. if (customDoctor != null) {
  280. map['CustomDoctor'] = customDoctor;
  281. }
  282. map['ReportUploadStatus'] = reportUploadStatus;
  283. map['AIDiagnosisStatus'] = aIDiagnosisStatus.index;
  284. return map;
  285. }
  286. }
  287. class AppletAPIPageRequest extends AppletAPIBaseRequest{
  288. int pageIndex;
  289. int pageSize;
  290. AppletAPIPageRequest({
  291. this.pageIndex = 0,
  292. this.pageSize = 0,
  293. String? openId,
  294. }) : super(
  295. openId: openId,
  296. );
  297. factory AppletAPIPageRequest.fromJson(Map<String, dynamic> map) {
  298. return AppletAPIPageRequest(
  299. pageIndex: map['PageIndex'],
  300. pageSize: map['PageSize'],
  301. openId: map['OpenId'],
  302. );
  303. }
  304. Map<String, dynamic> toJson() {
  305. final map = super.toJson();
  306. map['PageIndex'] = pageIndex;
  307. map['PageSize'] = pageSize;
  308. return map;
  309. }
  310. }
  311. class GetRemedicalRecordListRequest extends AppletAPIPageRequest{
  312. String? keyWord;
  313. DateTime? startTime;
  314. DateTime? endTime;
  315. GetRemedicalRecordListRequest({
  316. this.keyWord,
  317. this.startTime,
  318. this.endTime,
  319. int pageIndex = 0,
  320. int pageSize = 0,
  321. String? openId,
  322. }) : super(
  323. pageIndex: pageIndex,
  324. pageSize: pageSize,
  325. openId: openId,
  326. );
  327. factory GetRemedicalRecordListRequest.fromJson(Map<String, dynamic> map) {
  328. return GetRemedicalRecordListRequest(
  329. keyWord: map['KeyWord'],
  330. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  331. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  332. pageIndex: map['PageIndex'],
  333. pageSize: map['PageSize'],
  334. openId: map['OpenId'],
  335. );
  336. }
  337. Map<String, dynamic> toJson() {
  338. final map = super.toJson();
  339. if (keyWord != null)
  340. map['KeyWord'] = keyWord;
  341. if (startTime != null)
  342. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  343. if (endTime != null)
  344. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  345. return map;
  346. }
  347. }
  348. class ImageFile {
  349. String? id;
  350. String? fileUrl;
  351. DateTime? createTime;
  352. ImageFile({
  353. this.id,
  354. this.fileUrl,
  355. this.createTime,
  356. });
  357. factory ImageFile.fromJson(Map<String, dynamic> map) {
  358. return ImageFile(
  359. id: map['Id'],
  360. fileUrl: map['FileUrl'],
  361. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  362. );
  363. }
  364. Map<String, dynamic> toJson() {
  365. final map = Map<String, dynamic>();
  366. if (id != null) {
  367. map['Id'] = id;
  368. }
  369. if (fileUrl != null) {
  370. map['FileUrl'] = fileUrl;
  371. }
  372. if (createTime != null) {
  373. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  374. }
  375. return map;
  376. }
  377. }
  378. class ImageData {
  379. String? id;
  380. RemedicalFileDataTypeEnum dataType;
  381. String? application;
  382. String? previewFileToken;
  383. DateTime? createTime;
  384. ImageFile? file;
  385. ImageData({
  386. this.id,
  387. this.dataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  388. this.application,
  389. this.previewFileToken,
  390. this.createTime,
  391. this.file,
  392. });
  393. factory ImageData.fromJson(Map<String, dynamic> map) {
  394. return ImageData(
  395. id: map['Id'],
  396. dataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['DataType']),
  397. application: map['Application'],
  398. previewFileToken: map['PreviewFileToken'],
  399. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  400. file: map['File'] != null ? ImageFile.fromJson(map['File']) : null,
  401. );
  402. }
  403. Map<String, dynamic> toJson() {
  404. final map = Map<String, dynamic>();
  405. if (id != null) {
  406. map['Id'] = id;
  407. }
  408. map['DataType'] = dataType.index;
  409. if (application != null) {
  410. map['Application'] = application;
  411. }
  412. if (previewFileToken != null) {
  413. map['PreviewFileToken'] = previewFileToken;
  414. }
  415. if (createTime != null) {
  416. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  417. }
  418. if (file != null) {
  419. map['File'] = file;
  420. }
  421. return map;
  422. }
  423. }
  424. class GetRemedicalDataListRequest extends AppletAPIBaseRequest{
  425. String? remedicalRecordId;
  426. GetRemedicalDataListRequest({
  427. this.remedicalRecordId,
  428. String? openId,
  429. }) : super(
  430. openId: openId,
  431. );
  432. factory GetRemedicalDataListRequest.fromJson(Map<String, dynamic> map) {
  433. return GetRemedicalDataListRequest(
  434. remedicalRecordId: map['RemedicalRecordId'],
  435. openId: map['OpenId'],
  436. );
  437. }
  438. Map<String, dynamic> toJson() {
  439. final map = super.toJson();
  440. if (remedicalRecordId != null)
  441. map['RemedicalRecordId'] = remedicalRecordId;
  442. return map;
  443. }
  444. }
  445. enum AppletAPIImageType {
  446. placeHolder_0,
  447. Local,
  448. Ob,
  449. WorkSheet,
  450. Remote,
  451. DigitalSignature,
  452. AIDiagnosis,
  453. }
  454. class ReportImageInfo {
  455. String? examDataId;
  456. String? fileUrl;
  457. AppletAPIImageType type;
  458. ReportImageInfo({
  459. this.examDataId,
  460. this.fileUrl,
  461. this.type = AppletAPIImageType.Local,
  462. });
  463. factory ReportImageInfo.fromJson(Map<String, dynamic> map) {
  464. return ReportImageInfo(
  465. examDataId: map['ExamDataId'],
  466. fileUrl: map['FileUrl'],
  467. type: AppletAPIImageType.values.firstWhere((e) => e.index == map['Type']),
  468. );
  469. }
  470. Map<String, dynamic> toJson() {
  471. final map = Map<String, dynamic>();
  472. if (examDataId != null) {
  473. map['ExamDataId'] = examDataId;
  474. }
  475. if (fileUrl != null) {
  476. map['FileUrl'] = fileUrl;
  477. }
  478. map['Type'] = type.index;
  479. return map;
  480. }
  481. }
  482. class ReportInfo {
  483. String? id;
  484. List<ReportImageInfo>? previewImages;
  485. String? reportPreviewJpg;
  486. ReportInfo({
  487. this.id,
  488. this.previewImages,
  489. this.reportPreviewJpg,
  490. });
  491. factory ReportInfo.fromJson(Map<String, dynamic> map) {
  492. return ReportInfo(
  493. id: map['Id'],
  494. previewImages: map['PreviewImages'] != null ? (map['PreviewImages'] as List).map((e)=>ReportImageInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  495. reportPreviewJpg: map['ReportPreviewJpg'],
  496. );
  497. }
  498. Map<String, dynamic> toJson() {
  499. final map = Map<String, dynamic>();
  500. if (id != null) {
  501. map['Id'] = id;
  502. }
  503. if (previewImages != null) {
  504. map['PreviewImages'] = previewImages;
  505. }
  506. if (reportPreviewJpg != null) {
  507. map['ReportPreviewJpg'] = reportPreviewJpg;
  508. }
  509. return map;
  510. }
  511. }
  512. class GetRemedicalReportListRequest extends AppletAPIBaseRequest{
  513. String? remedicalRecordId;
  514. GetRemedicalReportListRequest({
  515. this.remedicalRecordId,
  516. String? openId,
  517. }) : super(
  518. openId: openId,
  519. );
  520. factory GetRemedicalReportListRequest.fromJson(Map<String, dynamic> map) {
  521. return GetRemedicalReportListRequest(
  522. remedicalRecordId: map['RemedicalRecordId'],
  523. openId: map['OpenId'],
  524. );
  525. }
  526. Map<String, dynamic> toJson() {
  527. final map = super.toJson();
  528. if (remedicalRecordId != null)
  529. map['RemedicalRecordId'] = remedicalRecordId;
  530. return map;
  531. }
  532. }
  533. enum ConsultationState {
  534. Unhandled,
  535. Withdrawn,
  536. Handled,
  537. Started,
  538. WaitForReportUpload,
  539. ReportUploading,
  540. ReportUploaded,
  541. ReportUploadFailed,
  542. Expired,
  543. Qualified,
  544. UnQualified,
  545. }
  546. class ImageTokenInfo {
  547. String? imageToken;
  548. String? previewToken;
  549. ImageTokenInfo({
  550. this.imageToken,
  551. this.previewToken,
  552. });
  553. factory ImageTokenInfo.fromJson(Map<String, dynamic> map) {
  554. return ImageTokenInfo(
  555. imageToken: map['ImageToken'],
  556. previewToken: map['PreviewToken'],
  557. );
  558. }
  559. Map<String, dynamic> toJson() {
  560. final map = Map<String, dynamic>();
  561. if (imageToken != null) {
  562. map['ImageToken'] = imageToken;
  563. }
  564. if (previewToken != null) {
  565. map['PreviewToken'] = previewToken;
  566. }
  567. return map;
  568. }
  569. }
  570. class VideoTokenInfo {
  571. String? videoToken;
  572. String? previewToken;
  573. VideoTokenInfo({
  574. this.videoToken,
  575. this.previewToken,
  576. });
  577. factory VideoTokenInfo.fromJson(Map<String, dynamic> map) {
  578. return VideoTokenInfo(
  579. videoToken: map['VideoToken'],
  580. previewToken: map['PreviewToken'],
  581. );
  582. }
  583. Map<String, dynamic> toJson() {
  584. final map = Map<String, dynamic>();
  585. if (videoToken != null) {
  586. map['VideoToken'] = videoToken;
  587. }
  588. if (previewToken != null) {
  589. map['PreviewToken'] = previewToken;
  590. }
  591. return map;
  592. }
  593. }
  594. class ReportPreviewPdf {
  595. String? reportId;
  596. DateTime? updateTime;
  597. String? previewPdfUrl;
  598. ReportPreviewPdf({
  599. this.reportId,
  600. this.updateTime,
  601. this.previewPdfUrl,
  602. });
  603. factory ReportPreviewPdf.fromJson(Map<String, dynamic> map) {
  604. return ReportPreviewPdf(
  605. reportId: map['ReportId'],
  606. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  607. previewPdfUrl: map['PreviewPdfUrl'],
  608. );
  609. }
  610. Map<String, dynamic> toJson() {
  611. final map = Map<String, dynamic>();
  612. if (reportId != null) {
  613. map['ReportId'] = reportId;
  614. }
  615. if (updateTime != null) {
  616. map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!);
  617. }
  618. if (previewPdfUrl != null) {
  619. map['PreviewPdfUrl'] = previewPdfUrl;
  620. }
  621. return map;
  622. }
  623. }
  624. class ConsultationInfo {
  625. String? consultationId;
  626. ConsultationState state;
  627. String? patientName;
  628. PatientGenderEnum patientSex;
  629. String? patientAge;
  630. DateTime? birthday;
  631. String? contactInfo;
  632. String? patientID;
  633. String? history;
  634. String? primaryDiagnosis;
  635. String? hospitalId;
  636. String? hospitalName;
  637. String? applyHospitalId;
  638. String? applyHospitalName;
  639. String? expertId;
  640. String? expertName;
  641. DateTime? consultationDate;
  642. String? inspectionItems;
  643. String? scanDoctorName;
  644. String? deviceModel;
  645. String? terminalId;
  646. List<ImageTokenInfo>? imageTokens;
  647. List<VideoTokenInfo>? videoInfos;
  648. List<ReportPreviewPdf>? reportPreviewPdfs;
  649. ConsultationInfo({
  650. this.consultationId,
  651. this.state = ConsultationState.Unhandled,
  652. this.patientName,
  653. this.patientSex = PatientGenderEnum.NotFilled,
  654. this.patientAge,
  655. this.birthday,
  656. this.contactInfo,
  657. this.patientID,
  658. this.history,
  659. this.primaryDiagnosis,
  660. this.hospitalId,
  661. this.hospitalName,
  662. this.applyHospitalId,
  663. this.applyHospitalName,
  664. this.expertId,
  665. this.expertName,
  666. this.consultationDate,
  667. this.inspectionItems,
  668. this.scanDoctorName,
  669. this.deviceModel,
  670. this.terminalId,
  671. this.imageTokens,
  672. this.videoInfos,
  673. this.reportPreviewPdfs,
  674. });
  675. factory ConsultationInfo.fromJson(Map<String, dynamic> map) {
  676. return ConsultationInfo(
  677. consultationId: map['ConsultationId'],
  678. state: ConsultationState.values.firstWhere((e) => e.index == map['State']),
  679. patientName: map['PatientName'],
  680. patientSex: PatientGenderEnum.values.firstWhere((e) => e.index == map['PatientSex']),
  681. patientAge: map['PatientAge'],
  682. birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
  683. contactInfo: map['ContactInfo'],
  684. patientID: map['PatientID'],
  685. history: map['History'],
  686. primaryDiagnosis: map['PrimaryDiagnosis'],
  687. hospitalId: map['HospitalId'],
  688. hospitalName: map['HospitalName'],
  689. applyHospitalId: map['ApplyHospitalId'],
  690. applyHospitalName: map['ApplyHospitalName'],
  691. expertId: map['ExpertId'],
  692. expertName: map['ExpertName'],
  693. consultationDate: map['ConsultationDate'] != null ? DateTime.parse(map['ConsultationDate']) : null,
  694. inspectionItems: map['InspectionItems'],
  695. scanDoctorName: map['ScanDoctorName'],
  696. deviceModel: map['DeviceModel'],
  697. terminalId: map['TerminalId'],
  698. imageTokens: map['ImageTokens'] != null ? (map['ImageTokens'] as List).map((e)=>ImageTokenInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  699. videoInfos: map['VideoInfos'] != null ? (map['VideoInfos'] as List).map((e)=>VideoTokenInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  700. reportPreviewPdfs: map['ReportPreviewPdfs'] != null ? (map['ReportPreviewPdfs'] as List).map((e)=>ReportPreviewPdf.fromJson(e as Map<String,dynamic>)).toList() : null,
  701. );
  702. }
  703. Map<String, dynamic> toJson() {
  704. final map = Map<String, dynamic>();
  705. if (consultationId != null) {
  706. map['ConsultationId'] = consultationId;
  707. }
  708. map['State'] = state.index;
  709. if (patientName != null) {
  710. map['PatientName'] = patientName;
  711. }
  712. map['PatientSex'] = patientSex.index;
  713. if (patientAge != null) {
  714. map['PatientAge'] = patientAge;
  715. }
  716. if (birthday != null) {
  717. map['Birthday'] = JsonRpcUtils.dateFormat(birthday!);
  718. }
  719. if (contactInfo != null) {
  720. map['ContactInfo'] = contactInfo;
  721. }
  722. if (patientID != null) {
  723. map['PatientID'] = patientID;
  724. }
  725. if (history != null) {
  726. map['History'] = history;
  727. }
  728. if (primaryDiagnosis != null) {
  729. map['PrimaryDiagnosis'] = primaryDiagnosis;
  730. }
  731. if (hospitalId != null) {
  732. map['HospitalId'] = hospitalId;
  733. }
  734. if (hospitalName != null) {
  735. map['HospitalName'] = hospitalName;
  736. }
  737. if (applyHospitalId != null) {
  738. map['ApplyHospitalId'] = applyHospitalId;
  739. }
  740. if (applyHospitalName != null) {
  741. map['ApplyHospitalName'] = applyHospitalName;
  742. }
  743. if (expertId != null) {
  744. map['ExpertId'] = expertId;
  745. }
  746. if (expertName != null) {
  747. map['ExpertName'] = expertName;
  748. }
  749. if (consultationDate != null) {
  750. map['ConsultationDate'] = JsonRpcUtils.dateFormat(consultationDate!);
  751. }
  752. if (inspectionItems != null) {
  753. map['InspectionItems'] = inspectionItems;
  754. }
  755. if (scanDoctorName != null) {
  756. map['ScanDoctorName'] = scanDoctorName;
  757. }
  758. if (deviceModel != null) {
  759. map['DeviceModel'] = deviceModel;
  760. }
  761. if (terminalId != null) {
  762. map['TerminalId'] = terminalId;
  763. }
  764. if (imageTokens != null) {
  765. map['ImageTokens'] = imageTokens;
  766. }
  767. if (videoInfos != null) {
  768. map['VideoInfos'] = videoInfos;
  769. }
  770. if (reportPreviewPdfs != null) {
  771. map['ReportPreviewPdfs'] = reportPreviewPdfs;
  772. }
  773. return map;
  774. }
  775. }
  776. class GetConsultationListRequest extends AppletAPIPageRequest{
  777. String? keyWord;
  778. DateTime? startTime;
  779. DateTime? endTime;
  780. GetConsultationListRequest({
  781. this.keyWord,
  782. this.startTime,
  783. this.endTime,
  784. int pageIndex = 0,
  785. int pageSize = 0,
  786. String? openId,
  787. }) : super(
  788. pageIndex: pageIndex,
  789. pageSize: pageSize,
  790. openId: openId,
  791. );
  792. factory GetConsultationListRequest.fromJson(Map<String, dynamic> map) {
  793. return GetConsultationListRequest(
  794. keyWord: map['KeyWord'],
  795. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  796. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  797. pageIndex: map['PageIndex'],
  798. pageSize: map['PageSize'],
  799. openId: map['OpenId'],
  800. );
  801. }
  802. Map<String, dynamic> toJson() {
  803. final map = super.toJson();
  804. if (keyWord != null)
  805. map['KeyWord'] = keyWord;
  806. if (startTime != null)
  807. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  808. if (endTime != null)
  809. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  810. return map;
  811. }
  812. }
  813. class GetConsultationReportListRequest extends AppletAPIBaseRequest{
  814. String? consultationId;
  815. GetConsultationReportListRequest({
  816. this.consultationId,
  817. String? openId,
  818. }) : super(
  819. openId: openId,
  820. );
  821. factory GetConsultationReportListRequest.fromJson(Map<String, dynamic> map) {
  822. return GetConsultationReportListRequest(
  823. consultationId: map['ConsultationId'],
  824. openId: map['OpenId'],
  825. );
  826. }
  827. Map<String, dynamic> toJson() {
  828. final map = super.toJson();
  829. if (consultationId != null)
  830. map['ConsultationId'] = consultationId;
  831. return map;
  832. }
  833. }
  834. class CreateConsultationRequest extends AppletAPIBaseRequest{
  835. String? patientName;
  836. PatientGenderEnum patientSex;
  837. String? patientAge;
  838. DateTime? birthday;
  839. String? contactInfo;
  840. String? patientID;
  841. String? history;
  842. String? primaryDiagnosis;
  843. String? hospitalId;
  844. String? expertId;
  845. DateTime? consultationDate;
  846. String? inspectionItems;
  847. String? scanDoctorName;
  848. String? deviceModel;
  849. String? terminalId;
  850. CreateConsultationRequest({
  851. this.patientName,
  852. this.patientSex = PatientGenderEnum.NotFilled,
  853. this.patientAge,
  854. this.birthday,
  855. this.contactInfo,
  856. this.patientID,
  857. this.history,
  858. this.primaryDiagnosis,
  859. this.hospitalId,
  860. this.expertId,
  861. this.consultationDate,
  862. this.inspectionItems,
  863. this.scanDoctorName,
  864. this.deviceModel,
  865. this.terminalId,
  866. String? openId,
  867. }) : super(
  868. openId: openId,
  869. );
  870. factory CreateConsultationRequest.fromJson(Map<String, dynamic> map) {
  871. return CreateConsultationRequest(
  872. patientName: map['PatientName'],
  873. patientSex: PatientGenderEnum.values.firstWhere((e) => e.index == map['PatientSex']),
  874. patientAge: map['PatientAge'],
  875. birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
  876. contactInfo: map['ContactInfo'],
  877. patientID: map['PatientID'],
  878. history: map['History'],
  879. primaryDiagnosis: map['PrimaryDiagnosis'],
  880. hospitalId: map['HospitalId'],
  881. expertId: map['ExpertId'],
  882. consultationDate: map['ConsultationDate'] != null ? DateTime.parse(map['ConsultationDate']) : null,
  883. inspectionItems: map['InspectionItems'],
  884. scanDoctorName: map['ScanDoctorName'],
  885. deviceModel: map['DeviceModel'],
  886. terminalId: map['TerminalId'],
  887. openId: map['OpenId'],
  888. );
  889. }
  890. Map<String, dynamic> toJson() {
  891. final map = super.toJson();
  892. if (patientName != null)
  893. map['PatientName'] = patientName;
  894. map['PatientSex'] = patientSex.index;
  895. if (patientAge != null)
  896. map['PatientAge'] = patientAge;
  897. if (birthday != null)
  898. map['Birthday'] = JsonRpcUtils.dateFormat(birthday!);
  899. if (contactInfo != null)
  900. map['ContactInfo'] = contactInfo;
  901. if (patientID != null)
  902. map['PatientID'] = patientID;
  903. if (history != null)
  904. map['History'] = history;
  905. if (primaryDiagnosis != null)
  906. map['PrimaryDiagnosis'] = primaryDiagnosis;
  907. if (hospitalId != null)
  908. map['HospitalId'] = hospitalId;
  909. if (expertId != null)
  910. map['ExpertId'] = expertId;
  911. if (consultationDate != null)
  912. map['ConsultationDate'] = JsonRpcUtils.dateFormat(consultationDate!);
  913. if (inspectionItems != null)
  914. map['InspectionItems'] = inspectionItems;
  915. if (scanDoctorName != null)
  916. map['ScanDoctorName'] = scanDoctorName;
  917. if (deviceModel != null)
  918. map['DeviceModel'] = deviceModel;
  919. if (terminalId != null)
  920. map['TerminalId'] = terminalId;
  921. return map;
  922. }
  923. }
  924. class ArrangeConsultationRequest extends AppletAPIBaseRequest{
  925. String? consultationId;
  926. DateTime? appointDate;
  927. String? expertId;
  928. ArrangeConsultationRequest({
  929. this.consultationId,
  930. this.appointDate,
  931. this.expertId,
  932. String? openId,
  933. }) : super(
  934. openId: openId,
  935. );
  936. factory ArrangeConsultationRequest.fromJson(Map<String, dynamic> map) {
  937. return ArrangeConsultationRequest(
  938. consultationId: map['ConsultationId'],
  939. appointDate: map['AppointDate'] != null ? DateTime.parse(map['AppointDate']) : null,
  940. expertId: map['ExpertId'],
  941. openId: map['OpenId'],
  942. );
  943. }
  944. Map<String, dynamic> toJson() {
  945. final map = super.toJson();
  946. if (consultationId != null)
  947. map['ConsultationId'] = consultationId;
  948. if (appointDate != null)
  949. map['AppointDate'] = JsonRpcUtils.dateFormat(appointDate!);
  950. if (expertId != null)
  951. map['ExpertId'] = expertId;
  952. return map;
  953. }
  954. }
  955. class OrganBaseInfo {
  956. String? organizationId;
  957. String? name;
  958. OrganBaseInfo({
  959. this.organizationId,
  960. this.name,
  961. });
  962. factory OrganBaseInfo.fromJson(Map<String, dynamic> map) {
  963. return OrganBaseInfo(
  964. organizationId: map['OrganizationId'],
  965. name: map['Name'],
  966. );
  967. }
  968. Map<String, dynamic> toJson() {
  969. final map = Map<String, dynamic>();
  970. if (organizationId != null) {
  971. map['OrganizationId'] = organizationId;
  972. }
  973. if (name != null) {
  974. map['Name'] = name;
  975. }
  976. return map;
  977. }
  978. }
  979. class GetHospitalsRequest extends AppletAPIBaseRequest{
  980. GetHospitalsRequest({
  981. String? openId,
  982. }) : super(
  983. openId: openId,
  984. );
  985. factory GetHospitalsRequest.fromJson(Map<String, dynamic> map) {
  986. return GetHospitalsRequest(
  987. openId: map['OpenId'],
  988. );
  989. }
  990. Map<String, dynamic> toJson() {
  991. final map = super.toJson();
  992. return map;
  993. }
  994. }
  995. class DoctorInfo {
  996. String? id;
  997. String? displayName;
  998. String? fullName;
  999. String? electronSignUrl;
  1000. DoctorInfo({
  1001. this.id,
  1002. this.displayName,
  1003. this.fullName,
  1004. this.electronSignUrl,
  1005. });
  1006. factory DoctorInfo.fromJson(Map<String, dynamic> map) {
  1007. return DoctorInfo(
  1008. id: map['Id'],
  1009. displayName: map['DisplayName'],
  1010. fullName: map['FullName'],
  1011. electronSignUrl: map['ElectronSignUrl'],
  1012. );
  1013. }
  1014. Map<String, dynamic> toJson() {
  1015. final map = Map<String, dynamic>();
  1016. if (id != null) {
  1017. map['Id'] = id;
  1018. }
  1019. if (displayName != null) {
  1020. map['DisplayName'] = displayName;
  1021. }
  1022. if (fullName != null) {
  1023. map['FullName'] = fullName;
  1024. }
  1025. if (electronSignUrl != null) {
  1026. map['ElectronSignUrl'] = electronSignUrl;
  1027. }
  1028. return map;
  1029. }
  1030. }
  1031. class GetExpertsRequest extends AppletAPIBaseRequest{
  1032. String? organizationId;
  1033. GetExpertsRequest({
  1034. this.organizationId,
  1035. String? openId,
  1036. }) : super(
  1037. openId: openId,
  1038. );
  1039. factory GetExpertsRequest.fromJson(Map<String, dynamic> map) {
  1040. return GetExpertsRequest(
  1041. organizationId: map['OrganizationId'],
  1042. openId: map['OpenId'],
  1043. );
  1044. }
  1045. Map<String, dynamic> toJson() {
  1046. final map = super.toJson();
  1047. if (organizationId != null)
  1048. map['OrganizationId'] = organizationId;
  1049. return map;
  1050. }
  1051. }
  1052. class TerminalInfo {
  1053. String? id;
  1054. String? organizationId;
  1055. String? organizationDecription;
  1056. String? organizationName;
  1057. String? name;
  1058. String? model;
  1059. String? description;
  1060. String? uniqueId;
  1061. TerminalInfo({
  1062. this.id,
  1063. this.organizationId,
  1064. this.organizationDecription,
  1065. this.organizationName,
  1066. this.name,
  1067. this.model,
  1068. this.description,
  1069. this.uniqueId,
  1070. });
  1071. factory TerminalInfo.fromJson(Map<String, dynamic> map) {
  1072. return TerminalInfo(
  1073. id: map['Id'],
  1074. organizationId: map['OrganizationId'],
  1075. organizationDecription: map['OrganizationDecription'],
  1076. organizationName: map['OrganizationName'],
  1077. name: map['Name'],
  1078. model: map['Model'],
  1079. description: map['Description'],
  1080. uniqueId: map['UniqueId'],
  1081. );
  1082. }
  1083. Map<String, dynamic> toJson() {
  1084. final map = Map<String, dynamic>();
  1085. if (id != null) {
  1086. map['Id'] = id;
  1087. }
  1088. if (organizationId != null) {
  1089. map['OrganizationId'] = organizationId;
  1090. }
  1091. if (organizationDecription != null) {
  1092. map['OrganizationDecription'] = organizationDecription;
  1093. }
  1094. if (organizationName != null) {
  1095. map['OrganizationName'] = organizationName;
  1096. }
  1097. if (name != null) {
  1098. map['Name'] = name;
  1099. }
  1100. if (model != null) {
  1101. map['Model'] = model;
  1102. }
  1103. if (description != null) {
  1104. map['Description'] = description;
  1105. }
  1106. if (uniqueId != null) {
  1107. map['UniqueId'] = uniqueId;
  1108. }
  1109. return map;
  1110. }
  1111. }
  1112. class GetTerminalListRequest extends AppletAPIBaseRequest{
  1113. GetTerminalListRequest({
  1114. String? openId,
  1115. }) : super(
  1116. openId: openId,
  1117. );
  1118. factory GetTerminalListRequest.fromJson(Map<String, dynamic> map) {
  1119. return GetTerminalListRequest(
  1120. openId: map['OpenId'],
  1121. );
  1122. }
  1123. Map<String, dynamic> toJson() {
  1124. final map = super.toJson();
  1125. return map;
  1126. }
  1127. }
  1128. class GetScanLocationsRequest extends AppletAPIBaseRequest{
  1129. GetScanLocationsRequest({
  1130. String? openId,
  1131. }) : super(
  1132. openId: openId,
  1133. );
  1134. factory GetScanLocationsRequest.fromJson(Map<String, dynamic> map) {
  1135. return GetScanLocationsRequest(
  1136. openId: map['OpenId'],
  1137. );
  1138. }
  1139. Map<String, dynamic> toJson() {
  1140. final map = super.toJson();
  1141. return map;
  1142. }
  1143. }
  1144. class LiveTerminalInfo2 {
  1145. bool terminalLiveEnabled;
  1146. bool cameraLiveEnabled;
  1147. bool isMergeChannel;
  1148. int terminalWidth;
  1149. int terminalHeight;
  1150. String? cameraId;
  1151. bool isMultiChannels;
  1152. int cameraWidth;
  1153. int cameraHeight;
  1154. int integerRoomId;
  1155. int terminalIntegerRoomId;
  1156. LiveStates state;
  1157. String? id;
  1158. LiveTerminalInfo2({
  1159. this.terminalLiveEnabled = false,
  1160. this.cameraLiveEnabled = false,
  1161. this.isMergeChannel = false,
  1162. this.terminalWidth = 0,
  1163. this.terminalHeight = 0,
  1164. this.cameraId,
  1165. this.isMultiChannels = false,
  1166. this.cameraWidth = 0,
  1167. this.cameraHeight = 0,
  1168. this.integerRoomId = 0,
  1169. this.terminalIntegerRoomId = 0,
  1170. this.state = LiveStates.OK,
  1171. this.id,
  1172. });
  1173. factory LiveTerminalInfo2.fromJson(Map<String, dynamic> map) {
  1174. return LiveTerminalInfo2(
  1175. terminalLiveEnabled: map['TerminalLiveEnabled'],
  1176. cameraLiveEnabled: map['CameraLiveEnabled'],
  1177. isMergeChannel: map['IsMergeChannel'],
  1178. terminalWidth: map['TerminalWidth'],
  1179. terminalHeight: map['TerminalHeight'],
  1180. cameraId: map['CameraId'],
  1181. isMultiChannels: map['IsMultiChannels'],
  1182. cameraWidth: map['CameraWidth'],
  1183. cameraHeight: map['CameraHeight'],
  1184. integerRoomId: map['IntegerRoomId'],
  1185. terminalIntegerRoomId: map['TerminalIntegerRoomId'],
  1186. state: LiveStates.values.firstWhere((e) => e.index == map['State']),
  1187. id: map['Id'],
  1188. );
  1189. }
  1190. Map<String, dynamic> toJson() {
  1191. final map = Map<String, dynamic>();
  1192. map['TerminalLiveEnabled'] = terminalLiveEnabled;
  1193. map['CameraLiveEnabled'] = cameraLiveEnabled;
  1194. map['IsMergeChannel'] = isMergeChannel;
  1195. map['TerminalWidth'] = terminalWidth;
  1196. map['TerminalHeight'] = terminalHeight;
  1197. if (cameraId != null) {
  1198. map['CameraId'] = cameraId;
  1199. }
  1200. map['IsMultiChannels'] = isMultiChannels;
  1201. map['CameraWidth'] = cameraWidth;
  1202. map['CameraHeight'] = cameraHeight;
  1203. map['IntegerRoomId'] = integerRoomId;
  1204. map['TerminalIntegerRoomId'] = terminalIntegerRoomId;
  1205. map['State'] = state.index;
  1206. if (id != null) {
  1207. map['Id'] = id;
  1208. }
  1209. return map;
  1210. }
  1211. }
  1212. class MeetingMemberInfo2 {
  1213. LiveStates state;
  1214. String? id;
  1215. String? name;
  1216. String? displayName;
  1217. String? avatar;
  1218. String? userSign;
  1219. MeetingMemberInfo2({
  1220. this.state = LiveStates.OK,
  1221. this.id,
  1222. this.name,
  1223. this.displayName,
  1224. this.avatar,
  1225. this.userSign,
  1226. });
  1227. factory MeetingMemberInfo2.fromJson(Map<String, dynamic> map) {
  1228. return MeetingMemberInfo2(
  1229. state: LiveStates.values.firstWhere((e) => e.index == map['State']),
  1230. id: map['Id'],
  1231. name: map['Name'],
  1232. displayName: map['DisplayName'],
  1233. avatar: map['Avatar'],
  1234. userSign: map['UserSign'],
  1235. );
  1236. }
  1237. Map<String, dynamic> toJson() {
  1238. final map = Map<String, dynamic>();
  1239. map['State'] = state.index;
  1240. if (id != null) {
  1241. map['Id'] = id;
  1242. }
  1243. if (name != null) {
  1244. map['Name'] = name;
  1245. }
  1246. if (displayName != null) {
  1247. map['DisplayName'] = displayName;
  1248. }
  1249. if (avatar != null) {
  1250. map['Avatar'] = avatar;
  1251. }
  1252. if (userSign != null) {
  1253. map['UserSign'] = userSign;
  1254. }
  1255. return map;
  1256. }
  1257. }
  1258. class StartConsultationResult {
  1259. String? roomId;
  1260. LiveStates state;
  1261. int integerRoomId;
  1262. int appId;
  1263. List<LiveTerminalInfo2>? terminalInfos;
  1264. List<MeetingMemberInfo2>? meetingMemberInfos;
  1265. StartConsultationResult({
  1266. this.roomId,
  1267. this.state = LiveStates.OK,
  1268. this.integerRoomId = 0,
  1269. this.appId = 0,
  1270. this.terminalInfos,
  1271. this.meetingMemberInfos,
  1272. });
  1273. factory StartConsultationResult.fromJson(Map<String, dynamic> map) {
  1274. return StartConsultationResult(
  1275. roomId: map['RoomId'],
  1276. state: LiveStates.values.firstWhere((e) => e.index == map['State']),
  1277. integerRoomId: map['IntegerRoomId'],
  1278. appId: map['AppId'],
  1279. terminalInfos: map['TerminalInfos'] != null ? (map['TerminalInfos'] as List).map((e)=>LiveTerminalInfo2.fromJson(e as Map<String,dynamic>)).toList() : null,
  1280. meetingMemberInfos: map['MeetingMemberInfos'] != null ? (map['MeetingMemberInfos'] as List).map((e)=>MeetingMemberInfo2.fromJson(e as Map<String,dynamic>)).toList() : null,
  1281. );
  1282. }
  1283. Map<String, dynamic> toJson() {
  1284. final map = Map<String, dynamic>();
  1285. if (roomId != null) {
  1286. map['RoomId'] = roomId;
  1287. }
  1288. map['State'] = state.index;
  1289. map['IntegerRoomId'] = integerRoomId;
  1290. map['AppId'] = appId;
  1291. if (terminalInfos != null) {
  1292. map['TerminalInfos'] = terminalInfos;
  1293. }
  1294. if (meetingMemberInfos != null) {
  1295. map['MeetingMemberInfos'] = meetingMemberInfos;
  1296. }
  1297. return map;
  1298. }
  1299. }
  1300. class StartConsultationRequest extends AppletAPIBaseRequest{
  1301. String? consultationId;
  1302. StartConsultationRequest({
  1303. this.consultationId,
  1304. String? openId,
  1305. }) : super(
  1306. openId: openId,
  1307. );
  1308. factory StartConsultationRequest.fromJson(Map<String, dynamic> map) {
  1309. return StartConsultationRequest(
  1310. consultationId: map['ConsultationId'],
  1311. openId: map['OpenId'],
  1312. );
  1313. }
  1314. Map<String, dynamic> toJson() {
  1315. final map = super.toJson();
  1316. if (consultationId != null)
  1317. map['ConsultationId'] = consultationId;
  1318. return map;
  1319. }
  1320. }
  1321. class CancelStartConsultationResult {
  1322. LiveStates liveStates;
  1323. CancelStartConsultationResult({
  1324. this.liveStates = LiveStates.OK,
  1325. });
  1326. factory CancelStartConsultationResult.fromJson(Map<String, dynamic> map) {
  1327. return CancelStartConsultationResult(
  1328. liveStates: LiveStates.values.firstWhere((e) => e.index == map['LiveStates']),
  1329. );
  1330. }
  1331. Map<String, dynamic> toJson() {
  1332. final map = Map<String, dynamic>();
  1333. map['LiveStates'] = liveStates.index;
  1334. return map;
  1335. }
  1336. }
  1337. class CancelStartConsultationRequest extends AppletAPIBaseRequest{
  1338. String? roomId;
  1339. CancelStartConsultationRequest({
  1340. this.roomId,
  1341. String? openId,
  1342. }) : super(
  1343. openId: openId,
  1344. );
  1345. factory CancelStartConsultationRequest.fromJson(Map<String, dynamic> map) {
  1346. return CancelStartConsultationRequest(
  1347. roomId: map['RoomId'],
  1348. openId: map['OpenId'],
  1349. );
  1350. }
  1351. Map<String, dynamic> toJson() {
  1352. final map = super.toJson();
  1353. if (roomId != null)
  1354. map['RoomId'] = roomId;
  1355. return map;
  1356. }
  1357. }
  1358. class ExitConsultationResult {
  1359. LiveStates liveStates;
  1360. ExitConsultationResult({
  1361. this.liveStates = LiveStates.OK,
  1362. });
  1363. factory ExitConsultationResult.fromJson(Map<String, dynamic> map) {
  1364. return ExitConsultationResult(
  1365. liveStates: LiveStates.values.firstWhere((e) => e.index == map['LiveStates']),
  1366. );
  1367. }
  1368. Map<String, dynamic> toJson() {
  1369. final map = Map<String, dynamic>();
  1370. map['LiveStates'] = liveStates.index;
  1371. return map;
  1372. }
  1373. }
  1374. class ExitConsultationRequest extends AppletAPIBaseRequest{
  1375. String? roomId;
  1376. String? consultationId;
  1377. ExitConsultationRequest({
  1378. this.roomId,
  1379. this.consultationId,
  1380. String? openId,
  1381. }) : super(
  1382. openId: openId,
  1383. );
  1384. factory ExitConsultationRequest.fromJson(Map<String, dynamic> map) {
  1385. return ExitConsultationRequest(
  1386. roomId: map['RoomId'],
  1387. consultationId: map['ConsultationId'],
  1388. openId: map['OpenId'],
  1389. );
  1390. }
  1391. Map<String, dynamic> toJson() {
  1392. final map = super.toJson();
  1393. if (roomId != null)
  1394. map['RoomId'] = roomId;
  1395. if (consultationId != null)
  1396. map['ConsultationId'] = consultationId;
  1397. return map;
  1398. }
  1399. }
  1400. class ConsultationHeartRateRequest extends AppletAPIBaseRequest{
  1401. String? consultationId;
  1402. ConsultationHeartRateRequest({
  1403. this.consultationId,
  1404. String? openId,
  1405. }) : super(
  1406. openId: openId,
  1407. );
  1408. factory ConsultationHeartRateRequest.fromJson(Map<String, dynamic> map) {
  1409. return ConsultationHeartRateRequest(
  1410. consultationId: map['ConsultationId'],
  1411. openId: map['OpenId'],
  1412. );
  1413. }
  1414. Map<String, dynamic> toJson() {
  1415. final map = super.toJson();
  1416. if (consultationId != null)
  1417. map['ConsultationId'] = consultationId;
  1418. return map;
  1419. }
  1420. }
  1421. class AppletAPIDownloadFileResult {
  1422. String? fileString;
  1423. AppletAPIDownloadFileResult({
  1424. this.fileString,
  1425. });
  1426. factory AppletAPIDownloadFileResult.fromJson(Map<String, dynamic> map) {
  1427. return AppletAPIDownloadFileResult(
  1428. fileString: map['FileString'],
  1429. );
  1430. }
  1431. Map<String, dynamic> toJson() {
  1432. final map = Map<String, dynamic>();
  1433. if (fileString != null) {
  1434. map['FileString'] = fileString;
  1435. }
  1436. return map;
  1437. }
  1438. }
  1439. class DownloadFileRequest extends AppletAPIBaseRequest{
  1440. String? fileToken;
  1441. DownloadFileRequest({
  1442. this.fileToken,
  1443. String? openId,
  1444. }) : super(
  1445. openId: openId,
  1446. );
  1447. factory DownloadFileRequest.fromJson(Map<String, dynamic> map) {
  1448. return DownloadFileRequest(
  1449. fileToken: map['FileToken'],
  1450. openId: map['OpenId'],
  1451. );
  1452. }
  1453. Map<String, dynamic> toJson() {
  1454. final map = super.toJson();
  1455. if (fileToken != null)
  1456. map['FileToken'] = fileToken;
  1457. return map;
  1458. }
  1459. }
  1460. class VinnoTemplateInfo {
  1461. String? templateName;
  1462. String? templateUrl;
  1463. VinnoTemplateInfo({
  1464. this.templateName,
  1465. this.templateUrl,
  1466. });
  1467. factory VinnoTemplateInfo.fromJson(Map<String, dynamic> map) {
  1468. return VinnoTemplateInfo(
  1469. templateName: map['TemplateName'],
  1470. templateUrl: map['TemplateUrl'],
  1471. );
  1472. }
  1473. Map<String, dynamic> toJson() {
  1474. final map = Map<String, dynamic>();
  1475. if (templateName != null) {
  1476. map['TemplateName'] = templateName;
  1477. }
  1478. if (templateUrl != null) {
  1479. map['TemplateUrl'] = templateUrl;
  1480. }
  1481. return map;
  1482. }
  1483. }
  1484. class GetReportTemplatesRequest extends AppletAPIBaseRequest{
  1485. String? languageCode;
  1486. GetReportTemplatesRequest({
  1487. this.languageCode,
  1488. String? openId,
  1489. }) : super(
  1490. openId: openId,
  1491. );
  1492. factory GetReportTemplatesRequest.fromJson(Map<String, dynamic> map) {
  1493. return GetReportTemplatesRequest(
  1494. languageCode: map['LanguageCode'],
  1495. openId: map['OpenId'],
  1496. );
  1497. }
  1498. Map<String, dynamic> toJson() {
  1499. final map = super.toJson();
  1500. if (languageCode != null)
  1501. map['LanguageCode'] = languageCode;
  1502. return map;
  1503. }
  1504. }
  1505. class GetThesaurusTemplatesRequest extends AppletAPIBaseRequest{
  1506. String? languageCode;
  1507. GetThesaurusTemplatesRequest({
  1508. this.languageCode,
  1509. String? openId,
  1510. }) : super(
  1511. openId: openId,
  1512. );
  1513. factory GetThesaurusTemplatesRequest.fromJson(Map<String, dynamic> map) {
  1514. return GetThesaurusTemplatesRequest(
  1515. languageCode: map['LanguageCode'],
  1516. openId: map['OpenId'],
  1517. );
  1518. }
  1519. Map<String, dynamic> toJson() {
  1520. final map = super.toJson();
  1521. if (languageCode != null)
  1522. map['LanguageCode'] = languageCode;
  1523. return map;
  1524. }
  1525. }
  1526. class ReportElementTagMessage {
  1527. String? id;
  1528. String? name;
  1529. ReportElementTagMessage({
  1530. this.id,
  1531. this.name,
  1532. });
  1533. factory ReportElementTagMessage.fromJson(Map<String, dynamic> map) {
  1534. return ReportElementTagMessage(
  1535. id: map['Id'],
  1536. name: map['Name'],
  1537. );
  1538. }
  1539. Map<String, dynamic> toJson() {
  1540. final map = Map<String, dynamic>();
  1541. if (id != null) {
  1542. map['Id'] = id;
  1543. }
  1544. if (name != null) {
  1545. map['Name'] = name;
  1546. }
  1547. return map;
  1548. }
  1549. }
  1550. class ReportBaseElementValueMessage {
  1551. ReportBaseElementValueMessage();
  1552. factory ReportBaseElementValueMessage.fromJson(Map<String, dynamic> map) {
  1553. return ReportBaseElementValueMessage(
  1554. );
  1555. }
  1556. Map<String, dynamic> toJson() {
  1557. final map = Map<String, dynamic>();
  1558. return map;
  1559. }
  1560. }
  1561. class ReportTextElementValueMessage extends ReportBaseElementValueMessage{
  1562. String? text;
  1563. ReportTextElementValueMessage({
  1564. this.text,
  1565. }) : super(
  1566. );
  1567. factory ReportTextElementValueMessage.fromJson(Map<String, dynamic> map) {
  1568. return ReportTextElementValueMessage(
  1569. text: map['Text'],
  1570. );
  1571. }
  1572. Map<String, dynamic> toJson() {
  1573. final map = super.toJson();
  1574. if (text != null)
  1575. map['Text'] = text;
  1576. return map;
  1577. }
  1578. }
  1579. class ReportIntegerElementValueMessage extends ReportBaseElementValueMessage{
  1580. int value;
  1581. ReportIntegerElementValueMessage({
  1582. this.value = 0,
  1583. }) : super(
  1584. );
  1585. factory ReportIntegerElementValueMessage.fromJson(Map<String, dynamic> map) {
  1586. return ReportIntegerElementValueMessage(
  1587. value: map['Value'],
  1588. );
  1589. }
  1590. Map<String, dynamic> toJson() {
  1591. final map = super.toJson();
  1592. map['Value'] = value;
  1593. return map;
  1594. }
  1595. }
  1596. class ReportFloatElementValueMessage extends ReportBaseElementValueMessage{
  1597. double value;
  1598. ReportFloatElementValueMessage({
  1599. this.value = 0,
  1600. }) : super(
  1601. );
  1602. factory ReportFloatElementValueMessage.fromJson(Map<String, dynamic> map) {
  1603. return ReportFloatElementValueMessage(
  1604. value: double.parse(map['Value'].toString()),
  1605. );
  1606. }
  1607. Map<String, dynamic> toJson() {
  1608. final map = super.toJson();
  1609. map['Value'] = value;
  1610. return map;
  1611. }
  1612. }
  1613. class ReportBufferImageElementValueMessage extends ReportBaseElementValueMessage{
  1614. List<int>? value;
  1615. ReportBufferImageElementValueMessage({
  1616. this.value,
  1617. }) : super(
  1618. );
  1619. factory ReportBufferImageElementValueMessage.fromJson(Map<String, dynamic> map) {
  1620. final valueData = map['Value'];
  1621. return ReportBufferImageElementValueMessage(
  1622. value: valueData != null ? (valueData as List).map((e) => e as int).toList(): null,
  1623. );
  1624. }
  1625. Map<String, dynamic> toJson() {
  1626. final map = super.toJson();
  1627. if (value != null)
  1628. map['Value'] = value;
  1629. return map;
  1630. }
  1631. }
  1632. class ReportDateTimeElementValueMessage extends ReportBaseElementValueMessage{
  1633. DateTime? value;
  1634. ReportDateTimeElementValueMessage({
  1635. this.value,
  1636. }) : super(
  1637. );
  1638. factory ReportDateTimeElementValueMessage.fromJson(Map<String, dynamic> map) {
  1639. return ReportDateTimeElementValueMessage(
  1640. value: map['Value'] != null ? DateTime.parse(map['Value']) : null,
  1641. );
  1642. }
  1643. Map<String, dynamic> toJson() {
  1644. final map = super.toJson();
  1645. if (value != null)
  1646. map['Value'] = JsonRpcUtils.dateFormat(value!);
  1647. return map;
  1648. }
  1649. }
  1650. class ReportFileElementValueMessage extends ReportBaseElementValueMessage{
  1651. String? value;
  1652. String? examDataId;
  1653. ReportFileElementValueMessage({
  1654. this.value,
  1655. this.examDataId,
  1656. }) : super(
  1657. );
  1658. factory ReportFileElementValueMessage.fromJson(Map<String, dynamic> map) {
  1659. return ReportFileElementValueMessage(
  1660. value: map['Value'],
  1661. examDataId: map['ExamDataId'],
  1662. );
  1663. }
  1664. Map<String, dynamic> toJson() {
  1665. final map = super.toJson();
  1666. if (value != null)
  1667. map['Value'] = value;
  1668. if (examDataId != null)
  1669. map['ExamDataId'] = examDataId;
  1670. return map;
  1671. }
  1672. }
  1673. class ReportImageListElementValueMessage extends ReportBaseElementValueMessage{
  1674. List<ReportFileElementValueMessage>? value;
  1675. ReportImageListElementValueMessage({
  1676. this.value,
  1677. }) : super(
  1678. );
  1679. factory ReportImageListElementValueMessage.fromJson(Map<String, dynamic> map) {
  1680. return ReportImageListElementValueMessage(
  1681. value: map['Value'] != null ? (map['Value'] as List).map((e)=>ReportFileElementValueMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  1682. );
  1683. }
  1684. Map<String, dynamic> toJson() {
  1685. final map = super.toJson();
  1686. if (value != null)
  1687. map['Value'] = value;
  1688. return map;
  1689. }
  1690. }
  1691. class ReportStringListElementValueMessage extends ReportBaseElementValueMessage{
  1692. List<ReportTextElementValueMessage>? value;
  1693. ReportStringListElementValueMessage({
  1694. this.value,
  1695. }) : super(
  1696. );
  1697. factory ReportStringListElementValueMessage.fromJson(Map<String, dynamic> map) {
  1698. return ReportStringListElementValueMessage(
  1699. value: map['Value'] != null ? (map['Value'] as List).map((e)=>ReportTextElementValueMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  1700. );
  1701. }
  1702. Map<String, dynamic> toJson() {
  1703. final map = super.toJson();
  1704. if (value != null)
  1705. map['Value'] = value;
  1706. return map;
  1707. }
  1708. }
  1709. class ReportElementValues {
  1710. ReportTextElementValueMessage? textElement;
  1711. ReportIntegerElementValueMessage? integerElement;
  1712. ReportFloatElementValueMessage? floatElement;
  1713. ReportBufferImageElementValueMessage? bufferImageElement;
  1714. ReportDateTimeElementValueMessage? dateTimeElement;
  1715. ReportFileElementValueMessage? fileElement;
  1716. ReportImageListElementValueMessage? imageListElement;
  1717. ReportStringListElementValueMessage? stringListElement;
  1718. ReportElementValues({
  1719. this.textElement,
  1720. this.integerElement,
  1721. this.floatElement,
  1722. this.bufferImageElement,
  1723. this.dateTimeElement,
  1724. this.fileElement,
  1725. this.imageListElement,
  1726. this.stringListElement,
  1727. });
  1728. factory ReportElementValues.fromJson(Map<String, dynamic> map) {
  1729. return ReportElementValues(
  1730. textElement: map['TextElement'] != null ? ReportTextElementValueMessage.fromJson(map['TextElement']) : null,
  1731. integerElement: map['IntegerElement'] != null ? ReportIntegerElementValueMessage.fromJson(map['IntegerElement']) : null,
  1732. floatElement: map['FloatElement'] != null ? ReportFloatElementValueMessage.fromJson(map['FloatElement']) : null,
  1733. bufferImageElement: map['BufferImageElement'] != null ? ReportBufferImageElementValueMessage.fromJson(map['BufferImageElement']) : null,
  1734. dateTimeElement: map['DateTimeElement'] != null ? ReportDateTimeElementValueMessage.fromJson(map['DateTimeElement']) : null,
  1735. fileElement: map['FileElement'] != null ? ReportFileElementValueMessage.fromJson(map['FileElement']) : null,
  1736. imageListElement: map['ImageListElement'] != null ? ReportImageListElementValueMessage.fromJson(map['ImageListElement']) : null,
  1737. stringListElement: map['StringListElement'] != null ? ReportStringListElementValueMessage.fromJson(map['StringListElement']) : null,
  1738. );
  1739. }
  1740. Map<String, dynamic> toJson() {
  1741. final map = Map<String, dynamic>();
  1742. if (textElement != null) {
  1743. map['TextElement'] = textElement;
  1744. }
  1745. if (integerElement != null) {
  1746. map['IntegerElement'] = integerElement;
  1747. }
  1748. if (floatElement != null) {
  1749. map['FloatElement'] = floatElement;
  1750. }
  1751. if (bufferImageElement != null) {
  1752. map['BufferImageElement'] = bufferImageElement;
  1753. }
  1754. if (dateTimeElement != null) {
  1755. map['DateTimeElement'] = dateTimeElement;
  1756. }
  1757. if (fileElement != null) {
  1758. map['FileElement'] = fileElement;
  1759. }
  1760. if (imageListElement != null) {
  1761. map['ImageListElement'] = imageListElement;
  1762. }
  1763. if (stringListElement != null) {
  1764. map['StringListElement'] = stringListElement;
  1765. }
  1766. return map;
  1767. }
  1768. }
  1769. class ReportElementMessage {
  1770. ReportElementTagMessage? elementTag;
  1771. ReportElementValues? reportElementValue;
  1772. ReportElementMessage({
  1773. this.elementTag,
  1774. this.reportElementValue,
  1775. });
  1776. factory ReportElementMessage.fromJson(Map<String, dynamic> map) {
  1777. return ReportElementMessage(
  1778. elementTag: map['ElementTag'] != null ? ReportElementTagMessage.fromJson(map['ElementTag']) : null,
  1779. reportElementValue: map['ReportElementValue'] != null ? ReportElementValues.fromJson(map['ReportElementValue']) : null,
  1780. );
  1781. }
  1782. Map<String, dynamic> toJson() {
  1783. final map = Map<String, dynamic>();
  1784. if (elementTag != null) {
  1785. map['ElementTag'] = elementTag;
  1786. }
  1787. if (reportElementValue != null) {
  1788. map['ReportElementValue'] = reportElementValue;
  1789. }
  1790. return map;
  1791. }
  1792. }
  1793. class IReadOnlyCollection<T> {
  1794. int count;
  1795. IReadOnlyCollection({
  1796. this.count = 0,
  1797. });
  1798. factory IReadOnlyCollection.fromJson(Map<String, dynamic> map) {
  1799. return IReadOnlyCollection(
  1800. count: map['Count'],
  1801. );
  1802. }
  1803. Map<String, dynamic> toJson() {
  1804. final map = Map<String, dynamic>();
  1805. map['Count'] = count;
  1806. return map;
  1807. }
  1808. }
  1809. class ReportMeasureTagMessage {
  1810. IReadOnlyCollection<String>? availableMethods;
  1811. String? baseType;
  1812. String? calculationId;
  1813. String? matchId;
  1814. String? method;
  1815. String? mode;
  1816. String? output;
  1817. String? outputV2;
  1818. String? unit;
  1819. String? userId;
  1820. ReportMeasureTagMessage({
  1821. this.availableMethods,
  1822. this.baseType,
  1823. this.calculationId,
  1824. this.matchId,
  1825. this.method,
  1826. this.mode,
  1827. this.output,
  1828. this.outputV2,
  1829. this.unit,
  1830. this.userId,
  1831. });
  1832. factory ReportMeasureTagMessage.fromJson(Map<String, dynamic> map) {
  1833. return ReportMeasureTagMessage(
  1834. availableMethods: map['AvailableMethods']?.cast<String>().toList(),
  1835. baseType: map['BaseType'],
  1836. calculationId: map['CalculationId'],
  1837. matchId: map['MatchId'],
  1838. method: map['Method'],
  1839. mode: map['Mode'],
  1840. output: map['Output'],
  1841. outputV2: map['OutputV2'],
  1842. unit: map['Unit'],
  1843. userId: map['UserId'],
  1844. );
  1845. }
  1846. Map<String, dynamic> toJson() {
  1847. final map = Map<String, dynamic>();
  1848. if (availableMethods != null) {
  1849. map['AvailableMethods'] = availableMethods;
  1850. }
  1851. if (baseType != null) {
  1852. map['BaseType'] = baseType;
  1853. }
  1854. if (calculationId != null) {
  1855. map['CalculationId'] = calculationId;
  1856. }
  1857. if (matchId != null) {
  1858. map['MatchId'] = matchId;
  1859. }
  1860. if (method != null) {
  1861. map['Method'] = method;
  1862. }
  1863. if (mode != null) {
  1864. map['Mode'] = mode;
  1865. }
  1866. if (output != null) {
  1867. map['Output'] = output;
  1868. }
  1869. if (outputV2 != null) {
  1870. map['OutputV2'] = outputV2;
  1871. }
  1872. if (unit != null) {
  1873. map['Unit'] = unit;
  1874. }
  1875. if (userId != null) {
  1876. map['UserId'] = userId;
  1877. }
  1878. return map;
  1879. }
  1880. }
  1881. class ReportMeasrueElementValueMessage {
  1882. ReportMeasureTagMessage? measureTag;
  1883. ReportTextElementValueMessage? elementValue;
  1884. ReportMeasrueElementValueMessage({
  1885. this.measureTag,
  1886. this.elementValue,
  1887. });
  1888. factory ReportMeasrueElementValueMessage.fromJson(Map<String, dynamic> map) {
  1889. return ReportMeasrueElementValueMessage(
  1890. measureTag: map['MeasureTag'] != null ? ReportMeasureTagMessage.fromJson(map['MeasureTag']) : null,
  1891. elementValue: map['ElementValue'] != null ? ReportTextElementValueMessage.fromJson(map['ElementValue']) : null,
  1892. );
  1893. }
  1894. Map<String, dynamic> toJson() {
  1895. final map = Map<String, dynamic>();
  1896. if (measureTag != null) {
  1897. map['MeasureTag'] = measureTag;
  1898. }
  1899. if (elementValue != null) {
  1900. map['ElementValue'] = elementValue;
  1901. }
  1902. return map;
  1903. }
  1904. }
  1905. class ReportMeasureElementMessage {
  1906. ReportElementTagMessage? elementTag;
  1907. List<ReportMeasrueElementValueMessage>? reportElementValues;
  1908. ReportMeasureElementMessage({
  1909. this.elementTag,
  1910. this.reportElementValues,
  1911. });
  1912. factory ReportMeasureElementMessage.fromJson(Map<String, dynamic> map) {
  1913. return ReportMeasureElementMessage(
  1914. elementTag: map['ElementTag'] != null ? ReportElementTagMessage.fromJson(map['ElementTag']) : null,
  1915. reportElementValues: map['ReportElementValues'] != null ? (map['ReportElementValues'] as List).map((e)=>ReportMeasrueElementValueMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  1916. );
  1917. }
  1918. Map<String, dynamic> toJson() {
  1919. final map = Map<String, dynamic>();
  1920. if (elementTag != null) {
  1921. map['ElementTag'] = elementTag;
  1922. }
  1923. if (reportElementValues != null) {
  1924. map['ReportElementValues'] = reportElementValues;
  1925. }
  1926. return map;
  1927. }
  1928. }
  1929. class ReportResultInfo {
  1930. String? id;
  1931. List<ReportImageInfo>? previewImages;
  1932. String? template;
  1933. List<ReportElementMessage>? reportElementValues;
  1934. List<ReportMeasureElementMessage>? reportMeasureElementValues;
  1935. List<String>? tagCodeList;
  1936. DiagnosisOrganEnum organ;
  1937. QualifiedState qualifiedState;
  1938. QualityType qualityType;
  1939. ReportResultInfo({
  1940. this.id,
  1941. this.previewImages,
  1942. this.template,
  1943. this.reportElementValues,
  1944. this.reportMeasureElementValues,
  1945. this.tagCodeList,
  1946. this.organ = DiagnosisOrganEnum.Null,
  1947. this.qualifiedState = QualifiedState.UnSet,
  1948. this.qualityType = QualityType.None,
  1949. });
  1950. factory ReportResultInfo.fromJson(Map<String, dynamic> map) {
  1951. return ReportResultInfo(
  1952. id: map['Id'],
  1953. previewImages: map['PreviewImages'] != null ? (map['PreviewImages'] as List).map((e)=>ReportImageInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1954. template: map['Template'],
  1955. reportElementValues: map['ReportElementValues'] != null ? (map['ReportElementValues'] as List).map((e)=>ReportElementMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  1956. reportMeasureElementValues: map['ReportMeasureElementValues'] != null ? (map['ReportMeasureElementValues'] as List).map((e)=>ReportMeasureElementMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  1957. tagCodeList: map['TagCodeList']?.cast<String>().toList(),
  1958. organ: DiagnosisOrganEnum.values.firstWhere((e) => e.index == map['Organ']),
  1959. qualifiedState: QualifiedState.values.firstWhere((e) => e.index == map['QualifiedState']),
  1960. qualityType: QualityType.values.firstWhere((e) => e.index == map['QualityType']),
  1961. );
  1962. }
  1963. Map<String, dynamic> toJson() {
  1964. final map = Map<String, dynamic>();
  1965. if (id != null) {
  1966. map['Id'] = id;
  1967. }
  1968. if (previewImages != null) {
  1969. map['PreviewImages'] = previewImages;
  1970. }
  1971. if (template != null) {
  1972. map['Template'] = template;
  1973. }
  1974. if (reportElementValues != null) {
  1975. map['ReportElementValues'] = reportElementValues;
  1976. }
  1977. if (reportMeasureElementValues != null) {
  1978. map['ReportMeasureElementValues'] = reportMeasureElementValues;
  1979. }
  1980. if (tagCodeList != null) {
  1981. map['TagCodeList'] = tagCodeList;
  1982. }
  1983. map['Organ'] = organ.index;
  1984. map['QualifiedState'] = qualifiedState.index;
  1985. map['QualityType'] = qualityType.index;
  1986. return map;
  1987. }
  1988. }
  1989. class SaveAppletReportRequest extends ReportResultInfo{
  1990. String? openId;
  1991. String? terminalRecordId;
  1992. SaveAppletReportRequest({
  1993. this.openId,
  1994. this.terminalRecordId,
  1995. String? id,
  1996. List<ReportImageInfo>? previewImages,
  1997. String? template,
  1998. List<ReportElementMessage>? reportElementValues,
  1999. List<ReportMeasureElementMessage>? reportMeasureElementValues,
  2000. List<String>? tagCodeList,
  2001. DiagnosisOrganEnum organ = DiagnosisOrganEnum.Null,
  2002. QualifiedState qualifiedState = QualifiedState.UnSet,
  2003. QualityType qualityType = QualityType.None,
  2004. }) : super(
  2005. id: id,
  2006. previewImages: previewImages,
  2007. template: template,
  2008. reportElementValues: reportElementValues,
  2009. reportMeasureElementValues: reportMeasureElementValues,
  2010. tagCodeList: tagCodeList,
  2011. organ: organ,
  2012. qualifiedState: qualifiedState,
  2013. qualityType: qualityType,
  2014. );
  2015. factory SaveAppletReportRequest.fromJson(Map<String, dynamic> map) {
  2016. return SaveAppletReportRequest(
  2017. openId: map['OpenId'],
  2018. terminalRecordId: map['TerminalRecordId'],
  2019. id: map['Id'],
  2020. previewImages: map['PreviewImages'] != null ? (map['PreviewImages'] as List).map((e)=>ReportImageInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  2021. template: map['Template'],
  2022. reportElementValues: map['ReportElementValues'] != null ? (map['ReportElementValues'] as List).map((e)=>ReportElementMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  2023. reportMeasureElementValues: map['ReportMeasureElementValues'] != null ? (map['ReportMeasureElementValues'] as List).map((e)=>ReportMeasureElementMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  2024. tagCodeList: map['TagCodeList']?.cast<String>().toList(),
  2025. organ: DiagnosisOrganEnum.values.firstWhere((e) => e.index == map['Organ']),
  2026. qualifiedState: QualifiedState.values.firstWhere((e) => e.index == map['QualifiedState']),
  2027. qualityType: QualityType.values.firstWhere((e) => e.index == map['QualityType']),
  2028. );
  2029. }
  2030. Map<String, dynamic> toJson() {
  2031. final map = super.toJson();
  2032. if (openId != null)
  2033. map['OpenId'] = openId;
  2034. if (terminalRecordId != null)
  2035. map['TerminalRecordId'] = terminalRecordId;
  2036. return map;
  2037. }
  2038. }
  2039. class GetAppletReportRequest extends AppletAPIBaseRequest{
  2040. String? recordId;
  2041. String? reportId;
  2042. GetAppletReportRequest({
  2043. this.recordId,
  2044. this.reportId,
  2045. String? openId,
  2046. }) : super(
  2047. openId: openId,
  2048. );
  2049. factory GetAppletReportRequest.fromJson(Map<String, dynamic> map) {
  2050. return GetAppletReportRequest(
  2051. recordId: map['RecordId'],
  2052. reportId: map['ReportId'],
  2053. openId: map['OpenId'],
  2054. );
  2055. }
  2056. Map<String, dynamic> toJson() {
  2057. final map = super.toJson();
  2058. if (recordId != null)
  2059. map['RecordId'] = recordId;
  2060. if (reportId != null)
  2061. map['ReportId'] = reportId;
  2062. return map;
  2063. }
  2064. }
  2065. class UploadConsultationImageRequest extends ReportResultInfo{
  2066. String? openId;
  2067. String? consultationId;
  2068. String? imageBase64;
  2069. UploadConsultationImageRequest({
  2070. this.openId,
  2071. this.consultationId,
  2072. this.imageBase64,
  2073. String? id,
  2074. List<ReportImageInfo>? previewImages,
  2075. String? template,
  2076. List<ReportElementMessage>? reportElementValues,
  2077. List<ReportMeasureElementMessage>? reportMeasureElementValues,
  2078. List<String>? tagCodeList,
  2079. DiagnosisOrganEnum organ = DiagnosisOrganEnum.Null,
  2080. QualifiedState qualifiedState = QualifiedState.UnSet,
  2081. QualityType qualityType = QualityType.None,
  2082. }) : super(
  2083. id: id,
  2084. previewImages: previewImages,
  2085. template: template,
  2086. reportElementValues: reportElementValues,
  2087. reportMeasureElementValues: reportMeasureElementValues,
  2088. tagCodeList: tagCodeList,
  2089. organ: organ,
  2090. qualifiedState: qualifiedState,
  2091. qualityType: qualityType,
  2092. );
  2093. factory UploadConsultationImageRequest.fromJson(Map<String, dynamic> map) {
  2094. return UploadConsultationImageRequest(
  2095. openId: map['OpenId'],
  2096. consultationId: map['ConsultationId'],
  2097. imageBase64: map['ImageBase64'],
  2098. id: map['Id'],
  2099. previewImages: map['PreviewImages'] != null ? (map['PreviewImages'] as List).map((e)=>ReportImageInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  2100. template: map['Template'],
  2101. reportElementValues: map['ReportElementValues'] != null ? (map['ReportElementValues'] as List).map((e)=>ReportElementMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  2102. reportMeasureElementValues: map['ReportMeasureElementValues'] != null ? (map['ReportMeasureElementValues'] as List).map((e)=>ReportMeasureElementMessage.fromJson(e as Map<String,dynamic>)).toList() : null,
  2103. tagCodeList: map['TagCodeList']?.cast<String>().toList(),
  2104. organ: DiagnosisOrganEnum.values.firstWhere((e) => e.index == map['Organ']),
  2105. qualifiedState: QualifiedState.values.firstWhere((e) => e.index == map['QualifiedState']),
  2106. qualityType: QualityType.values.firstWhere((e) => e.index == map['QualityType']),
  2107. );
  2108. }
  2109. Map<String, dynamic> toJson() {
  2110. final map = super.toJson();
  2111. if (openId != null)
  2112. map['OpenId'] = openId;
  2113. if (consultationId != null)
  2114. map['ConsultationId'] = consultationId;
  2115. if (imageBase64 != null)
  2116. map['ImageBase64'] = imageBase64;
  2117. return map;
  2118. }
  2119. }