Migration guide¶
From 7.x to 8.x¶
Version 8 is built on Pydantic V2 (through fhir-core). The old method
names still work but are deprecated; switch to the new ones:
7.x |
8.x |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
Subclass with |
|
|
Breaking: the resource_type attribute is gone. Use
obj.get_resource_type(). The resourceType key is still written on
output.
>>> from fhir.resources.patient import Patient
>>> Patient().get_resource_type()
'Patient'
Field metadata such as enum_values and enum_reference_types moved to
Model.model_fields[name].json_schema_extra.
From 6.x to 7.x¶
The default models are now FHIR R5. R4 / R4B models moved to the R4B
sub-package, so update imports if you want to stay on R4:
- from fhir.resources.patient import Patient
+ from fhir.resources.R4B.patient import Patient
If you upgrade to R5, review:
If you come from R4, also the differences between R4B and R4.
From versions before 6.x¶
Old |
New |
|---|---|
|
|
|
|
|
|
All models now derive from FHIRAbstractModel rather than
FHIRAbstractBase.
Release and version policy¶
Since 5.0.0, fhir.resources follows its own semantic versioning and no
longer mirrors the FHIR version number. The FHIR version of the default models
is available as fhir.resources.__fhir_version__.