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

ValueSet-validate-code: FHIRegistry looks up CodeSystem instance and not ValueSet instance leading to ClassCastException #4207

Open
paulolaup opened this issue Mar 31, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@paulolaup
Copy link

Describe the bug
If the ValueSet-validate-code operation is used to validate some code against some value set, the server falsely returns a CodeSystem isntance during processing even though the correct class to look for is specified. This leads to a ClassCastException and terminates the operation unsuccessfully.

The origin is the org.linuxforhealth.fhir.registry.FHIRRegistry::getResource method.

If requested, I can provide error logs containing the stacktrace.

Environment
I'm using version 5.1.1 of the server.

To Reproduce
Steps to reproduce the behavior:

  1. Post CodeSystem and ValueSet instance to server with same value in url-element (this might and shoudl not matter).
  2. Post ValueSet-validate-code operation with parameters url, code and system to the server (url and system with same value).

Expected behavior
Irrespective of the URL used to identifiy the value set the FHIRRegistry should look up a ValueSet instance and not a CodeSystem instant and process the request properly.

@paulolaup paulolaup added the bug Something isn't working label Mar 31, 2023
@lmsurpre
Copy link
Member

lmsurpre commented May 17, 2023

Agree we should do better in this case, but this url field is like the canonical id of this definitional resource and, per the spec, should be globally unique. In my opinion, it is unwise to use the same canonical uri for both the codesystem and the valueset.

@cpeter0702
Copy link

hi @paulolaup , how are you doing? I'm a software engineer and working on FHIR server recently. I was wondering is it possible to ask you how to import a IG package into this FHIR server? If you can share your experience or provide some related links, it would be a big help for me. Thank you so much and have a great one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants