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

Update fhir.resources dependency #109

Open
bwalsh opened this issue Dec 3, 2024 · 0 comments
Open

Update fhir.resources dependency #109

bwalsh opened this issue Dec 3, 2024 · 0 comments
Assignees

Comments

@bwalsh
Copy link
Collaborator

bwalsh commented Dec 3, 2024

We are current with https://github.com/nazrulworld/fhir.resources release 7.1.0 but it has a new release imminent (should be faster)

Release 8 has breaking changes https://github.com/nazrulworld/fhir.resources?tab=readme-ov-file#migration-from-7xx-to-8xx

Additionally, we discovered a shortcoming in 7.1.0.
7.1.0's validator allows the user to assign floats with significant digits to integer fields.

e.g.

patient_dict = {"multipleBirthInteger": 32.9}
patient = Patient.parse_obj(patient_dict)
patient.validate()
# is silently truncated to 
Patient.multipleBirthInteger = 32

After updating, a validation error is raised

    with pytest.raises(ValidationError):
        patient_dict = {"multipleBirthInteger": 32.9}
        patient = Patient.model_validate(patient_dict)
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

1 participant