-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support property-based hierarchies from CodeSystemSupport #3448
Comments
I think I managed to work out the linkage: the CodeSystem resource has a top-level property field where you're supposed to define the properties used by the codesystem: https://www.hl7.org/fhir/codesystem-definitions.html#CodeSystem.property One of the fields under CodeSystem.property is In all of the v3 CodeSystem resources I list above (or at least the ones I checked), the CodeSystem.property.uri for the "subsumedBy" property is set to
So there is this optional field thats of type uri which can optionally point at one of these under-defined URIs and that is supposed to use the definition from this related codesystem somehow which tells you to look back at the hiearchyMeaning of the CodeSystem for the actual meaning... that feels awful complicated / loose / non-computable and I'd be nervous about baking that into our algorithm at this point. Instead, I think we should just see about either: |
these are the non-example bindings to
and the Confidentiality one is already covered by the model (because its a required binding on a code element). obtained via the following:
|
currently we look up the CodeSystem to see if its case-sensitive or not. |
https://build.fhir.org/branches/R4B/extension-family-member-history-genetics-parent.json.html has a required binding to http://hl7.org/fhir/ValueSet/parent-relationship-codes The examples are actually correct but we need to either package an expanded version of that valueset or get to #3448 in order to properly validate these. Signed-off-by: Lee Surprenant <[email protected]>
https://build.fhir.org/branches/R4B/extension-family-member-history-genetics-parent.json.html has a required binding to http://hl7.org/fhir/ValueSet/parent-relationship-codes The examples are actually correct but we need to either package an expanded version of that valueset or get to #3448 in order to properly validate these. Signed-off-by: Lee Surprenant <[email protected]>
https://build.fhir.org/branches/R4B/extension-family-member-history-genetics-parent.json.html has a required binding to http://hl7.org/fhir/ValueSet/parent-relationship-codes The examples are actually correct but we need to either package an expanded version of that valueset or get to #3448 in order to properly validate these. Signed-off-by: Lee Surprenant <[email protected]>
https://build.fhir.org/branches/R4B/extension-family-member-history-genetics-parent.json.html has a required binding to http://hl7.org/fhir/ValueSet/parent-relationship-codes The examples are actually correct but we need to either package an expanded version of that valueset or get to #3448 in order to properly validate these. Signed-off-by: Lee Surprenant <[email protected]>
https://build.fhir.org/branches/R4B/extension-family-member-history-genetics-parent.json.html has a required binding to http://hl7.org/fhir/ValueSet/parent-relationship-codes The examples are actually correct but we need to either package an expanded version of that valueset or get to #3448 in order to properly validate these. Signed-off-by: Lee Surprenant <[email protected]>
https://build.fhir.org/branches/R4B/extension-family-member-history-genetics-parent.json.html has a required binding to http://hl7.org/fhir/ValueSet/parent-relationship-codes The examples are actually correct but we need to either package an expanded version of that valueset or get to #3448 in order to properly validate these. Signed-off-by: Lee Surprenant <[email protected]>
https://build.fhir.org/branches/R4B/extension-family-member-history-genetics-parent.json.html has a required binding to http://hl7.org/fhir/ValueSet/parent-relationship-codes The examples are actually correct but we need to either package an expanded version of that valueset or get to #3448 in order to properly validate these. Signed-off-by: Lee Surprenant <[email protected]>
proposal: look for a property named "subsumedBy" optional: instead confirm its URI is "http://hl7.org/fhir/concept-properties#parent" and the hierarchyMeaning is "IS-A"? what if we see other hierarchyMeanding instead? decision: only handle this in the RegistryTermServiceProvider for now |
1. added `hasPropertyHierarchy` and `convertToSimpleCodeSystem` utilities to CodeSystemSupport. the conversion utility uses JGraphT to simplify the creation of an acyclic directed graph and then traverses that structure to build an updated CodeSystem resource with nested concepts. this allows the rest of our CodeSystemSupport to stay the same. 2. call `convertToSimpleCodeSystem` from RegistryTermServiceProvider.getConcepts to convert property-based hierarchy into the more-common nested concept flavor so that we can use our existing CodeSystemSupport filter approach for CodeSystems in the registry 3. added hand-crafted CodeSystem resources that test parent-to-child and child-to-parent edges with the conversion logic 4. added tests to verify our updated expansions match the expansions from tx.fhir.org for select ValueSets that draw from polyhierarchical CodeSystems like v3-ActCode and v3-RoleCode Signed-off-by: Lee Surprenant <[email protected]>
#3730) * issue #3448 - convert property-based concept hiearchies in getConcepts 1. added `hasPropertyHierarchy` and `convertToSimpleCodeSystem` utilities to CodeSystemSupport. the conversion utility uses JGraphT to simplify the creation of an acyclic directed graph and then traverses that structure to build an updated CodeSystem resource with nested concepts. this allows the rest of our CodeSystemSupport to stay the same. 2. call `convertToSimpleCodeSystem` from RegistryTermServiceProvider.getConcepts to convert property-based hierarchy into the more-common nested concept flavor so that we can use our existing CodeSystemSupport filter approach for CodeSystems in the registry 3. added hand-crafted CodeSystem resources that test parent-to-child and child-to-parent edges with the conversion logic 4. added tests to verify our updated expansions match the expansions from tx.fhir.org for select ValueSets that draw from polyhierarchical CodeSystems like v3-ActCode and v3-RoleCode Signed-off-by: Lee Surprenant <[email protected]> * Add fhir-hl7-terminology to fhir-parent pom So that it gets built with the rest of the project. I also moved the JGraphT version to the fhir-parent pom's dependencyManagement section. Signed-off-by: Lee Surprenant <[email protected]> * address PR feedback removed commented out code, added implNote, formatted test resources, and fixed comment typos Signed-off-by: Lee Surprenant <[email protected]> * Apply suggestions from code review Signed-off-by: Lee Surprenant <[email protected]>
QA:
|
produces the following response:
We see that
which matches the above expansion. |
Is your feature request related to a problem? Please describe.
In the hl7 codesystem artifacts that ship with FHIR R4, hiearchy is expressed by nesting the concepts and the "hiearchyMeaning" field is set to indicate the semantics of that nesting.
For at least some of the CodeSystems moved to https://terminology.hl7.org/ these have been updated to express hierarchy through properties. For the v3 CodeSystems, that seems to be indicated by a custom "subsumedBy" property and these are the affected CodeSystems as of 3.1:
I assume this was done so that they can properly reflect a "polyhierarchy" (where a single concept belongs "under" two different parent concepts).
Unfortunately, the current support in CodeSystemSupport for IS-A filters will only work for nested hierarchies at the moment:
How are we supposed to know that the
subsumedBy
property is the one we're supposed to follow in this case!?Describe the solution you'd like
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Acceptance Criteria
AND [another precondition]
WHEN [test step]
AND [test step]
THEN [verification step]
AND [verification step]
Additional context
See the below for some general guidance on the nested hierarchy vs property-based hierarchy:
https://chat.fhir.org/#narrow/stream/179166-implementers/topic/hierarchical.20CodeSystems.20and.20ValueSets/near/234918418
I know we have support for these property-based hierarchies in the fhir-term-graph stuff, but I was hoping for something a little simpler that can be simply implemented on top of the RegistryTermServiceProvider.
The text was updated successfully, but these errors were encountered: