Stream: CCDA / FHIR mapping stream
Topic: FHIR EXTENSIONS
Roney A (Jul 10 2019 at 16:02):
Hi Lloyd–not clear on how to create an extension?
Q1. Do we need to PUBLISH it? Where we need to publish it?
Q2. Do we create a profile?
Q3. Do we state in the capability statement?
https://fhirblog.com/2017/04/12/so-you-want-to-create-a-fhir-extension/
Could you please give an example, for creating an Extension for any ONE of the following ATTRIBUTION column? Assuming we can associate it with one of the FHIR resources, for example patient.
1. Column name: snp_member; Description: Specialneedplans (for a member)
<patient.
<extension>
<url value="http://hl7.org/fhir/StructureDefinition/special-needplans-Member"/>
<valueString value="plan0001"/>
</extension>
</patient>
2. Column name: li_subsidy; Description: Low income subsidy (provided to medicare enrolled low income)
3. Column name: ym_attribution; Description: Year and month of attribution
4. Column name: att_method; Description: Attribution method
5. Column name: qtr_active; Description: Quarter in which patient is active
Lloyd McKenzie (Jul 10 2019 at 20:34):
1. Yes. Ina registry of your choice. Simplified or registry.fhir.org are options
2. Yes. Extension definitions are profiles on the Extension data type
3. No need
Not at my computer. Take a look at the numerous extension definitions in the core spec to use as examples.
Roney A (Jul 11 2019 at 02:00):
1. Yes. Ina registry of your choice. Simplified or registry.fhir.org are options
2. Yes. Extension definitions are profiles on the Extension data type
3. No need
Not at my computer. Take a look at the numerous extension definitions in the core spec to use as examples.
Thank you Lloyd.
Roney A (Jul 17 2019 at 22:05):
Hi Lloyd, could you please confirm if this is the correct approach to create an extension for social history element “OnsetYear”. Is the resource type correct? Or the resource type should be “patient”?
Please let me know.
{
"resourceType": "StructureDefinition",
"extension": [
{
"url": "http:/test.com/fhir/StructureDefinition/cfAuthor",
"valueBoolean": true
},
{
"url": "http://clinfhir.com/StructureDefinition/userEmail",
"valueString": “Roney@mymail.com”
}
],
"id": "socialhistoryOnsetYear",
"url": "http://fhirtest.uhn.ca/baseDstu3/StructureDefinition/socialhistoryOnsetYear",
"name": "socialhistoryOnsetYear",
"status": "draft",
"abstract": false,
"publisher": “Roney”,
"contextType": "resource",
"description": " This column will capture the year which was specified by the patient.",
"context": [
"StructureDefinition.name"
],
"kind": "complex-type",
"type": "Extension",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
"derivation": "constraint",
"snapshot": {
"element": [
{
"path": "Extension",
"label": "date0",
"min": 0,
"max": "1",
"definition": "No Description",
"base": {
"path": "Extension",
"min": 0,
"max": "1"
},
"id": "Extension0"
},
{
"path": "Extension.url",
"label": "date0",
"representation": [
"xmlAttr"
],
"definition": "No Description",
"min": 1,
"max": "1",
"type": [
{
"code": "uri"
}
],
"fixedUri": "date0",
"base": {
"path": "Extension.url",
"min": 1,
"max": "1"
},
"id": "Extension.url0"
},
{
"path": "Extension.valueDate",
"label": "date0",
"definition": "No Description",
"min": 0,
"max": "1",
"type": [
{
"code": "date"
}
],
"base": {
"path": "Extension.valueDate",
"min": 0,
"max": "1"
},
"id": "Extension.value[x]0"
}
]
}
}
Lloyd McKenzie (Jul 17 2019 at 22:40):
The fixedUri can't be date0 - it needs to be the canonical URL for the extension. You need to assert that Extension.value[x] is mandatory and can only be a date (and that Extension.extension is prohibited). Finally, why are you communicating your email as an extension instead of in StructureDefinition.contact - which is intended for that purpose?
Roney A (Jul 18 2019 at 00:21):
The fixedUri can't be date0 - it needs to be the canonical URL for the extension. You need to assert that Extension.value[x] is mandatory and can only be a date (and that Extension.extension is prohibited). Finally, why are you communicating your email as an extension instead of in StructureDefinition.contact - which is intended for that purpose?
Thank you Lloyd. Agree on the contact and others. ALL was generated by default using http://clinfhir.com/EDBuilder.html.
Please see responses below:
Not clear on #2: Hi Lloyd, could you please provide an example: Extension.value[x] is mandatory and can only be a date (and that Extension.extension is prohibited)
Question 1: Where do we see Extension.extension? Sorry, if I missed that.
Question 2: Could you please give an example of creating Extension.value[x] is mandatory and can only be a date
Question 3: Although the following URL refers to "Extension.extension"
https://fhir-ru.github.io/extension-rendered-value.json.html
{
"id" : "Extension.extension",
"path" : "Extension.extension",
"slicing" : {
"discriminator" : [{
"type" : "value",
"path" : "url"
}
Correction 1: <fixedUri value="http://example.org/fhir/StructureDefinition/socialhistoryOnsetYear"/>
Correction 3: StructureDefinition.contact
Definition Contact details to assist a user in finding and communicating with the publisher.
Control 0..*
Type ContactDetail
Summary true
Comments May be a web site, an email address, a telephone number, etc.
Lloyd McKenzie (Jul 18 2019 at 01:07):
@David Hay Some feedback :)
Lloyd McKenzie (Jul 18 2019 at 01:08):
1. I don't see Extension.extension - but I should
2. There should be two elements. The first should say Extension.value[x] and declare a type of 'date'. The second should reflect the constraints on Extension.valueDate
3. Not understanding the question
David Hay (Jul 18 2019 at 01:14):
oops - been a while since I looked at that app! I'll take a look :) (thanks for the feedback)...
Roney A (Jul 18 2019 at 02:51):
1. I don't see Extension.extension - but I should
2. There should be two elements. The first should say Extension.value[x] and declare a type of 'date'. The second should reflect the constraints on Extension.valueDate
3. Not understanding the question
Thank you Lloyd for the clarification. On #3, not clear what does it mean by "Extension.extension is prohibited"?
Roney A (Jul 18 2019 at 02:55):
oops - been a while since I looked at that app! I'll take a look :) (thanks for the feedback)...
Thank you Dave for your prompt clarification. As you mentioned, people tend to use "Forge" for these things. Could you please provide a link for Forge? Also is that a free open source tool? Would I be able to create extensions and profiles. I would appreciate if you can provide a valid link for "Forge". Regards, Roney
Lloyd McKenzie (Jul 18 2019 at 03:18):
Extension.extension should be listed - and should have max=0
Lloyd McKenzie (Jul 18 2019 at 03:19):
If you have a value, you can't have child extensions (and vice versa)
Roney A (Jul 18 2019 at 04:13):
Extension.extension should be listed - and should have max=0
Thank you Lloyd. Appreciate that.
Roney A (Jul 18 2019 at 04:15):
oops - been a while since I looked at that app! I'll take a look :) (thanks for the feedback)...
Thank you Dave for your prompt clarification. As you mentioned, people tend to use "Forge" for these things. Could you please provide a link for Forge? Also is that a free open source tool? Would I be able to create extensions and profiles. I would appreciate if you can provide a valid link for "Forge". Regards, Roney
Thank you David. Please ignore the request. Sincerely, Roney
Roney A (Jul 18 2019 at 16:45):
Extension.extension should be listed - and should have max=0
Hi Lloyd, looking at the Extension example at FHIR site: http://hl7.org/fhir/stu3/extensibility-examples.html, following are my questions on section 2.5.2.1.5 Using it in a Patient Profile.
1. Once an extension is created, for example: "socialhistoryOnsetYear"
2. Do we have to create a "new profile" for patient using StructureDefinition on the patient resource to use this new extension?
3. Is there a "MASTER" profile for all the FHIR resources? For example Medication, Patient.
Looking at the current FHIR R4 Profiles, for example, for Patient, I see there is a Patient HL7 Extensions (http://hl7.org/fhir/patient-extensions.html). For Medication there is NONE. Assuming, that the "Profile" in FHIR exists only if there is an Extension created. Is that the correct understanding?
Lloyd McKenzie (Jul 18 2019 at 17:18):
2. No need to have a profile unless you want to enforce something around the use of the extension
3. There's a structure definition that defines each resource, but that wouldn't list all of the possible extensions (as those are continuously being created and could be created by anyone; also there are no constraints the base resource would want/need to assert about the use of any particular extensions)
Roney A (Jul 18 2019 at 19:20):
2. No need to have a profile unless you want to enforce something around the use of the extension
3. There's a structure definition that defines each resource, but that wouldn't list all of the possible extensions (as those are continuously being created and could be created by anyone; also there are no constraints the base resource would want/need to assert about the use of any particular extensions)
Thank you Lloyd. It makes sense.
Last updated: Apr 12 2022 at 19:14 UTC