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

FIX FHIR result set resource type #70

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

diegodfreire
Copy link
Contributor

When using FHIR R4 models in the resource_type parameter, it is always ignored and instantiates the latest model version (current is R5).

When using FHIR R4 models in the resource_type parameter, it is always ignored and instantiates the latest model (R5).
@diegodfreire diegodfreire requested a review from ninaalves April 9, 2025 03:15
@coveralls
Copy link

Coverage Status

coverage: 29.437%. remained the same
when pulling fe4945a on hotfix/fhir-result-set-resource-type
into 15a1c30 on main.

@@ -175,7 +175,7 @@ def get_page_resources(self) -> Generator[DomainResource]:
return

for entry in self.response["entry"]:
resource_class = get_fhir_model_class(entry["resource"]["resourceType"])
resource_class = self.resource_class or get_fhir_model_class(entry["resource"]["resourceType"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should fail/warn when the self.resource_class does not match the response's resourceType?

Also, shouldn't the response's resourceType be more important? I'm thinking about results that might have a bunch of mixed resource types (Patient, Appointment, Encounter), and if we use the response's resourceType, we'll be able to properly build those resources.

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 this pull request may close these issues.

3 participants