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

construct_fhir_element change the given dict #28

Closed
ItayGoren opened this issue Oct 1, 2020 · 1 comment
Closed

construct_fhir_element change the given dict #28

ItayGoren opened this issue Oct 1, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@ItayGoren
Copy link
Contributor

  • fhir.resources version: 6
  • Python version: 3.8
  • Operating System: mac

Description

Running the following code:

from fhir.resources import construct_fhir_element
d = {'resourceType': 'Patient', 'contained':[{'resourceType': 'Patient'}]}
construct_fhir_element('Patient', d)

end up changing the value of d to {'resourceType': 'Patient', 'contained': [{}]}

I would expect it to not change the given object. Moreover, because it doesn't delete resourceType from the outter dictionary, I assume this behavior is not expected.
Is it on purpose?
Thanks,
Itay

@ItayGoren ItayGoren changed the title FhirAbstractModel pops resource_type from the dict construct_fhir_element change the given dict Oct 1, 2020
@nazrulworld nazrulworld added the bug Something isn't working label Oct 2, 2020
@nazrulworld
Copy link
Owner

nazrulworld commented Oct 4, 2020

@ItayGoren thank you much for your collaborating 👍
Here is the test https://github.com/nazrulworld/fhir.resources/blob/master/fhir/resources/tests/test_github_issues.py

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

2 participants