Nova postagem

Pesquisar

Pergunta
· 18 hr atrás

HS.FHIRServer.Interop.Service returning error status code and OperationOutcome

I'm using this service to create a FHIR facade. 

I want to return OperationOutcome to the calling application when I detect an error. 

My code at present is :

set quickStreamOut=##class(HS.SDA3.QuickStream).%New()

set operationOutcome = ##class(HS.FHIR.DTL.vR4.Model.Resource.OperationOutcome).%New()

s issue = ##class(HS.FHIR.DTL.vR4.Model.Element.OperationOutcome.issue).%New()

s issue.severity = "error"

s issue.code = "exception"

s issue.details = ##class(HS.FHIR.DTL.vR4.Model.Datatype.CodeableConcept).%New()

try {

s issue.details.text = exception.DisplayString()

} catch ex {

s issue.details.text = "Unknown exception"

}

d operationOutcome.issue.Insert(issue)

$$$ThrowOnError(quickStreamOut.CopyFrom(operationOutcome.ToJSON()))

set response = ##class(HS.FHIRServer.Interop.Response).%New()

set response.Response.ResponseFormatCode="JSON"

set response.Response.Status=200

set response.ContentType="application/fhir+json"

set response.CharSet = "utf8"

set response.QuickStreamId = quickStreamOut.%Id()

If I change the response code to 422, the calling app doesn't get the OperationOutcome. Instead I get 


The custom error module does not recognize this error.
 

Do I need to implement a custom error? 

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· 20 hr atrás

An Operation can't find a .iostream file

A .iostream file got stored in /intersystems/HCENG01B12/mgr/Temp for a BatchFileOperation class while HC was on the secondary node.  HealthConnect is now on the primay node and cannot find that .iostream file path.  The operation starts throwing errors when the RolloverSchedule is reached

OnKeepalive() returned ERROR #5012: File '/intersystems/HCENG01B12/mgr/Temp/QWhoZAwFF3f9jQ.iostream'
does not exist

How can I resolve this issue?

2 novos comentários
Discussão (2)2
Entre ou crie uma conta para continuar
Artigo
· 21 hr atrás 3min de leitura

在无法访问系统 x509 证书/密钥的情况下生成 JWT

如果要从 x509 证书/密钥生成JWT,对%SYS.X509Credentials的任何操作(包括读取)都需要 %Admin_Secure 资源上的 U。之所以需要 %Admin_Secure,是因为 %SYS.X509Credentials 是持久的,这样做是为了防止所有用户访问私钥。

如果 %Admin_Secure 资源在运行时不可用,可以使用以下变通方法。

在查看 JWT 生成代码时,我发现 JWT 代码仅利用 %SYS.X509Credentials 作为 PrivateKeyPrivateKeyPasswordCertificate 的运行时数据源。作为一种变通方法,您可以使用 X.509 接口的运行时非持久化实现,只公开这些属性。如果要使用互操作性,证书/PK 可以存储在凭证中,以便安全访问:

Class User.X509 Extends %RegisteredObject
{

Property PrivateKey As %VarString;
Property PrivateKeyPassword As %String;
Property Certificate As %VarString;
Property HasPrivateKey As %Boolean [ InitialExpression = {$$$YES} ];
ClassMethod GetX509() As User.X509
{
    set x509 = ..%New()
    set x509.PrivateKey = ..Key()
    set x509.Certificate = ..Cert()
    quit x509
}

/// Get X509 object from credential.
/// Username is a Cert, Password is a Private Key
ClassMethod GetX509FromCredential(credential) As User.X509
{
    set credentialObj = ##class(Ens.Config.Credentials).%OpenId(credential,,.sc)
    throw:$$$ISERR(sc) ##class(%Exception.StatusException).ThrowIfInterrupt(sc)
    
    set x509 = ..%New()
    set x509.PrivateKey = credentialObj.Password
    set x509.Certificate = credentialObj.Username
    quit x509
}

ClassMethod Key()
{
    q "-----BEGIN RSA PRIVATE KEY-----"_$C(13,10)
    _"YOUR_TEST_KEY"_$C(13,10)
    _"-----END RSA PRIVATE KEY-----"
}

ClassMethod Cert() As %VarString
{
    q "-----BEGIN CERTIFICATE-----"_$C(13,10)
    _"YOUR_TEST_CERT"_$C(13,10)
    _"-----END CERTIFICATE-----"
}

}

您还可以通过以下方式生成 JWT:

