worklist.ts 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. const aliasOfFetchTwoWorks = 'getTwoStudy';
  2. export const FetchTwoWorks = `@${aliasOfFetchTwoWorks}`;
  3. // 删除Study的alias
  4. const aliasOfDeleteStudy = 'deleteStudy';
  5. export const DeleteStudy = `@${aliasOfDeleteStudy}`;
  6. // 原有的mock函数
  7. export function mockFetchTwoWorks() {
  8. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  9. statusCode: 200,
  10. body: {
  11. "code": "0x000000",
  12. "description": "Success",
  13. "solution": "",
  14. "data": {
  15. "@type": "type.googleapis.com/dr.study.StudyList",
  16. "count": 1992,
  17. "studies": [
  18. {
  19. "study_instance_uid": "2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100635",
  20. "study_id": "20250912135259444",
  21. "public_study_id": "",
  22. "specific_character_set": "ISO_IR 192",
  23. "accession_number": "ACC0012345",
  24. "ref_physician": "Dr. Smith (Vet)",
  25. "patient_id": "PET007",
  26. "patient_name": "乾隆-==皇上",
  27. "patient_english_name": "Buddy en",
  28. "patient_former_name": "Buddy f",
  29. "patient_size": "Large",
  30. "other_patient_ids": "",
  31. "other_patient_names": "",
  32. "patient_age": "5Y",
  33. "patient_dob": "2025-06-10T03:12:36.181739Z",
  34. "patient_sex": "M",
  35. "sex_neutered": "",
  36. "pregnancy_status": "",
  37. "patient_state": "",
  38. "admitting_time": null,
  39. "priority": "",
  40. "reg_source": "",
  41. "study_description": "",
  42. "study_start_datetime": "2025-09-12T05:52:59.699143Z",
  43. "study_end_datetime": null,
  44. "scheduled_procedure_step_start_date": null,
  45. "performed_physician": "",
  46. "study_lock": "Unlocked",
  47. "folder_path": "",
  48. "operator_name": "OP987",
  49. "modality": "DX",
  50. "weight": 25,
  51. "thickness": 15,
  52. "length": 60,
  53. "patient_type": "Human",
  54. "study_type": "Normal",
  55. "owner_name": "owner1",
  56. "chip_number": "CHIP123456789",
  57. "variety": "Golden Retriever",
  58. "is_anaesthesia": true,
  59. "is_sedation": true,
  60. "mwl": "",
  61. "is_exported": false,
  62. "is_edited": false,
  63. "is_appended": false,
  64. "department": "",
  65. "mapped_status": false,
  66. "qc_result": false,
  67. "comment": "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四",
  68. "study_status": "Arrived",
  69. "sort": 0,
  70. "product": "DROS",
  71. "series": []
  72. },
  73. {
  74. "study_instance_uid": "2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627",
  75. "study_id": "20250912135259265",
  76. "public_study_id": "",
  77. "specific_character_set": "ISO_IR 192",
  78. "accession_number": "ACC0012345",
  79. "ref_physician": "Dr. Smith (Vet)",
  80. "patient_id": "PET007",
  81. "patient_name": "Buddy (Dog)",
  82. "patient_english_name": "Buddy en",
  83. "patient_former_name": "Buddy f",
  84. "patient_size": "Large",
  85. "other_patient_ids": "",
  86. "other_patient_names": "",
  87. "patient_age": "5Y",
  88. "patient_dob": "2025-06-10T03:12:36.181739Z",
  89. "patient_sex": "M",
  90. "sex_neutered": "",
  91. "pregnancy_status": "",
  92. "patient_state": "",
  93. "admitting_time": null,
  94. "priority": "",
  95. "reg_source": "",
  96. "study_description": "",
  97. "study_start_datetime": "2025-09-12T05:52:59.573182Z",
  98. "study_end_datetime": null,
  99. "scheduled_procedure_step_start_date": null,
  100. "performed_physician": "",
  101. "study_lock": "Unlocked",
  102. "folder_path": "",
  103. "operator_name": "OP987",
  104. "modality": "DX",
  105. "weight": 25,
  106. "thickness": 15,
  107. "length": 60,
  108. "patient_type": "Human",
  109. "study_type": "Normal",
  110. "owner_name": "owner1",
  111. "chip_number": "CHIP123456789",
  112. "variety": "Golden Retriever",
  113. "is_anaesthesia": true,
  114. "is_sedation": true,
  115. "mwl": "",
  116. "is_exported": false,
  117. "is_edited": false,
  118. "is_appended": false,
  119. "department": "",
  120. "mapped_status": false,
  121. "qc_result": false,
  122. "comment": "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四",
  123. "study_status": "Arrived",
  124. "sort": 0,
  125. "product": "DROS",
  126. "series": []
  127. },
  128. ]
  129. }
  130. }
  131. }).as(aliasOfFetchTwoWorks);
  132. }
  133. /**
  134. * Mock: 返回2条记录,第一条未锁定
  135. */
  136. const aliasOfFetchTwoWorksWithUnlocked = 'getTwoWorksUnlocked';
  137. export const FetchTwoWorksWithUnlocked = `@${aliasOfFetchTwoWorksWithUnlocked}`;
  138. export function mockFetchTwoWorksWithUnlocked() {
  139. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  140. statusCode: 200,
  141. body: {
  142. code: '0x000000',
  143. description: 'Success',
  144. solution: '',
  145. data: {
  146. '@type': 'type.googleapis.com/dr.study.StudyList',
  147. count: 2,
  148. studies: [
  149. {
  150. study_instance_uid:
  151. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100635',
  152. study_id: '20250912135259444',
  153. public_study_id: '',
  154. specific_character_set: 'ISO_IR 192',
  155. accession_number: 'ACC0012345',
  156. ref_physician: 'Dr. Smith (Vet)',
  157. patient_id: 'PET007',
  158. patient_name: '测试患者1',
  159. patient_english_name: 'Test Patient 1',
  160. patient_former_name: '',
  161. patient_size: 'Large',
  162. other_patient_ids: '',
  163. other_patient_names: '',
  164. patient_age: '5Y',
  165. patient_dob: '2025-06-10T03:12:36.181739Z',
  166. patient_sex: 'M',
  167. sex_neutered: '',
  168. pregnancy_status: '',
  169. patient_state: '',
  170. admitting_time: null,
  171. priority: '',
  172. reg_source: '',
  173. study_description: '',
  174. study_start_datetime: '2025-09-12T05:52:59.699143Z',
  175. study_end_datetime: null,
  176. scheduled_procedure_step_start_date: null,
  177. performed_physician: '',
  178. study_lock: 'Unlocked', // 未锁定
  179. folder_path: '',
  180. operator_name: 'OP987',
  181. modality: 'DX',
  182. weight: 25,
  183. thickness: 15,
  184. length: 60,
  185. patient_type: 'Human',
  186. study_type: 'Normal',
  187. owner_name: 'owner1',
  188. chip_number: 'CHIP123456789',
  189. variety: 'Golden Retriever',
  190. is_anaesthesia: true,
  191. is_sedation: true,
  192. mwl: '',
  193. is_exported: false,
  194. is_edited: false,
  195. is_appended: false,
  196. department: '',
  197. mapped_status: false,
  198. qc_result: false,
  199. comment: '测试记录1',
  200. study_status: 'Arrived',
  201. sort: 0,
  202. product: 'DROS',
  203. series: [],
  204. },
  205. {
  206. study_instance_uid:
  207. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627',
  208. study_id: '20250912135259265',
  209. public_study_id: '',
  210. specific_character_set: 'ISO_IR 192',
  211. accession_number: 'ACC0012346',
  212. ref_physician: 'Dr. Smith (Vet)',
  213. patient_id: 'PET008',
  214. patient_name: '测试患者2',
  215. patient_english_name: 'Test Patient 2',
  216. patient_former_name: '',
  217. patient_size: 'Large',
  218. other_patient_ids: '',
  219. other_patient_names: '',
  220. patient_age: '3Y',
  221. patient_dob: '2025-06-10T03:12:36.181739Z',
  222. patient_sex: 'F',
  223. sex_neutered: '',
  224. pregnancy_status: '',
  225. patient_state: '',
  226. admitting_time: null,
  227. priority: '',
  228. reg_source: '',
  229. study_description: '',
  230. study_start_datetime: '2025-09-12T05:52:59.573182Z',
  231. study_end_datetime: null,
  232. scheduled_procedure_step_start_date: null,
  233. performed_physician: '',
  234. study_lock: 'Unlocked', // 未锁定
  235. folder_path: '',
  236. operator_name: 'OP987',
  237. modality: 'DX',
  238. weight: 25,
  239. thickness: 15,
  240. length: 60,
  241. patient_type: 'Human',
  242. study_type: 'Normal',
  243. owner_name: 'owner1',
  244. chip_number: 'CHIP123456789',
  245. variety: 'Golden Retriever',
  246. is_anaesthesia: true,
  247. is_sedation: true,
  248. mwl: '',
  249. is_exported: false,
  250. is_edited: false,
  251. is_appended: false,
  252. department: '',
  253. mapped_status: false,
  254. qc_result: false,
  255. comment: '测试记录2',
  256. study_status: 'Arrived',
  257. sort: 0,
  258. product: 'DROS',
  259. series: [],
  260. },
  261. ],
  262. },
  263. },
  264. }).as(aliasOfFetchTwoWorksWithUnlocked);
  265. }
  266. /**
  267. * Mock: 返回2条记录,第一条已锁定
  268. */
  269. const aliasOfFetchTwoWorksWithLocked = 'getTwoWorksLocked';
  270. export const FetchTwoWorksWithLocked = `@${aliasOfFetchTwoWorksWithLocked}`;
  271. export function mockFetchTwoWorksWithLocked() {
  272. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  273. statusCode: 200,
  274. body: {
  275. code: '0x000000',
  276. description: 'Success',
  277. solution: '',
  278. data: {
  279. '@type': 'type.googleapis.com/dr.study.StudyList',
  280. count: 2,
  281. studies: [
  282. {
  283. study_instance_uid:
  284. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100635',
  285. study_id: '20250912135259444',
  286. public_study_id: '',
  287. specific_character_set: 'ISO_IR 192',
  288. accession_number: 'ACC0012345',
  289. ref_physician: 'Dr. Smith (Vet)',
  290. patient_id: 'PET007',
  291. patient_name: '测试患者1',
  292. patient_english_name: 'Test Patient 1',
  293. patient_former_name: '',
  294. patient_size: 'Large',
  295. other_patient_ids: '',
  296. other_patient_names: '',
  297. patient_age: '5Y',
  298. patient_dob: '2025-06-10T03:12:36.181739Z',
  299. patient_sex: 'M',
  300. sex_neutered: '',
  301. pregnancy_status: '',
  302. patient_state: '',
  303. admitting_time: null,
  304. priority: '',
  305. reg_source: '',
  306. study_description: '',
  307. study_start_datetime: '2025-09-12T05:52:59.699143Z',
  308. study_end_datetime: null,
  309. scheduled_procedure_step_start_date: null,
  310. performed_physician: '',
  311. study_lock: 'Locked', // 已锁定
  312. folder_path: '',
  313. operator_name: 'OP987',
  314. modality: 'DX',
  315. weight: 25,
  316. thickness: 15,
  317. length: 60,
  318. patient_type: 'Human',
  319. study_type: 'Normal',
  320. owner_name: 'owner1',
  321. chip_number: 'CHIP123456789',
  322. variety: 'Golden Retriever',
  323. is_anaesthesia: true,
  324. is_sedation: true,
  325. mwl: '',
  326. is_exported: false,
  327. is_edited: false,
  328. is_appended: false,
  329. department: '',
  330. mapped_status: false,
  331. qc_result: false,
  332. comment: '测试记录1-已锁定',
  333. study_status: 'Arrived',
  334. sort: 0,
  335. product: 'DROS',
  336. series: [],
  337. },
  338. {
  339. study_instance_uid:
  340. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627',
  341. study_id: '20250912135259265',
  342. public_study_id: '',
  343. specific_character_set: 'ISO_IR 192',
  344. accession_number: 'ACC0012346',
  345. ref_physician: 'Dr. Smith (Vet)',
  346. patient_id: 'PET008',
  347. patient_name: '测试患者2',
  348. patient_english_name: 'Test Patient 2',
  349. patient_former_name: '',
  350. patient_size: 'Large',
  351. other_patient_ids: '',
  352. other_patient_names: '',
  353. patient_age: '3Y',
  354. patient_dob: '2025-06-10T03:12:36.181739Z',
  355. patient_sex: 'F',
  356. sex_neutered: '',
  357. pregnancy_status: '',
  358. patient_state: '',
  359. admitting_time: null,
  360. priority: '',
  361. reg_source: '',
  362. study_description: '',
  363. study_start_datetime: '2025-09-12T05:52:59.573182Z',
  364. study_end_datetime: null,
  365. scheduled_procedure_step_start_date: null,
  366. performed_physician: '',
  367. study_lock: 'Unlocked', // 未锁定
  368. folder_path: '',
  369. operator_name: 'OP987',
  370. modality: 'DX',
  371. weight: 25,
  372. thickness: 15,
  373. length: 60,
  374. patient_type: 'Human',
  375. study_type: 'Normal',
  376. owner_name: 'owner1',
  377. chip_number: 'CHIP123456789',
  378. variety: 'Golden Retriever',
  379. is_anaesthesia: true,
  380. is_sedation: true,
  381. mwl: '',
  382. is_exported: false,
  383. is_edited: false,
  384. is_appended: false,
  385. department: '',
  386. mapped_status: false,
  387. qc_result: false,
  388. comment: '测试记录2',
  389. study_status: 'Arrived',
  390. sort: 0,
  391. product: 'DROS',
  392. series: [],
  393. },
  394. ],
  395. },
  396. },
  397. }).as(aliasOfFetchTwoWorksWithLocked);
  398. }
  399. /**
  400. * Mock: 删除后返回1条记录
  401. */
  402. const aliasOfFetchWorklistAfterDelete = 'getWorklistAfterDelete';
  403. export const FetchWorklistAfterDelete = `@${aliasOfFetchWorklistAfterDelete}`;
  404. export function mockFetchWorklistAfterDelete() {
  405. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  406. statusCode: 200,
  407. body: {
  408. code: '0x000000',
  409. description: 'Success',
  410. solution: '',
  411. data: {
  412. '@type': 'type.googleapis.com/dr.study.StudyList',
  413. count: 1,
  414. studies: [
  415. {
  416. study_instance_uid:
  417. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627',
  418. study_id: '20250912135259265',
  419. public_study_id: '',
  420. specific_character_set: 'ISO_IR 192',
  421. accession_number: 'ACC0012346',
  422. ref_physician: 'Dr. Smith (Vet)',
  423. patient_id: 'PET008',
  424. patient_name: '测试患者2',
  425. patient_english_name: 'Test Patient 2',
  426. patient_former_name: '',
  427. patient_size: 'Large',
  428. other_patient_ids: '',
  429. other_patient_names: '',
  430. patient_age: '3Y',
  431. patient_dob: '2025-06-10T03:12:36.181739Z',
  432. patient_sex: 'F',
  433. sex_neutered: '',
  434. pregnancy_status: '',
  435. patient_state: '',
  436. admitting_time: null,
  437. priority: '',
  438. reg_source: '',
  439. study_description: '',
  440. study_start_datetime: '2025-09-12T05:52:59.573182Z',
  441. study_end_datetime: null,
  442. scheduled_procedure_step_start_date: null,
  443. performed_physician: '',
  444. study_lock: 'Unlocked',
  445. folder_path: '',
  446. operator_name: 'OP987',
  447. modality: 'DX',
  448. weight: 25,
  449. thickness: 15,
  450. length: 60,
  451. patient_type: 'Human',
  452. study_type: 'Normal',
  453. owner_name: 'owner1',
  454. chip_number: 'CHIP123456789',
  455. variety: 'Golden Retriever',
  456. is_anaesthesia: true,
  457. is_sedation: true,
  458. mwl: '',
  459. is_exported: false,
  460. is_edited: false,
  461. is_appended: false,
  462. department: '',
  463. mapped_status: false,
  464. qc_result: false,
  465. comment: '测试记录2',
  466. study_status: 'Arrived',
  467. sort: 0,
  468. product: 'DROS',
  469. series: [],
  470. },
  471. ],
  472. },
  473. },
  474. }).as(aliasOfFetchWorklistAfterDelete);
  475. }
  476. /**
  477. * Mock: 删除Study成功
  478. */
  479. export function mockDeleteStudySuccess() {
  480. cy.intercept('DELETE', '/dr/api/v1/auth/study', {
  481. statusCode: 200,
  482. body: {
  483. code: '0x000000',
  484. description: '删除成功',
  485. solution: '',
  486. data: {},
  487. },
  488. }).as(aliasOfDeleteStudy);
  489. }
  490. /**
  491. * Mock: 删除Study失败
  492. */
  493. export function mockDeleteStudyFailure() {
  494. cy.intercept('DELETE', '/dr/api/v1/auth/study', {
  495. statusCode: 200,
  496. body: {
  497. code: '0x000001',
  498. description: '删除失败',
  499. solution: '请稍后重试',
  500. data: {},
  501. },
  502. }).as(aliasOfDeleteStudy);
  503. }
  504. /**
  505. * Mock: History数据 - 2条记录,第一条未锁定
  506. */
  507. const aliasOfFetchHistoryDataWithUnlocked = 'getHistoryUnlocked';
  508. export const FetchHistoryDataWithUnlocked = `@${aliasOfFetchHistoryDataWithUnlocked}`;
  509. export function mockFetchHistoryDataWithUnlocked() {
  510. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  511. statusCode: 200,
  512. body: {
  513. code: '0x000000',
  514. description: 'Success',
  515. solution: '',
  516. data: {
  517. '@type': 'type.googleapis.com/dr.study.StudyList',
  518. count: 2,
  519. studies: [
  520. {
  521. study_instance_uid:
  522. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200001',
  523. study_id: 'HIST20250912001',
  524. public_study_id: '',
  525. specific_character_set: 'ISO_IR 192',
  526. accession_number: 'HIST001',
  527. ref_physician: 'Dr. Johnson',
  528. patient_id: 'HIST001',
  529. patient_name: 'History患者1',
  530. patient_english_name: 'History Patient 1',
  531. patient_former_name: '',
  532. patient_size: 'Medium',
  533. other_patient_ids: '',
  534. other_patient_names: '',
  535. patient_age: '40Y',
  536. patient_dob: '1985-01-01T00:00:00Z',
  537. patient_sex: 'M',
  538. sex_neutered: '',
  539. pregnancy_status: '',
  540. patient_state: '',
  541. admitting_time: null,
  542. priority: '',
  543. reg_source: '',
  544. study_description: '',
  545. study_start_datetime: '2025-09-01T08:00:00Z',
  546. study_end_datetime: '2025-09-01T09:00:00Z',
  547. scheduled_procedure_step_start_date: null,
  548. performed_physician: '',
  549. study_lock: 'Unlocked', // 未锁定
  550. folder_path: '',
  551. operator_name: 'OP001',
  552. modality: 'DX',
  553. weight: 70,
  554. thickness: 20,
  555. length: 175,
  556. patient_type: 'Human',
  557. study_type: 'Normal',
  558. owner_name: '',
  559. chip_number: '',
  560. variety: '',
  561. is_anaesthesia: false,
  562. is_sedation: false,
  563. mwl: '',
  564. is_exported: true,
  565. is_edited: false,
  566. is_appended: false,
  567. department: '',
  568. mapped_status: true,
  569. qc_result: true,
  570. comment: 'History测试记录1',
  571. study_status: 'Completed',
  572. sort: 0,
  573. product: 'DROS',
  574. series: [],
  575. },
  576. {
  577. study_instance_uid:
  578. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200002',
  579. study_id: 'HIST20250912002',
  580. public_study_id: '',
  581. specific_character_set: 'ISO_IR 192',
  582. accession_number: 'HIST002',
  583. ref_physician: 'Dr. Johnson',
  584. patient_id: 'HIST002',
  585. patient_name: 'History患者2',
  586. patient_english_name: 'History Patient 2',
  587. patient_former_name: '',
  588. patient_size: 'Medium',
  589. other_patient_ids: '',
  590. other_patient_names: '',
  591. patient_age: '35Y',
  592. patient_dob: '1990-01-01T00:00:00Z',
  593. patient_sex: 'F',
  594. sex_neutered: '',
  595. pregnancy_status: '',
  596. patient_state: '',
  597. admitting_time: null,
  598. priority: '',
  599. reg_source: '',
  600. study_description: '',
  601. study_start_datetime: '2025-09-02T08:00:00Z',
  602. study_end_datetime: '2025-09-02T09:00:00Z',
  603. scheduled_procedure_step_start_date: null,
  604. performed_physician: '',
  605. study_lock: 'Unlocked', // 未锁定
  606. folder_path: '',
  607. operator_name: 'OP001',
  608. modality: 'DX',
  609. weight: 65,
  610. thickness: 18,
  611. length: 165,
  612. patient_type: 'Human',
  613. study_type: 'Normal',
  614. owner_name: '',
  615. chip_number: '',
  616. variety: '',
  617. is_anaesthesia: false,
  618. is_sedation: false,
  619. mwl: '',
  620. is_exported: true,
  621. is_edited: false,
  622. is_appended: false,
  623. department: '',
  624. mapped_status: true,
  625. qc_result: true,
  626. comment: 'History测试记录2',
  627. study_status: 'Completed',
  628. sort: 0,
  629. product: 'DROS',
  630. series: [],
  631. },
  632. ],
  633. },
  634. },
  635. }).as(aliasOfFetchHistoryDataWithUnlocked);
  636. }
  637. /**
  638. * Mock: History数据 - 2条记录,第一条已锁定
  639. */
  640. const aliasOfFetchHistoryDataWithLocked = 'getHistoryLocked';
  641. export const FetchHistoryDataWithLocked = `@${aliasOfFetchHistoryDataWithLocked}`;
  642. export function mockFetchHistoryDataWithLocked() {
  643. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  644. statusCode: 200,
  645. body: {
  646. code: '0x000000',
  647. description: 'Success',
  648. solution: '',
  649. data: {
  650. '@type': 'type.googleapis.com/dr.study.StudyList',
  651. count: 2,
  652. studies: [
  653. {
  654. study_instance_uid:
  655. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200001',
  656. study_id: 'HIST20250912001',
  657. public_study_id: '',
  658. specific_character_set: 'ISO_IR 192',
  659. accession_number: 'HIST001',
  660. ref_physician: 'Dr. Johnson',
  661. patient_id: 'HIST001',
  662. patient_name: 'History患者1',
  663. patient_english_name: 'History Patient 1',
  664. patient_former_name: '',
  665. patient_size: 'Medium',
  666. other_patient_ids: '',
  667. other_patient_names: '',
  668. patient_age: '40Y',
  669. patient_dob: '1985-01-01T00:00:00Z',
  670. patient_sex: 'M',
  671. sex_neutered: '',
  672. pregnancy_status: '',
  673. patient_state: '',
  674. admitting_time: null,
  675. priority: '',
  676. reg_source: '',
  677. study_description: '',
  678. study_start_datetime: '2025-09-01T08:00:00Z',
  679. study_end_datetime: '2025-09-01T09:00:00Z',
  680. scheduled_procedure_step_start_date: null,
  681. performed_physician: '',
  682. study_lock: 'Locked', // 已锁定
  683. folder_path: '',
  684. operator_name: 'OP001',
  685. modality: 'DX',
  686. weight: 70,
  687. thickness: 20,
  688. length: 175,
  689. patient_type: 'Human',
  690. study_type: 'Normal',
  691. owner_name: '',
  692. chip_number: '',
  693. variety: '',
  694. is_anaesthesia: false,
  695. is_sedation: false,
  696. mwl: '',
  697. is_exported: true,
  698. is_edited: false,
  699. is_appended: false,
  700. department: '',
  701. mapped_status: true,
  702. qc_result: true,
  703. comment: 'History测试记录1-已锁定',
  704. study_status: 'Completed',
  705. sort: 0,
  706. product: 'DROS',
  707. series: [],
  708. },
  709. {
  710. study_instance_uid:
  711. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200002',
  712. study_id: 'HIST20250912002',
  713. public_study_id: '',
  714. specific_character_set: 'ISO_IR 192',
  715. accession_number: 'HIST002',
  716. ref_physician: 'Dr. Johnson',
  717. patient_id: 'HIST002',
  718. patient_name: 'History患者2',
  719. patient_english_name: 'History Patient 2',
  720. patient_former_name: '',
  721. patient_size: 'Medium',
  722. other_patient_ids: '',
  723. other_patient_names: '',
  724. patient_age: '35Y',
  725. patient_dob: '1990-01-01T00:00:00Z',
  726. patient_sex: 'F',
  727. sex_neutered: '',
  728. pregnancy_status: '',
  729. patient_state: '',
  730. admitting_time: null,
  731. priority: '',
  732. reg_source: '',
  733. study_description: '',
  734. study_start_datetime: '2025-09-02T08:00:00Z',
  735. study_end_datetime: '2025-09-02T09:00:00Z',
  736. scheduled_procedure_step_start_date: null,
  737. performed_physician: '',
  738. study_lock: 'Unlocked', // 未锁定
  739. folder_path: '',
  740. operator_name: 'OP001',
  741. modality: 'DX',
  742. weight: 65,
  743. thickness: 18,
  744. length: 165,
  745. patient_type: 'Human',
  746. study_type: 'Normal',
  747. owner_name: '',
  748. chip_number: '',
  749. variety: '',
  750. is_anaesthesia: false,
  751. is_sedation: false,
  752. mwl: '',
  753. is_exported: true,
  754. is_edited: false,
  755. is_appended: false,
  756. department: '',
  757. mapped_status: true,
  758. qc_result: true,
  759. comment: 'History测试记录2',
  760. study_status: 'Completed',
  761. sort: 0,
  762. product: 'DROS',
  763. series: [],
  764. },
  765. ],
  766. },
  767. },
  768. }).as(aliasOfFetchHistoryDataWithLocked);
  769. }
  770. /**
  771. * Mock: History删除后返回1条记录
  772. */
  773. const aliasOfFetchHistoryAfterDelete = 'getHistoryAfterDelete';
  774. export const FetchHistoryAfterDelete = `@${aliasOfFetchHistoryAfterDelete}`;
  775. export function mockFetchHistoryAfterDelete() {
  776. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  777. statusCode: 200,
  778. body: {
  779. code: '0x000000',
  780. description: 'Success',
  781. solution: '',
  782. data: {
  783. '@type': 'type.googleapis.com/dr.study.StudyList',
  784. count: 1,
  785. studies: [
  786. {
  787. study_instance_uid:
  788. '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200002',
  789. study_id: 'HIST20250912002',
  790. public_study_id: '',
  791. specific_character_set: 'ISO_IR 192',
  792. accession_number: 'HIST002',
  793. ref_physician: 'Dr. Johnson',
  794. patient_id: 'HIST002',
  795. patient_name: 'History患者2',
  796. patient_english_name: 'History Patient 2',
  797. patient_former_name: '',
  798. patient_size: 'Medium',
  799. other_patient_ids: '',
  800. other_patient_names: '',
  801. patient_age: '35Y',
  802. patient_dob: '1990-01-01T00:00:00Z',
  803. patient_sex: 'F',
  804. sex_neutered: '',
  805. pregnancy_status: '',
  806. patient_state: '',
  807. admitting_time: null,
  808. priority: '',
  809. reg_source: '',
  810. study_description: '',
  811. study_start_datetime: '2025-09-02T08:00:00Z',
  812. study_end_datetime: '2025-09-02T09:00:00Z',
  813. scheduled_procedure_step_start_date: null,
  814. performed_physician: '',
  815. study_lock: 'Unlocked',
  816. folder_path: '',
  817. operator_name: 'OP001',
  818. modality: 'DX',
  819. weight: 65,
  820. thickness: 18,
  821. length: 165,
  822. patient_type: 'Human',
  823. study_type: 'Normal',
  824. owner_name: '',
  825. chip_number: '',
  826. variety: '',
  827. is_anaesthesia: false,
  828. is_sedation: false,
  829. mwl: '',
  830. is_exported: true,
  831. is_edited: false,
  832. is_appended: false,
  833. department: '',
  834. mapped_status: true,
  835. qc_result: true,
  836. comment: 'History测试记录2',
  837. study_status: 'Completed',
  838. sort: 0,
  839. product: 'DROS',
  840. series: [],
  841. },
  842. ],
  843. },
  844. },
  845. }).as(aliasOfFetchHistoryAfterDelete);
  846. }