123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- /**
- * 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');
- }
|