ClassMethod JWT() As %Status
{
    Set sc = $$$OK
    //Set x509 = ##class(%SYS.X509Credentials).GetByAlias("TempKeyPair")
    Set x509 = ##class(User.X509).GetX509()
    
    Set algorithm ="RS256"
    Set header = {"alg": (algorithm), "typ": "JWT"}
    Set claims= {"Key": "Value" }
    
    #; create JWK
    Set sc = ##class(%Net.JSON.JWK).CreateX509(algorithm,x509,.privateJWK)
    
    If $$$ISERR(sc) {
        Write $SYSTEM.OBJ.DisplayError(sc)
    }

    #; Create JWKS
    Set sc = ##class(%Net.JSON.JWKS).PutJWK(privateJWK,.privateJWKS)
    
    If $$$ISERR(sc) {
        Write $SYSTEM.OBJ.DisplayError(sc)
    }

    Set sc = ##Class(%Net.JSON.JWT).Create(header,,claims,privateJWKS,,.pJWT)
    
    If $$$ISERR(sc) {
        Write $SYSTEM.OBJ.DisplayError(sc)
    }
    
    Write pJWT
	Return sc
}

或者,您也可以使用动态对象来跳过类的创建,在这种情况下,它将看起来像这样:

ClassMethod JWT(credential) As %Status
{
    Set sc = $$$OK
    //Set x509 = ##class(%SYS.X509Credentials).GetByAlias("TempKeyPair")
    Set credentialObj = ##class(Ens.Config.Credentials).%OpenId(credential,,.sc)
    throw:$$$ISERR(sc) ##class(%Exception.StatusException).ThrowIfInterrupt(sc)
    
    Set x509 = {
        "HasPrivateKey": true,
        "PrivateKey": (credentialObj.Password),
        "PrivateKeyPassword":"",
        "Certificate":(credentialObj.Username)
    }

    Set algorithm ="RS256"
    Set header = {"alg": (algorithm), "typ": "JWT"}
    Set claims= {"Key": "Value" }
    
    #; create JWK
    Set sc = ##class(%Net.JSON.JWK).CreateX509(algorithm,x509,.privateJWK)
    
    If $$$ISERR(sc) {
        Write $SYSTEM.OBJ.DisplayError(sc)
    }

    #; Create JWKS
    Set sc = ##class(%Net.JSON.JWKS).PutJWK(privateJWK,.privateJWKS)
    
    If $$$ISERR(sc) {
        Write $SYSTEM.OBJ.DisplayError(sc)
    }

    Set sc = ##Class(%Net.JSON.JWT).Create(header,,claims,privateJWKS,,.pJWT)
    
    If $$$ISERR(sc) {
        Write $SYSTEM.OBJ.DisplayError(sc)
    }
    
    Write pJWT
    Return sc
}
Discussão (0)1
Entre ou crie uma conta para continuar
Anúncio
· 22 hr atrás

新的人工智能 CCR 助手

CCR 现在包括一个人工智能驱动的 "CCR 助手",可供测试人员使用。CCR 助手可帮助您快速获得有关常见 CCR 工作流程、术语或最佳实践的答案。每个回复都包含相关 ICC 培训课程的参考资料,方便您深入了解任何主题。作为未来的改进,这些链接将直接指向用于生成回复的 ICC 培训 PDF 的特定页面。

要访问该助手,请点击 CCR 应用程序右下方的蓝色 "打开 CCR 助手 "图标。对话会在浏览器会话中保存,但会在注销时清除。

您可以通过点击 "竖起大拇指 "或 "摁下大拇指 "按钮并输入可选评论来提交对任何回复的反馈意见。我们非常感谢您的反馈,这将有助于我们继续提高回复质量!

要试用 CCR 助手,请导航到侧边栏的用户菜单,选中您的个人资料下的测试版测试员复选框,然后单击保存。您可以随时取消选中该复选框。

有关 CCR 助手的快速操作演示,请观看下面的视频。

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· 22 hr atrás

JDBC Connection Issue: Cache 2018.1 Access Denied

Hello Community,

I am facing a JDBC connection issue after migrating from Caché 2016 to Caché 2018.1. When I attempt to connect using the following connection settings:

CACHE_DATASOURCE_URL=jdbc:Cache://localhost:1972/TEST

CACHE_DB_USERNAME=test

CACHE_DB_PASSWORD=test
 

I consistently receive the following error:

[Cache JDBC] Communication link failure: Access Denied

This configuration worked perfectly with Caché 2016. I have verified the following:

  1. The namespace (TEST) exists and is correctly specified in the connection URL.
  2. The credentials (username: test, password: test) are correct.
  3. The Caché instance is running on the correct hostname and port (localhost:1972)

Has anyone encountered a similar issue? Are there any known differences or required configurations for JDBC connections in Caché 2018 that weren’t present in Caché 2016?

I appreciate any guidance or support.

Thank you!

6 novos comentários
Discussão (6)2
Entre ou crie uma conta para continuar