Stream: implementers
Topic: Possible to add object to an extension?
Santosh Jami (Sep 24 2017 at 14:00):
I need to add an extension to Patient object, extension has 6 string type properties in it.
Can I make a class and add an extension as Class containing those 6 properties?
Or else should I create 6 extensions individually and add to the Parent extension?
Here are the items I need to capture in the extension:
LabTestId
LabTestName
LabTestInterpretationStatus
LabTestObservationLink
LabTestStatusDate
LabTestFollowupRequired
And I need to store 3 extensions of the above type in the Patient record.
Thoughts please?
Lloyd McKenzie (Sep 24 2017 at 14:18):
So the first question is: why would you capture these in the Patient resource? The Patient resource is for capturing demogrphic information. The elements you're looking for would typically be conveyed using Observation.
Lloyd McKenzie (Sep 24 2017 at 14:18):
Is there a reason Observation can't work for you here?
Santosh Jami (Sep 24 2017 at 15:10):
Probably - I listed more elements than I need in the example @Lloyd McKenzie .
I need to capture, data with respect to a patient if he is supposed to be part of follow up visit for HIV testing based on internal logic. Need to capture if follow up needed, what date to follow up and couple of additional fields.
Santosh Jami (Sep 24 2017 at 15:11):
And should this Patient next visit be part of our Clinical Trial item And
definitely, it is an extension to the Patient as this is specific to the Patient that I need to tie it up.
Lloyd McKenzie (Sep 24 2017 at 16:07):
Lots of resources are related to Patient. We don't try to put all data related to a patient on Patient. Have you looked at Observation? If you're dealing with clinical trials, have you looked at ResearchSubject?
Santosh Jami (Sep 24 2017 at 17:20):
If I need to add multiple properties as extension values to the Observation, I would still be facing the same challenge as my original question - how to add set of properties as extension. I guess, I need to add a parent extension and create 6 child extensions and attach it to the parent extension. No short cut there, because how else would you share the object / class profile?
Yunwei Wang (Sep 24 2017 at 18:17):
@Santosh Jami: Most of your six properties can be recorded using regular Observation resource. FollowupRequired can be either a Task or Appointment or Schedule or some other resources based on your model.
Lloyd McKenzie (Sep 24 2017 at 20:10):
In general, we avoid using extensions when the concept can be represented using standard resources. And we avoid compound extensions when you can accomplish what's needed with separate single extensions.
Santosh Jami (Sep 24 2017 at 20:26):
Thanks @Lloyd McKenzie and @Yunwei Wang
Ewout Kramer (Sep 26 2017 at 10:06):
If I need to add multiple properties as extension values to the Observation, I would still be facing the same challenge as my original question - how to add set of properties as extension. I guess, I need to add a parent extension and create 6 child extensions and attach it to the parent extension. No short cut there, because how else would you share the object / class profile?
I think you are looking for this: http://hl7.org/fhir/extensibility.html (scroll down to the http://hl7.org/fhir/StructureDefinition/patient-clinicalTrial
example).
So, yes, this could be done, and has its uses. But as Lloyd and Yunwei pointed out, this might not be the best way to apply this here.
Last updated: Apr 12 2022 at 19:14 UTC