Hi Pierre,

It looks the error showing class does not exist, Here NS is defined in Uppercase letters and using the class name in different. Can you try like this..

Set sc = ##class(BNA.Utils.Sql).SelectFirstColsInArray(query, .userIds)

Hi Bing,

I have defined the SessionApplication property for "HS.FHIRServer.API.Data.Request" object 

Set request.SessionApplication="/csp/healthshare/<namespace>/fhir/r4".

BaseURL looks not referring ServiceIdIdx value. After I debug my code, added the command and tried. It worked for me. 

You can try like Set len=$$$MaxStringLength instead of 1000. The above example reading text upto 1000 characters so message is truncated while printing the message.

Hi All, 

Thank you for your support,

I could able to find the issue and corrected. Now I can able to publish the data to FHIR repository URL. 

Thank you all for your thoughts,

I tried to send the Patient resource to FHIR repository through HS.FHIRServer.API.Data.Request object and now the above error disappear but my request not send to the repository and see the Operation log displays and I can send the data from Postman. I couldn't see any request coming through from interface in HTTP Access log.

ERROR #5770: Object open failed because 'ServiceIdIdx' key value of '' was not found error. Could you please suggest why this error occurs.

#dim patient AS HS.FHIR.DTL.vR4.Model.Base.Resource
    #dim interopRequest AS HS.FHIRServer.Interop.Request
    Set apiRequest = ##class(HS.FHIRServer.API.Data.Request).%New()
    Set apiRequest.QueryString=""
    Set apiRequest.BaseURL="/csp/healthshare/fhirdemo/fhir/r4"
    Set apiRequest.RequestMethod="POST"
    Set apiRequest.RequestFormatCode="JSON"
    Set apiRequest.ResponseFormatCode="JSON"
    Set apiRequest.RequestPath="/Patient"

Thank you for your reply. I have processed resources and tried it to setup. I got a clear idea now.

Thank you soo much again.

It looks the result set not fully executed by the service and forcefully terminating the service. Hence it throws the error. Can you try to extend the execution time and see, still getting the error.

Did you verify connectivity between your system (server) and the other system?

Is the firewall rule enabled for the IP that you want to connect to?