Stream: shorthand
Topic: How make field conform to an external profile
Max Körlinge (Mar 22 2021 at 11:17):
Hi!
I am trying to create a profile on Condition where the "code" should be an ICD-10 code from the german basis profile, more specifically the profile here: https://simplifier.net/Basisprofil-DE-R4/CodingICD10GM-duplicate-2/~overview
How do I specify this? I'm looking for something like
Profile: MyProfile
Parent: Condition
* code 1..1
* code.coding from http://fhir.de/StructureDefinition/CodingICD10GM // or only, or extends, or something that links to the profile
* code.coding.code = icd-10-valueset-uri#F17.2
* code.coding.version = "2020" // or something
I have tried a few keywords but they don't quite get me there, I am beginning to think I am doing the wrong thing. What I actually want to do is to end up assigning the code as ICD-10 "F17.2", which is part of a codesystem/valueset somewhere, but I thought that I need to first say that "this code is an instance of this profile". Could you point me in the right direction? =)
Max Körlinge (Mar 22 2021 at 11:24):
It sems to me like 'only' would fit here but the generator tells me "Internal error in location for message: 'Error @1, 1: Found ? expecting a token name', loc = '?pkp-1?', err = 'The reference http://fhir.de/StructureDefinition/CodingICD10GM could not be resolved'" then and I don't know how to proceed from there
Chris Moesel (Mar 22 2021 at 12:57):
Hi @Max Körlinge. Since http://fhir.de/StructureDefinition/CodingICD10GM
is a profile on Coding
, then I think one approach would be:
* code.coding only http://fhir.de/StructureDefinition/CodingICD10GM
If SUSH says it cannot find that definition then I would double-check to make sure that it really is defined in one of your dependency IGs (paying attention to version as well). Because if it is in a dependency IG, then I think it should work.
That said, that will require every instance of Coding
to match the profile. If you only want to require that at least one Coding
matches the profile, you'd have to create an open slicing
and declare one slice that is restricted to that profile.
Chris Moesel (Mar 22 2021 at 13:01):
One other issue I see is in this line:
* code.coding.code = icd-10-valueset-uri#F17.2
The part before #
needs to refer to a CodeSystem
, not a ValueSet
. I noticed that in the profile on Coding
that you are wanting to use, it fixes system
to: http://fhir.de/CodeSystem/dimdi/icd-10-gm
, so that is presumably what you'd want before the #
when fixing that code.
Chris Moesel (Mar 22 2021 at 13:02):
And of course you can define an alias for that system (if you're going to use it multiple times) so you don't have to type the full thing every time.
Max Körlinge (Mar 22 2021 at 13:26):
Thanks. I think perhaps most of my issues are with the package which is an alpha version. I checked the contents of the package and the IG itself says its version is 1.0.0-alpha1, but the same problem persists if I tell sushi to use that version instead.
I can derive a profile from that uri like this
Profile: MyProfile
Parent: http://fhir.de/StructureDefinition/CodingICD10GM
and the generator and sushi don't complain, but the link on the IG website to that profile goes to ../output/null
.
I am using snapshots downloaded manually like we discussed in the "Dependencies" thread. When I check the package, it does include this uri (http://fhir.de/StructureDefinition/CodingICD10GM) in a separate file. The json file with the IG itself doesn't seem to contain this URI though. Should the IG (in this case, basisprofil-de-r4.json
) contain a reference to it somewhere? It just seems to refer to a bunch of markdown files. If it should, I guess that is the problem
Chris Moesel (Mar 22 2021 at 13:45):
No, I don't think the IG JSON needs to refer to it for SUSHI to find it. SUSHI should be able to find it as long as its formal JSON definition is available in the IG package. It's also not a problem that the URL doesn't resolve to a valid location in your browser. While that's generally considered a best practice in FHIR, it is not a requirement and SUSHI does not rely on it.
If that URL is working as the value of a Parent
then I don't know why it's not working as the value of an only
rule. I will have to try to reproduce locally in order to figure out what's going on.
Max Körlinge (Mar 22 2021 at 13:54):
Skärmavbild-2021-03-22-kl.-14.48.43.png
from this
* code.coding ^slicing.discriminator.type = #pattern
* code.coding ^slicing.discriminator.path = "coding"
* code.coding ^slicing.rules = #open
* code.coding contains icd10 1..1 MS
* code.coding[icd10] only http://fhir.de/StructureDefinition/CodingICD10GM
* code.coding[icd10].code = http://fhir.de/CodeSystem/dimdi/icd-10-gm#F17.2
It looks like the "Type" is not recognized but the "code" is since the description is correct. Maybe I'm just somehow using the wrong structure definition URI for the profile, since the code uri worked well
Last updated: Apr 12 2022 at 19:14 UTC