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

Extension URL not validating properly #126

Open
LTA-Thinking opened this issue Apr 14, 2023 · 2 comments
Open

Extension URL not validating properly #126

LTA-Thinking opened this issue Apr 14, 2023 · 2 comments

Comments

@LTA-Thinking
Copy link

Describe the bug
When validating a resource with an extension the extension's url property is not being properly validated. According to the FHIR spec: "Except for child extensions defined within complex extensions, the URL SHALL be an absolute URL."

To Reproduce
Steps to reproduce the behavior:

  1. Validate a resource with an Extension element:
{
	"resourceType": "Patient",
	"extension": [
		{
			"url": "invalid"
			"valueString": "Invalid URL"
		},
		{
			"url": "https://fake.notreal/extension",
			"valueString": "Valid URL"
		},
		{
			"url": "https://fake.notreal/nested-extension",
			"extension": [
				{
					"url": "valid-nested",
					"valueString": "Valid nested URL"
				}
			]
		}
	]
}

Expected behavior
Top level extension URLs are validated to ensure they are absolute URLs, while sub-extension's URLs are not.

Version used:

  • FHIR Version: All
  • Version: 4.3.0
@ewoutkramer
Copy link
Member

We're currently only validating rules that have been expressed explicitly in the StructureDefinition - so either structurally or using a FhirPath statement. The spec is indeed full of "textual" rules that would require manual coding, which we have not done yet. That said, it's on our medium-term planning to fix this, so I'll tag this as a validation enhancement.

@marcovisserFurore marcovisserFurore transferred this issue from FirelyTeam/firely-net-sdk Jul 20, 2023
@mmsmits
Copy link
Member

mmsmits commented Sep 5, 2024

We can validate this in both the instance that uses an extension, as in the StructureDefinition that defines an extension.
Let's fix it in the StructureDefinition, the author needs to be warned.
Please review the rules for extension.url before fixing this.

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

No branches or pull requests

3 participants