Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fhir-client] Calling $validate from the fhir-client fails in the main branch #3722

Closed
vikforfda opened this issue Jun 17, 2022 · 4 comments
Closed
Assignees
Labels
invalid This doesn't seem right

Comments

@vikforfda
Copy link

We are using the FHIRClient validate method to validate Bundle resource by passing the Bundle object.

client.validate(finalBundle)

It fails to perform validation. The FHIR server log displays following message

[6/17/22, 16:27:24:361 UTC] 00000042 FHIRHttpServl 2 Creating FHIRHttpServletRequestWrapper for HttpServletRequest: com.ibm.ws.webcontainer40.srt.SRTServletRequest40@ee864739
[6/17/22, 16:27:24:361 UTC] 00000042 FHIRHttpServl 2 Retrieved these 'header' query parameters from the request URI: {}
[6/17/22, 16:27:24:361 UTC] 00000042 FHIRHttpServl 2 Content-Type is application/xml
[6/17/22, 16:27:24:361 UTC] 00000042 FHIRRestServl I Received request: tenantId:[default] dsId:[default] user:[fhiruser] method:[POST] uri:[http://ibm-fhir.dev.splfhirpoc.com/fhir-server/api/v4/Resource/$validate]
[6/17/22, 16:27:24:365 UTC] 00000042 FHIRProvider > com.ibm.fhir.provider.FHIRProvider readFrom ENTRY
[6/17/22, 16:27:24:375 UTC] 00000042 FHIRProvider < com.ibm.fhir.provider.FHIRProvider readFrom RETURN
[6/17/22, 16:27:24:376 UTC] 00000042 Operation > com.ibm.fhir.server.resources.Operation invoke(String,String,Resource) ENTRY
[6/17/22, 16:27:24:376 UTC] 00000042 FHIRResource 1 'Resource' is not a valid resource type.
[6/17/22, 16:27:24:381 UTC] 00000042 FHIRResource 1
OperationOutcome:
{"resourceType":"OperationOutcome","id":"ac-13-0-2-cd77fa72-e66c-4b97-a533-56c7af817a67","issue":[{"severity":"fatal","code":"not-supported","_code":{"extension":[{"url":"http://ibm.com/fhir/extension/not-supported-detail","valueCode":"resource"}]},"details":{"text":"'Resource' is not a valid resource type."}}]}
[6/17/22, 16:27:24:381 UTC] 00000042 RestAuditLogg > com.ibm.fhir.server.util.RestAuditLogger logOperation ENTRY
[6/17/22, 16:27:24:381 UTC] 00000042 RestAuditLogg < com.ibm.fhir.server.util.RestAuditLogger logOperation RETURN
[6/17/22, 16:27:24:381 UTC] 00000042 Operation < com.ibm.fhir.server.resources.Operation invoke(String,String,Resource) RETURN
[6/17/22, 16:27:24:382 UTC] 00000042 FHIRProvider > com.ibm.fhir.provider.FHIRProvider writeTo ENTRY
[6/17/22, 16:27:24:385 UTC] 00000042 FHIRProvider < com.ibm.fhir.provider.FHIRProvider writeTo RETURN
[6/17/22, 16:27:24:385 UTC] 00000042 FHIRRestServl I Completed request[0.024226862 secs]: tenantId:[default] dsId:[default] user:[fhiruser] method:[POST] uri:[http://ibm-fhir.dev.splfhirpoc.com/fhir-server/api/v4/Resource/$validate] status:[404]
[6/17/22, 16:27:24:385 UTC] 00000042 FHIRRestServl < com.ibm.fhir.server.filter.rest.FHIRRestServletFilter doFilter RETURN

Following is a sample Bundl resource that has validation error but the validation operation does npt detect it
EST-REG-ForVikas-RegTesting-Enriched.xml.zip

@lmsurpre
Copy link
Member

Thanks Vikas. It looks like the client was dependent on $validate being served at [base]/Resource/$validate.
We used to support that but I removed that support in #3265.
I think we'll need to update the client to infer the resource type from the resource that was passed.

https://chat.fhir.org/#narrow/stream/179166-implementers/topic/.24validate.20operation.20url for more info.

@lmsurpre lmsurpre added the bug Something isn't working label Jun 17, 2022
@lmsurpre lmsurpre changed the title Validation Operation is failing after we upgraded our IBM-FHIR to current R4b release main branch. the current code was working prior to this upgrade [fhir-client] Calling $validate from the fhir-client fails in the main branch Jun 17, 2022
@lmsurpre lmsurpre self-assigned this Jun 20, 2022
@lmsurpre
Copy link
Member

@vikforfda what kind of object is your finalBundle?

our FHIRClientImpl validate implementation is already invoking validate on a type-specific basis, and so I now suspect this is an issue with your code and not ours.

@lmsurpre
Copy link
Member

closing as unable to reproduce

@lmsurpre lmsurpre closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2022
@lmsurpre lmsurpre added invalid This doesn't seem right and removed bug Something isn't working labels Jun 20, 2022
@vikforfda
Copy link
Author

The issue was on our side. We were using an older version of fhir client to invoke the validation operation API. After we updated it to use versions 4.11.1 (most recent IBM-FHIR release) or 5.0.0-SNAPSHOT (corresponds to the WIP IBM-FHIR R4b release) then the validation correctly identified the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants