Stream: shorthand
Topic: ConceptMap shorthand
Lee Surprenant (Jun 25 2020 at 20:09):
Has anyone done work on a shorthand syntax for ConceptMap?
Lee Surprenant (Jun 25 2020 at 20:12):
I found you can create an Instance for one like this:
Instance: SnomedToUcum
InstanceOf: ConceptMap
* url = "http://example.com/fhir/ConceptMap/snomed-ucum"
* version = "0.0.1"
* status = #draft
* sourceCanonical = "http://snomed.info/sct?fhir_vs"
* targetCanonical = "http://hl7.org/fhir/ValueSet/ucum-common"
* group[0].source = "http://snomed.info/sct"
* group[0].target = "http://unitsofmeasure.org"
* group[0].element[0].code = #258672001
* group[0].element[0].target.code = #cm
* group[0].element[0].target.equivalence = #equivalent
* group[0].element[1].code = #258672002"
* group[0].element[1].target.code = #mL
* group[0].element[1].target.equivalence = #equivalent
Lee Surprenant (Jun 25 2020 at 20:12):
but I was wondering if we could do better with a new top-level reserved ConceptMap concept
Lee Surprenant (Jun 25 2020 at 20:19):
my colleague found a commented-out syntax for conceptmaps in FHIR Mapping Language, so maybe some combination of these two approaches could work?
/*
* Syntax for embedded ConceptMaps excluded for now
*
conceptMap
: 'conceptMap' '"#' IDENTIFIER '{' (prefix)+ conceptMapping '}'
;
prefix
: 'prefix' conceptMappingVar '=' URL
;
conceptMappingVar
: IDENTIFIER
;
conceptMapping
: conceptMappingVar ':' field
(('<=' | '=' | '==' | '!=' '>=' '>-' | '<-' | '~') conceptMappingVar ':' field) | '--'
;
*/
Lee Surprenant (Jun 25 2020 at 20:36):
without knowing much of anything about the FSH/SUSHI design, here's the result of the thought exercise on trying to combine these:
Alias: s = http://snomed.info/sct
Alias: u = http://unitsofmeasure.org
ConceptMap: SnomedToUcum
Url: http://ibm.com/fhir/ConceptMap/snomed-ucum
Version: 0.1.0
Status: #draft
SourceCanonical: http://snomed.info/sct?fhir_vs
TargetCanonical: http://hl7.org/fhir/ValueSet/ucum-common
* s#258672001 == u#cm
* s#258672002 == u#mL
thoughts?
Chris Moesel (Jun 25 2020 at 21:20):
I don't really have any experience w/ ConceptMap
, but you're not the first person to ask for something like this. Once FSH 1.0.0 is finalized, we'll be considering other candidates for dedicated syntaxes -- and ConceptMap
will certainly be considered!
Your proposed syntax looks a whole lot like the FSH syntax for Mapping (which is used for defining mappings in StructureDefinitions). Check it out: https://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#defining-mappings
If we adopted some of the existing syntax of Mapping
(and other existing FSH), then you're example above might look something more like:
Alias: SCT = http://snomed.info/sct
Alias: UCUM = http://unitsofmeasure.org
ConceptMap: SnomedToUcum
Id: snomed-ucum
Source: http://snomed.info/sct?fhir_vs
Target: http://hl7.org/fhir/ValueSet/ucum-common
* ^version = 0.1.0
* ^status = #draft
* SCT#258672001 -> UCUM#cm
* SCT#258672002 -> UCUM#mL
Although usually we would just default to the IG version and status, so you probably wouldn't need to specify the ^version
and ^status
rules. And I wonder if it might be possible to infer the code systems so that each mapping is really more like this:
* #258672001 -> #cm
* #258672002 -> #mL
Anyway, those are my thoughts without looking at the ConceptMap resource at all, but we'll certainly take a closer look when we start working on FSH STU2.
Jose Costa Teixeira (Jun 25 2020 at 21:31):
you could add the relationship type in the syntax:
* SCT#258672001 -[rel]-> UCUM#cm
* SCT#258672002 -[eq]-> UCUM#mL
Keith Boone (Jun 26 2020 at 00:37):
Plant much?
Jose Costa Teixeira (Jun 26 2020 at 02:54):
Keith Boone said:
Plant much?
what else? (besides, they started it ) :grinning_face_with_smiling_eyes:
Chris Moesel (Jun 26 2020 at 03:51):
Yeah, I probably should have looked closer at the syntax to see that ->
was probably too simple of a solution. Oh well. I'm not really supposed to be looking at this right now anway. Stop drawing me in. ;-)
Michael Lawley (Jun 29 2020 at 15:09):
ConceptMap is undergoing changes in R5 -- need to ensure vocab is looped in on any plans for a syntax; clarity of direction is important!
Keith Boone (Jun 29 2020 at 15:31):
Changes in R5 ContextMap seem to be more about syntax in FHIR rather than semantics of what a ConceptMap conveys, with the syntax allowing specification of more detail and clarity about mapping. So far I haven't seen many changes to it that would conceptually be a big different in the meaning of the content. I agree that Vocab should be involved, but it doesn't seem to be a tremendously complicated effort to capture the essentials needed for most of the cases I've ever developed a concept map for in an IG.
Michael Lawley (Jul 22 2020 at 02:17):
There are things you can say in a pre-R5 map that you can't say in an R5 map, and some things have moved from being a specific code in one field to a new (boolean-typed) field. If a custom syntax doesn't address these issues then there'll be significant cost in maintaining multi-version ConceptMaps and possibly also significant cognitive dissonance for users as the conceptual model aligned with the syntax diverges from the model of the Resource.
Jose Costa Teixeira (Jul 22 2020 at 05:16):
Jose Costa Teixeira (Jul 22 2020 at 05:17):
would be a good starting point, no?
Last updated: Apr 12 2022 at 19:14 UTC