FHIR Chat · Profile constraints being pulled into slice · IG creation

Stream: IG creation

Topic: Profile constraints being pulled into slice


view this post on Zulip Jean Duteau (Jun 19 2021 at 00:29):

If you want to see what I'm talking about below - https://github.com/HL7/fhir-spl/

I have an Organization profile where I slice Organization.contact.telecom based on the system. On each slice, I indicate that the contact.telecom must conform to a ContactPoint profile I've created:

      {
        "id": "Organization.contact.telecom",
        "path": "Organization.contact.telecom",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open",
          "description": "Require a telephone number and an email address."
        },
        "min": 2,
        "mustSupport": true
      },
      {
        "id": "Organization.contact.telecom:Phone",
        "path": "Organization.contact.telecom",
        "sliceName": "Phone",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "ContactPoint",
            "profile": [
              "http://hl7.org/fhir/us/spl/StructureDefinition/SPLContactPoint"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Organization.contact.telecom:Phone.system",
        "path": "Organization.contact.telecom.system",
        "patternCode": "phone"
      },
      {
        "id": "Organization.contact.telecom:Email",
        "path": "Organization.contact.telecom",
        "sliceName": "Email",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "ContactPoint",
            "profile": [
              "http://hl7.org/fhir/us/spl/StructureDefinition/SPLContactPoint"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Organization.contact.telecom:Email.system",
        "path": "Organization.contact.telecom.system",
        "patternCode": "email"
      },
      {
        "id": "Organization.contact.address",
        "path": "Organization.contact.address",
        "min": 1,
        "type": [
          {
            "code": "Address",
            "profile": [
              "http://hl7.org/fhir/us/spl/StructureDefinition/SPLAddress"
            ]
          }
        ],
        "mustSupport": true
      }

After generation by the IG Publisher, all of the constraints expressed on my ContactPoint profile are being "moved up" into the Organization profile. The profile specifies that contact.telecom must conform to SPLContactPoint, but it also duplicates all of the constraints as well.

      {
        "id": "Organization.contact.telecom:Phone",
        "path": "Organization.contact.telecom",
        "sliceName": "Phone",
        "short": "Details of a Technology mediated contact point (phone, fax, email, etc.)",
        "definition": "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.",
        "requirements": "People have (primary) ways to contact them in some way such as phone, email.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Organization.contact.telecom",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "ContactPoint",
            "profile": [
              "http://hl7.org/fhir/us/spl/StructureDefinition/SPLContactPoint"
            ]
          }
        ],
...
          {
            "key": "spl-2.1.7.x",
            "severity": "error",
            "human": "Telephone and fax numbers are formatted properly",
            "expression": "(system = 'phone' or system = 'fax') implies value.matches('^\\\\+[0-9]{1,3}-[0-9]{1,3}-[0-9]{3,4}-[0-9]{4}(;ext=[0-9]+)?$')",
            "source": "http://hl7.org/fhir/us/spl/StructureDefinition/SPLContactPoint"
          },
          {
            "key": "spl-2.1.7.11",
            "severity": "error",
            "human": "Emails are formatted properly",
            "expression": "system = 'email' implies value.matches('^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(\\\\.[a-zA-Z0-9-]+)*$')",
            "source": "http://hl7.org/fhir/us/spl/StructureDefinition/SPLContactPoint"
          }

This effectively duplicates the profile constraints. I'm not sure that it should be doing that.

view this post on Zulip Jean Duteau (Jun 21 2021 at 19:52):

@Grahame Grieve should the snapshot be pulling the constraints from the datatype profile into the main profile? I'm wondering if it is doing that because my discriminator is on the ContactPoint.system?


Last updated: Apr 12 2022 at 19:14 UTC