明天医网腾讯觅影AI对接文档

一.业务流程
这里以内镜的食管癌为例:
内镜检查做完–发布到eCenter–影像中心触发–应用服务器4.0接口服务上传给AI–AI结果返回。

二.部署:
1.影像中心数据库执行:

USE [eCenter]
GO

/****** Object: Table [dbo].[IntegrationTask] Script Date: 11/24/2017 19:00:01 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

IF NOt EXISTS (SELECT * FROM dbo.SysObjects WHERE ID = object_id(N’IntegrationTask’) AND OBJECTPROPERTY(ID, ‘IsTable’) = 1)
CREATE TABLE [dbo].[IntegrationTask](
[TaskId] [bigint] IDENTITY(1,1) NOT NULL,
[InteractionType] [varchar](64) NOT NULL,
[InteractionId] [varchar](64) NULL,
[InteractionIdExt1] [varchar](64) NULL,
[ControlCode] [varchar](64) NULL,
[ControlId] [varchar](64) NULL,
[CommunicationType] [varchar](16) NULL,
[TaskStatus] [tinyint] NOT NULL,
[BusinessKeyUID] [uniqueidentifier] NULL,
[BusinessKey] [varchar](64) NULL,
[BusinessKeyExt1] [varchar](512) NULL,
[BusinessKeyExt2] [varchar](64) NULL,
[BusinessKeyExt3] [varchar](64) NULL,
[SenderId] [varchar](64) NULL,
[ReceiverId] [varchar](64) NULL,
[ReceiverServiceUID] [uniqueidentifier] NULL,
[ReceiverEndpoint] [varchar](256) NULL,
[InitiateUser] [varchar](64) NULL,
[InitiateHost] [varchar](64) NULL,
[InitiateModule] [varchar](64) NULL,
[CreateTime] [datetime] NOT NULL,
[ProcessHost] [varchar](64) NULL,
[ProcessModule] [varchar](64) NULL,
[ProcessTime] [datetime] NULL,
[ErrorInfo] [varchar](4000) NULL,
[OrganizationID] [varchar](64) NULL,
[ParentTaskId] [bigint] NULL,
[MsgContent] [varchar](max) NULL,
[RetryCount] [smallint] NULL,
CONSTRAINT [PK_IntegrationTask] PRIMARY KEY CLUSTERED
(
[TaskId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[IntegrationTask] ADD CONSTRAINT [DF__Integrati__TaskS__658C0CBD] DEFAULT ((0)) FOR [TaskStatus]
GO
______________________________________________________________USE [TomTawCenter]
GO

/****** Object: Trigger [dbo].[Trg_OR_IntergrationTask] Script Date: 12/15/2017 15:12:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER [dbo].[Trg_OR_IntergrationTask]
ON [dbo].[ExaminationDistribution]
AFTER INSERT,UPDATE
AS
BEGIN
declare
@v_Modality varchar(16),
@v_ExamIndex int,
@v_ResultStatus varchar(16),
@v_StudyInstanceUID varchar(512),
@v_AccessionNumber varchar(64),
@v_ServiceSectID varchar(64),
@cursor_inserted cursor;

if not update(PushState) and Exists(select 1 from inserted)
begin
set @cursor_inserted = cursor scroll for select ExamIndex,State,AccessionNumber,ExamineType from inserted;
open @cursor_inserted;
fetch first from @cursor_inserted into @v_ExamIndex, @v_ResultStatus, @v_AccessionNumber, @v_ServiceSectID;

while (@@fetch_status = 0)
begin
IF (@v_ServiceSectID = ‘CT’ or @v_ServiceSectID = ‘ES’)
begin
— 查找已有任务记录
IF NOT EXISTS (SELECT 0 FROM IntegrationTask WHERE InteractionType=’NingBoDYYYaiyixueJob’ and BusinessKey=@v_ExamIndex)
begin
insert into IntegrationTask(InteractionType,CommunicationType,TaskStatus,BusinessKey,BusinessKeyExt2,BusinessKeyExt3,InitiateModule,CreateTime)
values(‘NingBoDYYYaiyixueJob’,’Send’,0,@v_ExamIndex,@v_AccessionNumber,@v_ServiceSectID,’Trg_OR_IntergrationTask’,getdate());
end
end
–继续读取下一条记录
fetch next from @cursor_inserted into @v_ExamIndex, @v_ResultStatus, @v_AccessionNumber, @v_ServiceSectID;
end

close @cursor_inserted;
deallocate @cursor_inserted;
end
END

GO

3.部署应用服务器:
应用服务器添加服务:

 

打赏
此条目发表在我的笔记分类目录。将固定链接加入收藏夹。

发表评论