FHIR Chat · Constraints · shorthand

Stream: shorthand

Topic: Constraints


view this post on Zulip Saul Kravitz (Feb 27 2020 at 19:32):

Can constraints be coded in FSH?

Something that produces a constraint like:

constraint: [
{
"key" : "pd-1",
"severity" : "error",
"human" : "SHALL have contact information or a reference to an Endpoint",
"expression" : "telecom or endpoint",
"xpath" : "exists(f:telecom) or exists(f:endpoint)"
}
]

Drawn from http://hl7.org/fhir/us/core/STU3/StructureDefinition-us-core-practitionerrole.html

view this post on Zulip Chris Moesel (Feb 27 2020 at 19:56):

That feature has been coded up and is currently in review, so... should be available in the next version of SUSHI!

view this post on Zulip Chris Moesel (Feb 27 2020 at 20:00):

Basic approach is:

Profile: USCorePractitionerRole
Parent: PractitionerRole
* obeys pd-1
// ...

Invariant:  pd-1
Severity:   "error"
Description: "SHALL have contact information or a reference to an Endpoint"
Expression: "telecom or endpoint"
XPath:      "exists(f:telecom) or exists(f:endpoint)"

view this post on Zulip Jens Villadsen (Feb 27 2020 at 22:03):

will the fhirpath expression be validated?

view this post on Zulip Jens Villadsen (Feb 27 2020 at 22:03):

as in: will the syntax of it be validated?

view this post on Zulip Chris Moesel (Feb 27 2020 at 22:09):

@Jens Villadsen -- we don't currently validate the fhirpath expression. We rely on the IG Publisher to catch it. That said, if the JavaScript fhirpath library supports fhirpath syntax checking, then it would be pretty simple to add that capability.


Last updated: Apr 12 2022 at 19:14 UTC