FHIR Chat · constraining system · IG creation

Stream: IG creation

Topic: constraining system


view this post on Zulip Bob Milius (Apr 09 2020 at 11:46):

I need to constrain Patient.managingOrganization (0..1) to one of two system urls. I did by adding an invariant constraint, something along the lines of this fhirpath expression

"('http://this.org/blah' in identifier.system) or ('http://that.org/blah' in identifier.system)"

This works, but seems clumsy. Is there a more elegant/proper way of doing this? I'm a novice re fhirpath.

view this post on Zulip Lloyd McKenzie (Apr 09 2020 at 14:57):

So you're just using Patient.managingOrganization.identifier? You could declare a valueset on Patient.managingOrganization.identifier.system.

view this post on Zulip Bob Milius (Apr 09 2020 at 15:43):

I thought of that, but talked myself out of it, as I thought I could only bind codes/values to a valueset.

view this post on Zulip Lloyd McKenzie (Apr 09 2020 at 15:44):

You can have value sets for strings

view this post on Zulip Bob Milius (Apr 09 2020 at 17:11):

@Lloyd McKenzie ok, I'm a bit clueless and I'm not finding documentation on that. Can you point me? or provide an example?

view this post on Zulip Lloyd McKenzie (Apr 09 2020 at 17:38):

Hmm. I'd expected to see it either under profiling or in ValueSet, but I'm not seeing it either place. @Grahame Grieve, do you know where the rules for defining constraints on strings - particularly where the constraints aren't driven by existing code systems?

view this post on Zulip Grahame Grieve (Apr 09 2020 at 20:26):

http://hl7.org/fhir/terminologies.html#strings

view this post on Zulip Bob Milius (Apr 09 2020 at 22:58):

Thanks. The doc is brief, but don't see how it helps (though I may just be misunderstanding)

In a few special cases, humans customarily use codes directly for elements that have type "string". A typical case is codes for states, and there are several places where a URI must come from a set of controlled values. An element of type string or uri can also be bound to a value set. When a string or URI is bound to a value set, the value property SHALL contain the code specified by the value set, and the system and display values are ignored.

This says "system and display values are ignored". But I still need to add values to identifiers. I probably wasn't clear. I have two possible systems, that each have its own set of org identifiers. The two registries collaborate and often share data. Each has its own identifiers for orgs that submit data to them. So one managingOrganization might be:

"managingOrganization": {
    "identifier":
        {
             "system" : "http://this.org/these-centers"
             "value" : "1234"
        }
  }

and the other might be

"managingOrganization": {
    "identifier":
        {
             "system" : "http://that.org/those-centers"
             "value" : "abcd"
        }
  }

So we want to accept values from only two different systems. I can do this with the fhirpath expression I showed in the original post. I'm just wondering if there's a more elegant solution.


Last updated: Apr 12 2022 at 19:14 UTC