standardhealth / ballot

0 stars 0 forks source link

Logical Models don't support slicing -- how to represent "includes code" type? #21

Closed cmoesel closed 6 years ago

cmoesel commented 6 years ago

Logical models do not support slicing (see thread1 and thread2). We can get around this in most cases, but the one remaining case is "includes code" constraints, and it manifests itself in BreastCancerPresenceStatement.

BreastCancerPresenceStatement specifies:

Category includes #disease

Category is 0..*, so we normally would do this by slicing Category and saying one must be #disease. Since slicing is not allowed, however, we need an alternate approach when exporting to logical models.

One approach would be to just allow one category (the fixed one) and don't allow any others to be added:

category             1..1      Coding      #disease

Another approach, if we want to allow other codes as well, would be to have a high-level category section with n 1..1 fixed sub-elements and one 0..* rest element.

category             1..1
    - fixed          1..1      Coding      #disease
    - rest           0..*      Coding

Any preference? Keep in mind that whatever we choose should be how we want it to be in all cases (not just this one specific BreastCancerPresenceStatement.Categor use case).

cmoesel commented 6 years ago

@markkramerus -- I need you to weigh in on this.

markkramerus commented 6 years ago

Two options: 1) Include this in a "Known Limitations" documentation section and do nothing else (since the ballot materials must be finalized by Friday, preferably Thursday since I'll be driving to Rochester in the car most of the day on Friday) 2) My preference, if we decide to fix it once and for good would be to respect the upper cardinality, and allow multiple Categories -- as in the second option.

cmoesel commented 6 years ago

I don't know if 1 ("known limitation") is an option. It depends on how serious the FHIR team is about IG's having no errors. As it is now, this is a spec violation reported by the IG publisher.

cmoesel commented 6 years ago

That 2nd approach doesn't sit well with me. On further thought, I think we can use a constraint (a.k.a. invariant) to indicate that the first code must #disease. I'll see if I can figure out the right expression to say that.

The upside is that it doesn't affect the structure of the logical model. The downside is that the fixed code requirement isn't as easy to notice.

cmoesel commented 6 years ago

Fixed via an invariant: image