在iMedical中编写查询消息的类方法,用于HOS中获得消息信息,返回的消息JSON格式见此处说明
/// @param {String} userCode 用户工号
/// @param {String} postCode 岗位编码
/// @param {String} orgCode 组织编码,科室编码
/// 入参格式不固定,基础平台会通过HOS入参名称注入到入参中。
/// 如:ClassMethod MessageTest(postCode = ""){}也可以得到入参
/// 如:ClassMethod MessageTest(userCode = ""){}也可以得到入参
ClassMethod MessageTest(userCode = "", postCode = "", orgCode = "")
{
Set obj = {"code":200,"data":50,"msg":"","success":true,"userCode":(userCode),"postCode":(postCode),"orgCode":(orgCode)}
w obj.%ToJSON()
q ""
}
为了实现安全访问iMedical系统中页面,需要对入口进行统一管理。使用管理员进入iMedical系统,在【侧菜单】-【系统配置】–【系统接口管理】界面上维护接口方法
hosGetMessageTest
)
配置好后,可以使用POST方法访问https://ip:port/imedical/rest/hos/接口代码来调用类方法,入参为HOS发送过来的请求参数
/message/test
)此时访问rest服务为:
POST https://114.251.235.22:1443/imedical/rest/hos/message/test HTTP/1.1
Content-Type: application/x-www-form-urlencoded
userCode=1001&postCode=1002
配置子路径后,代码形式https://114.251.235.22:1443/imedical/rest/hos/hosGetMessageTest不可再使用
在HOS中注册消息组件时,应用系统
选择【HIS系统】,在链接地址上必须按照/接口代码
格式配置参数,如下图:
访问量: 379659