/** * Patient Registration Mock Handlers * 患者注册相关的 mock 处理器 */ /** * 获取患者类型列表 - 包含多个类型 * * @description 用于测试切换患者类型的场景 * @method GET * @url /dr/api/v1/auth/protocol/patient_type * @access 需要认证 * * @returns {Object[]} data.patient_type_list - 患者类型列表 * * @example * mockGetMultiplePatientTypes(); * cy.wait('@getMultiplePatientTypes'); */ export function mockGetMultiplePatientTypes() { cy.intercept('GET', '/dr/api/v1/auth/protocol/patient_type*', { statusCode: 200, body: { code: "0x000000", description: "Success", solution: "", data: { patient_type_list: [ { id: "1", patient_type_id: "Human", patient_type_name: "Human", patient_type_local: "Human", patient_type_description: "Human Patient Type", sort: 1, is_enabled: true, product: "DROS", is_pre_install: true }, { id: "2", patient_type_id: "SpecialType", patient_type_name: "SpecialType", patient_type_local: "特殊类型", patient_type_description: "Special Patient Type", sort: 2, is_enabled: true, product: "DROS", is_pre_install: true } ] } } }).as('getMultiplePatientTypes'); } /** * 获取身体部位列表 - Human患者类型 * * @description 根据患者类型获取身体部位列表 * @method GET * @url /dr/api/v1/auth/protocol/body_part * * @returns {Object[]} data.body_part_list - 身体部位列表 * * @example * mockGetBodyPartForHuman(); * cy.wait('@getBodyPartForHuman'); */ export function mockGetBodyPartForHuman() { cy.intercept('GET', '/dr/api/v1/auth/protocol/body_part*patient_type=Human*', { statusCode: 200, body: { code: "0x000000", description: "Success", solution: "", data: { body_part_list: [ { id: "1", body_part_id: "Human_SKULL", body_part_name: "颅骨", body_part_local: "颅骨", body_part_description: "Skull", patient_type: "Human", category: "DX", sort: 1, is_enabled: true, product: "DROS", is_pre_install: true }, { id: "2", body_part_id: "Human_NECK", body_part_name: "颈部", body_part_local: "颈部", body_part_description: "Neck", patient_type: "Human", category: "DX", sort: 2, is_enabled: true, product: "DROS", is_pre_install: true } ] } } }).as('getBodyPartForHuman'); } /** * 获取身体部位列表 - SpecialType患者类型 * * @description 根据患者类型获取身体部位列表 * @method GET * @url /dr/api/v1/auth/protocol/body_part * * @returns {Object[]} data.body_part_list - 身体部位列表 * * @example * mockGetBodyPartForSpecialType(); * cy.wait('@getBodyPartForSpecialType'); */ export function mockGetBodyPartForSpecialType() { cy.intercept('GET', '/dr/api/v1/auth/protocol/body_part*patient_type=SpecialType*', { statusCode: 200, body: { code: "0x000000", description: "Success", solution: "", data: { body_part_list: [ { id: "3", body_part_id: "Special_HEAD", body_part_name: "头部", body_part_local: "头部", body_part_description: "Head", patient_type: "SpecialType", category: "DX", sort: 1, is_enabled: true, product: "DROS", is_pre_install: true } ] } } }).as('getBodyPartForSpecialType'); } /** * 获取体位列表 - Human/颅骨 * * @description 获取指定患者类型和身体部位的体位列表 * @method GET * @url /dr/api/v1/auth/protocol/view * * @returns {Object[]} data.views - 体位列表 * * @example * mockGetViewsForHumanSkull(); * cy.wait('@getViewsForHumanSkull'); */ export function mockGetViewsForHumanSkull() { cy.intercept('GET', '/dr/api/v1/auth/protocol/view*patient_type=Human*body_part=Human_SKULL*', { statusCode: 200, body: { code: "0x000000", description: "Success", solution: "", data: { "@type": "type.googleapis.com/dr.protocol.ViewList", count: 2, views: [ { internal_id: "View_DX_H_SKULL_AP", view_id: "View_DX_H_SKULL_AP", view_name: "颅骨前后位", view_name_local: "颅骨前后位", view_other_name: "Skull AP", view_description: "颅骨前后位", view_position: "AP", application: "RAD", anatomic_region: "SKULL", patient_type: "Human", body_part_id: "Human_SKULL", view_icon_name: "/Image/Position/Human/skull.ap.table.x.png", modality: "DX", work_station_id: 0, apr_id: "View_DX_H_SKULL_AP", img_proc_id: "View_DX_H_SKULL_AP", sort: 1, is_enabled: true, product: "DROS", is_pre_install: true }, { internal_id: "View_DX_H_SKULL_LAT", view_id: "View_DX_H_SKULL_LAT", view_name: "颅骨侧位", view_name_local: "颅骨侧位", view_other_name: "Skull LAT", view_description: "颅骨侧位", view_position: "LAT", application: "RAD", anatomic_region: "SKULL", patient_type: "Human", body_part_id: "Human_SKULL", view_icon_name: "/Image/Position/Human/skull.lat.table.x.png", modality: "DX", work_station_id: 0, apr_id: "View_DX_H_SKULL_LAT", img_proc_id: "View_DX_H_SKULL_LAT", sort: 2, is_enabled: true, product: "DROS", is_pre_install: true } ] } } }).as('getViewsForHumanSkull'); } /** * 获取协议列表 - Human/颅骨 * * @description 获取指定患者类型和身体部位的协议列表 * @method GET * @url /dr/api/v1/auth/protocol/procedure * * @returns {Object[]} data.procedures - 协议列表 * * @example * mockGetProceduresForHumanSkull(); * cy.wait('@getProceduresForHumanSkull'); */ export function mockGetProceduresForHumanSkull() { cy.intercept('GET', '/dr/api/v1/auth/protocol/procedure*patient_type=Human*body_part=Human_SKULL*', { statusCode: 200, body: { code: "0x000000", description: "Success", solution: "", data: { "@type": "type.googleapis.com/dr.protocol.ProcedureList", count: 1, procedures: [ { id: "1", procedure_id: "P_SKULL_AP_LAT", procedure_code: "P_SKULL_AP_LAT", procedure_name: "颅骨前后位+侧位", procedure_name_local: "颅骨前后位+侧位", procedure_other_name: "Skull AP + LAT", procedure_description: "颅骨前后位+侧位", procedure_description_local: "颅骨前后位+侧位", patient_type: "Human", body_part_id: "Human_SKULL", procedure_type: "NORMAL", fast_search: false, protocol_laterality: "U", procedure_category: "Adult", modality: "DX", sort: 1, is_enabled: true, product: "DROS", is_pre_install: true } ] } } }).as('getProceduresForHumanSkull'); } /** * 获取协议下的体位列表 * * @description 根据协议ID获取该协议下的体位列表 * @method GET * @url /dr/api/v1/auth/protocol/procedure/{procedure_id}/view * * @returns {Object[]} data.views - 体位列表 * * @example * mockGetViewsByProcedure(); * cy.wait('@getViewsByProcedure'); */ export function mockGetViewsByProcedure() { cy.intercept('GET', '/dr/api/v1/auth/protocol/procedure/*/view*', { statusCode: 200, body: { code: "0x000000", description: "Success", solution: "", data: { "@type": "type.googleapis.com/dr.protocol.ViewList", count: 2, views: [ { internal_id: "View_DX_H_SKULL_AP", view_id: "View_DX_H_SKULL_AP", view_name: "颅骨前后位", view_name_local: "颅骨前后位", view_other_name: "Skull AP", view_description: "颅骨前后位", view_position: "AP", application: "RAD", anatomic_region: "SKULL", patient_type: "Human", body_part_id: "Human_SKULL", modality: "DX", sort: 1, is_enabled: true, product: "DROS", is_pre_install: true }, { internal_id: "View_DX_H_SKULL_LAT", view_id: "View_DX_H_SKULL_LAT", view_name: "颅骨侧位", view_name_local: "颅骨侧位", view_other_name: "Skull LAT", view_description: "颅骨侧位", view_position: "LAT", application: "RAD", anatomic_region: "SKULL", patient_type: "Human", body_part_id: "Human_SKULL", modality: "DX", sort: 2, is_enabled: true, product: "DROS", is_pre_install: true } ] } } }).as('getViewsByProcedure'); }