Closed BSVogler closed 3 years ago
When you have an FHIR resource object and try to access a field, which does no exists you get a KeyError. Python standard is AttributeError.
This causes hasattr(fhirresource, "field") to return an error instead of False, because internally it catches an attribute error and not a key error.
hasattr(fhirresource, "field")
False
Just to clarify. You prefer to access resource's fields as attributes like this patient.gender, do you?
patient.gender
It is supported by the library so I might use it.
Close since PR with the fix was merged.
When you have an FHIR resource object and try to access a field, which does no exists you get a KeyError. Python standard is AttributeError.
This causes
hasattr(fhirresource, "field")
to return an error instead ofFalse
, because internally it catches an attribute error and not a key error.