Closed PeteW closed 3 years ago
As far as know, there is no element/field name, called banana
, you can make extensions only for available fields/element
For example:
result = fhir.resources.patient.Patient(**{
'id': str(self.id),
'_gender' or ''_id'': {
'extension': [{
'url': 'https://tempuri.org',
'valueInteger': self.specialid,
}],
},
Thanks for the quick response. That variable banana
is sort of tongue-in-cheek, but the point was we often have requirements to exchange some resource such as Patient
but we also must include a series of internal/proprietary key/value pairs of metadata related to the resource (better examples: "created by", "internal-department-id", "origin-system-category" etc...)
My interpretation is that the FHIR standard intentionally doesnt leave a place for arbitrary/extensible key/pairs, and that extensions are the preferred means of accomplishing this. Hopefully I'm missing a place in the resource for holding these sort of fields?
Not sure if this is the "right" way to do this, but I ended up sub-classing the fhir resources and add new fields where needed.
You can have a look at https://www.hl7.org/fhir/auditevent.html
I am not fully sure if it is a good idea but you can put AuditEvents inside Patient.contained
Other options could be, create extensions and append Patient. extension
I like your latter suggestion, create extensions and append Patient.extension
.
I will close this one up.
Description
I'm trying to construct a basic resource with extension fields. In the example below I'm trying to add an extension to Patient resource.
What I Did