FHIR Chat · ISO 3166-3 value set on tx.fhir.org? · terminology

Stream: terminology

Topic: ISO 3166-3 value set on tx.fhir.org?


view this post on Zulip Jean Duteau (Jul 30 2021 at 19:57):

The Military History guide is using the ISO3166-3 value set (http://hl7.org/fhir/ValueSet/iso3166-1-3) and is either getting warnings that the value set is unknown to tx.fhir.org or errors that a code (that is known to be in the value set) isn't from the value set. Before I spend too much time helping debug what is going on, I thought I'd quickly ask if this value set is actually on tx.fhir.org? @Rob Hausam

view this post on Zulip Jean Duteau (Jul 30 2021 at 20:01):

just a note that I did check and the codesystem (urn:iso:std:iso:3166) shows as being on tx.fhir.org/r4

view this post on Zulip Rob Hausam (Jul 30 2021 at 20:40):

@Jean Duteau I don't think it should really matter (ideally) if the value set is already on the server or not. I just tested it by POSTing a ValueSet/$expand query to tx.fhir.org (i.e. POST http://tx.fhir.org/r4/ValueSet/$expand) with that ValueSet resource instance as the body and I get this expansion result - which appears to be correct (with codes from "Aruba" to "Zimbabwe"). I assume that includes the code that you are looking for? If not, then maybe it's a version issue? And if it does, then there's something else to look for.

view this post on Zulip Jean Duteau (Jul 30 2021 at 20:45):

hmm, this is the warning that I'm getting:

[Unable to determine whether the provided codes are in the value set http://hl7.org/fhir/ValueSet/iso3166-1-3 because the value set or code system is not known to the validator]

And this is the error that Ioana was getting:

None of the codings provided are in the value set http://hl7.org/fhir/ValueSet/iso3166-1-3 (http://hl7.org/fhir/ValueSet/iso3166-1-3), and a coding from this value set is required) (codes = urn:iso:std:iso:3166#AFG)

I'll look into it some more to see what could be going on.

view this post on Zulip Rob Hausam (Jul 30 2021 at 20:54):

Does the expansion contain your code(s)?

view this post on Zulip Rob Hausam (Jul 30 2021 at 20:56):

Obviously that doesn't immediately matter if the validator for some reason doesn't even think that it can find the value set, but at least it will be good to know if the expansion does contain what you need.

view this post on Zulip Jean Duteau (Jul 30 2021 at 21:08):

It does. Both IRQ and AFG are there

view this post on Zulip Jose Costa Teixeira (Aug 05 2021 at 06:23):

the server is deliberately throwing that exception

view this post on Zulip Jose Costa Teixeira (Aug 05 2021 at 06:25):

I guess we need to look at the code (as in server code, not country code)

view this post on Zulip Jose Costa Teixeira (Aug 05 2021 at 10:26):

@Rob Hausam what I could find is that the server tries to list the enumerated codes in the valueset - for 2-character codes, the VS is defined extensionally
https://tx.fhir.org/r4/ValueSet/iso3166-1-2

view this post on Zulip Jose Costa Teixeira (Aug 05 2021 at 10:27):

but for 3-character codes, the VS definition is intensional https://tx.fhir.org/r4/ValueSet/iso3166-1-3

view this post on Zulip Jose Costa Teixeira (Aug 05 2021 at 10:27):

and the server trips around that enumeration

view this post on Zulip Jose Costa Teixeira (Aug 05 2021 at 10:27):

besides changing the server code (I can't do it at this level), is there something we could do?

view this post on Zulip Carl Leitner (Aug 05 2021 at 14:05):

flagging for @Luke Duncan

view this post on Zulip Ioana Singureanu (Aug 12 2021 at 17:49):

Update: the warning is now an error: ERROR: Observation/DeploymentEpisode: Observation.component[0].value.ofType(CodeableConcept): None of the codings provided are in the value set http://hl7.org/fhir/ValueSet/iso3166-1-3 (http://hl7.org/fhir/ValueSet/iso3166-1-3), and a coding from this value set is required) (codes = urn:iso:std:iso:3166#IRQ)
== C:\Users\Ioana\Documents\GitHub\fhir-military-service\fsh-generated\resources\Observation-DeploymentEpisode1.json ==
ERROR: Observation/DeploymentEpisode1: Observation.component[0].value.ofType(CodeableConcept): None of the codings provided are in the value set http://hl7.org/fhir/ValueSet/iso3166-1-3 (http://hl7.org/fhir/ValueSet/iso3166-1-3), and a coding from this value set is required) (codes = urn:iso:std:iso:3166#AFG)

view this post on Zulip John Moehrke (Aug 13 2021 at 13:15):

I have been toying with this. I have a build that is clean, but I had to reproduce the iso3166-1-3 valueset. (I am still working on getting it fully created properly, but it worked to create a valueset with the two codes your examples used)

view this post on Zulip John Moehrke (Aug 13 2021 at 14:36):

Strange... I can create a valueset that includes the two codes your examples use.. and that works. But if I create a valueset with the same regex as is found in iso3166-1-3; it fails exactly the same.

view this post on Zulip John Moehrke (Aug 13 2021 at 14:36):

@Rob Hausam ?

view this post on Zulip John Moehrke (Aug 13 2021 at 14:37):

the valueset in the IG looks just like iso3166-1-3... so it is not clear this is a problem with the valueset. This might be a problem with the validator?

view this post on Zulip John Moehrke (Aug 13 2021 at 14:42):

or is it a problem with the terminology support of the validator when the valueset is based on a regex?

view this post on Zulip John Moehrke (Aug 13 2021 at 14:46):

@Ioana Singureanu is it possible to just use unrestricted 3166 for now? Identify it as something that needs to be resolved in the future

view this post on Zulip John Moehrke (Aug 13 2021 at 15:44):

I tried to create the valueset without using regex. It does not seem that valuesets using exclude are working either. I tried to create a valueset made up of iso3166 excluding the 2 character codes in the iso3166-1-2 valueset. The valueset I created seems to be right, but the expansion is not. The resulting expansion still includes everything in 3166

ValueSet:    MilitaryCountryVS
Id: military-service-country-vs
Title: "Military Branch country Value Set"
* include codes from system urn:iso:std:iso:3166
* exclude codes from valueset http://hl7.org/fhir/ValueSet/iso3166-1-2

view this post on Zulip Rob Hausam (Aug 13 2021 at 19:21):

@John Moehrke I'm also finding an issue with exclude not working on a different value set. I had thought that I saw that the regex actually did work - but I assume from what you are saying you are finding that it is not working? I can take another look at it.
@Ioana Singureanu

view this post on Zulip John Moehrke (Aug 13 2021 at 19:23):

The exclude did not create a valueset in the ig with proper expansion.

view this post on Zulip Rob Hausam (Aug 13 2021 at 19:26):

Yes, that's similar to what I was referring to on the other value set - an incorrect code validation (probably from an incorrect expansion). It seemed that the 'exclude' was actually being included. :frown:

view this post on Zulip Grahame Grieve (Aug 17 2021 at 04:36):

so is this resolved?

view this post on Zulip Jose Costa Teixeira (Aug 17 2021 at 07:19):

I think not
https://tx.fhir.org/r4/ValueSet/iso3166-1-3/$validate-code?system=urn:iso:std:iso:3166&code=USA

view this post on Zulip Jose Costa Teixeira (Aug 18 2021 at 19:41):

@Grahame Grieve presuming there's something that can be done on the server, anything I can do?

view this post on Zulip Grahame Grieve (Aug 19 2021 at 22:26):

well, I had a quick look and it turned out to be some pretty simple stuff I hadn't done, so fixed next release

view this post on Zulip Grahame Grieve (Aug 19 2021 at 22:26):

thanks anyway

view this post on Zulip John Moehrke (Aug 20 2021 at 12:27):

@Ioana Singureanu fyi, the fix is coming


Last updated: Apr 12 2022 at 19:14 UTC