Indeed it is in the Location Header.

From the related FHIR docs:

The server returns a 201 Created HTTP status code, and SHALL also return a Location header which contains the new Logical Id and Version Id of the created resource version:

  Location: [base]/[type]/[id]/_history/[vid]

where [id] and [vid] are the newly created id and version id for the resource version. The Location header should be as specific as possible - if the server understands versioning, the version is included. If a server does not track versions, the Location header will just contain [base]/[type]/[id]. The Location MAY be an absolute or relative URL.

Following up on Shawn's response, these resources might also be helpful in the meantime, and perhaps for others -

"See how to use key features of the Healthcare Action Engine to set up real-time alerts for clinicians. In this exercise, you will build decision support, design a notification using a CDS Hooks card, and write a rule to deliver it."

[I believe the same comment Shawn mentioned about being required to be a HealthShare customer in order to access this content is relevant here as well.]

Working with Yakov on this, we saw that for SCOPE_IDENTITY() to work on the SQL Serve side it needs to be in the same "scope" of the INSERT (for example in the same Stored Procedure), see here for reference.

So what Yakov ended up doing was encapsulating the INSERT and SELECT SCOPE_IDENTITY() into a Stored Procedure which returns the newly inserted Row ID, and call the SP via the Adapter, thus inserting the new record and getting back the new ID.

Hi Craig,

Perhaps this could help -

From: https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_grant

You can use SCHEMA schema-name as the object-list value to grant the object-privilege to all of the tables, views, and stored procedures in the named schema, in the current namespace. For example, GRANT SELECT ON SCHEMA Sample TO Deborah grants this user SELECT privilege for all objects in the Sample schema. This includes all objects that will be defined in this schema in the future. You can specify multiple schemas as a comma-separated list; for example, GRANT SELECT ON SCHEMA Sample,Cinema TO Deborah grants SELECT privilege for all objects in both the Sample and the Cinema schemas.

I'm not sure if I fully understand your question Eduard, but the token itself, internally, is built by the original request's Message Header ID (and the Production name; concatenated with a pipe - |)

E.g., from the code (in Ens.Host):

Method GetDeferredResponseToken(pMessageHeader As Ens.MessageHeader) As %String
{
    Quit pMessageHeader.%Id()_"|"_$$$EnsRuntime("Name")
}

ClassMethod SendDeferredResponse(pDeferredResponseToken As %String, pResponse As %Library.Persistent) As %Status
{
    Set tSC=$$$OK
    Try {
        Set tMessageHeaderId=$p(pDeferredResponseToken,"|",1)
        Set tProductionName=$p(pDeferredResponseToken,"|",2)

Note this is of course internal implementation, and I don't think it is documented or supported (i.e. might change in future versions without notice).

Thanks for filling in the picture Michael.
So this seems to fit into the theory I had about the error indicating your SOAP client is not receiving the response it expected.

You can see the server (the SOAP service) you are turning to is running into an internal error (HTTP status 500) and you also have details about the error they ran into "javax.... " and their relevant stack.

I suggest, if it is possible, that you turn to the entity that is behind this service and report to them the error you are getting (makes sense also to share with them what you see in the log that you are sending to them).

And they might be able to help you.

Hi Michael,

It's a little difficult to tell just from the description you provided what the problem exactly is, but my guesstimate would be that it actually is not related to the encoding (UTF8 vs ISO-8859-1) of what you are sending, but something to do with the response you are getting back.

As the error you quoted mentions - "... returned response with unexpected...".

And specifically the error is complaining about the content-type being text/html where it should probably be expected to be (in the case of SOAP) xml.

So it looks like you provided an extract from the SOAP log - but of what was sent (Output) but not what was received back.

Maybe share that part and we'd be able to help a little more.