Open vshah11 opened 2 months ago
I'm facing similar issue with fhir.resources version: 7.1.0 for Organization.
from fhir.resources.organization import Organization
from fhir.resources.address import Address
data = {"id": "f001", "active": True, "name": "Acme Corporation", "address": [{"country": "Switzerland"}]}
org = Organization(**data)
same code from example is throwing "Extra fields not permitted" error.
It seems you chose the wrong FHIR version. In FHIR R5 https://www.hl7.org/fhir/organization.html there is no property named "address", so naturally you are getting this error.
Thank you for your response. I'm actually looking for some assistance here. I'm new in Health Care technologies and not very sure of the latest standards.
I went through the documentation and understood that R4 only had "address" in "Organization". Is there any old version of fhir.resources that parses R4 version?
You can try
from fhir.resources.R4B.organization import Organization
from fhir.resources.R4B.address import Address
data = {"id": "f001", "active": True, "name": "Acme Corporation", "address": [{"country": "Switzerland"}]}
org = Organization(**data)
Thank you again for your help. I'm able to parse my JSONs now!
Description
I am using fhir.resources to parse the AllergyIntolerance resource object. According to latest version of pydantic v2 and fhir.resources, it should be accepting the reaction.manifestation fields but I keep getting the -
extra fields not permitted (type=value_error.extra)
error.The fhir documentation specifying that this is a valid AllergyIntolerance field and not an Extra -
https://hl7.org/fhir/R4/allergyintolerance.html
I wish to understand if there are some breaking changes when upgrading fhir.resources to version 7.1 and pydantic to version 2.*? My previous setup had
"fhir.resources==6.4.0", "pydantic==1.10.14"
and I did not face this issue.What I Did