Getting Started with fhir.resources and Synthea #136
-
I'm brand new to using this library so apologies if I'm missing something basic. I'm generating sample FHIR bundles using the Synthea project. I've attached my sample file. When attempting to parse the file it fails with 2067 validation errors. I've attached the sample file. The code is very simple. import os
from fhir.resources.patient import Patient
from fhir.resources.bundle import Bundle
patientFile = "Agripina633_Howe413_8aca2c5e-a829-09e1-74f2-d15cec8a9008.json"
patientBundle = Bundle.parse_file(patientFile) Agripina633_Howe413_8aca2c5e-a829-09e1-74f2-d15cec8a9008.json.zip I'm curious if this error is due to my usage or version of the simulated FHIR or something else? The error with the first few validation errors are as follows: patientBundle = Bundle.parse_file(patientFile) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @fdefalco |
Beta Was this translation helpful? Give feedback.
-
@fdefalco I think you were using wrong FHIR version, perhaps the bundle you attached is FHIR version R4/R4B. |
Beta Was this translation helpful? Give feedback.
-
Thanks, sorry for missing a simple resolution. Is there no way to infer the FHIR version from the document itself so I might allow my data pipeline to be more resilient and use the proper bundle version based on the content of the file? |
Beta Was this translation helpful? Give feedback.
@fdefalco I think you were using wrong FHIR version, perhaps the bundle you attached is FHIR version R4/R4B.
from fhir.resources.R4B.bundle import Bundle
patientBundle = Bundle.parse_file(patientFile)