FHIR Chat · Why is CodeSystem.version search parameter of type token? · implementers

Stream: implementers

Topic: Why is CodeSystem.version search parameter of type token?


view this post on Zulip Jakob Lindblad (Apr 29 2019 at 09:17):

Hi,

Why is the search parameter CodeSystem.version of type token, and how should i use this?

CodeSystem.version attribute is of type string and has the description "Business version of the code system (Coding.version)". Im reading on the CodeSystem page that "a code system MAY provide a version identifier which can be specified in CodeSystem.version", but cant really grasp the concept of this identifier. Since version is of type string, shouldnt the only data on this field be for example "1.1"?

If anyone could explain the concept behind this it would be highly appriciated.

Thanks

view this post on Zulip Lloyd McKenzie (Apr 29 2019 at 13:06):

Different code systems have different approaches to labeling their versions. Some might use numbers, others letters, some will use a mixture. We use the 'token' type for search because we want exact match and case-sensitive behavior, which the string search type doesn't provide.

view this post on Zulip Jakob Lindblad (Apr 29 2019 at 14:12):

Different code systems have different approaches to labeling their versions. Some might use numbers, others letters, some will use a mixture. We use the 'token' type for search because we want exact match and case-sensitive behavior, which the string search type doesn't provide.

Ok thank you. So what would the correct query be if i just want to search for a version like 1.1? Is this correct? : {baseUrl}/CodeSystem?Version=1.1

view this post on Zulip Lloyd McKenzie (Apr 29 2019 at 14:58):

'version' should be lower-case, but otherwise yes. That search will only match on "1.1" rather than also matching "1.1.2" or "1.1b" which a string search type would have allowed

view this post on Zulip Jakob Lindblad (May 02 2019 at 12:29):

'version' should be lower-case, but otherwise yes. That search will only match on "1.1" rather than also matching "1.1.2" or "1.1b" which a string search type would have allowed

Ok, make sense. Thank you!

view this post on Zulip Christiaan Knaap (May 09 2019 at 12:51):

I think it would have been clearer to then also make version of type id instead of string. But with CodeSystem being normative that route is closed.
Actually the better option would be to make the searchparameter of type string. So you can also search for an implicit range of versions (starts with '3.5' will give you anything in the range 3.5.x). Although that may not be applicable for some of the versioning mechanisms in use, with a token parameter you eliminate the possibility of this use altogether, also for versioning mechanisms for which it would make sense (e.g. semver).

view this post on Zulip Lloyd McKenzie (May 09 2019 at 18:10):

id limits certain punctuation that code systems might choose to use. I believe we use 'token' as the search type


Last updated: Apr 12 2022 at 19:14 UTC