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

NullPointer Exception for $validate with hapi-fhir-jpaserver-starter / UnknownCodeSystemWarningValidationSupport #2971

Open
oliveregger opened this issue Sep 8, 2021 · 0 comments · May be fixed by #2972

Comments

@oliveregger
Copy link
Contributor

oliveregger commented Sep 8, 2021

Describe the bug
When using the $validate operation with the hapi-fhir-jpaserver-starter a NP is raised by the UnknownCodeSystemWarningValidationSupport when providing a resource to validate:

ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method: java.lang.NullPointerException
        at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:272)
...
  
Caused by: java.lang.NullPointerException: null
        at ca.uhn.fhir.context.support.DefaultProfileValidationSupport.fetchCodeSystemOrValueSet(DefaultProfileValidationSupport.java:182)
        at ca.uhn.fhir.context.support.DefaultProfileValidationSupport.fetchCodeSystem(DefaultProfileValidationSupport.java:160)
        at org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain.fetchCodeSystem(ValidationSupportChain.java:217)
        at org.hl7.fhir.common.hapi.validation.support.BaseValidationSupportWrapper.fetchCodeSystem(BaseValidationSupportWrapper.java:86)
        at org.hl7.fhir.common.hapi.validation.support.UnknownCodeSystemWarningValidationSupport.validateCodeInValueSet(UnknownCodeSystemWarningValidationSupport.java:40)
        at org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain.validateCodeInValueSet(ValidationSupportChain.java:289)
        at org.hl7.fhir.common.hapi.validation.support.BaseValidationSupportWrapper.validateCodeInValueSet(BaseValidationSupportWrapper.java:107)

Expected behavior
Don't throw a NP at L180 or don't call fetchCodeSystem from UnknownCodeSystemWarningValidationSupport with null as codesytem:

			// System can take the form "https://url|version"
			String system = theSystem;
			if (system.contains("|")) {

Environment (please complete the following information):

  • HAPI FHIR Version 5.5.1
  • OS: OSX

Additional context
Will provide a PR to fix the behaviour.

oliveregger added a commit to ahdis/hapi-fhir that referenced this issue Sep 8, 2021
@oliveregger oliveregger linked a pull request Sep 8, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant