Skip to content

Implement subsetOf#24

Merged
AlexJSully merged 1 commit into
mainfrom
copybara
Sep 9, 2025
Merged

Implement subsetOf#24
AlexJSully merged 1 commit into
mainfrom
copybara

Conversation

@AlexJSully

Copy link
Copy Markdown
Member

Implement the susbetOf method based on the N1 spec: https://hl7.org/fhirpath/N1/index.html#subsetofother-collection-boolean

5.1.8. subsetOf(other : collection) : Boolean
Returns true if all items in the input collection are members of the collection passed as the other argument. Membership is determined using the [= (Equals)](https://hl7.org/fhirpath/N1/index.html#equals) (=) operation.

Conceptually, this function is evaluated by testing each element in the input collection for membership in the other collection, with a default of true. This means that if the input collection is empty ({ }), the result is true, otherwise if the other collection is empty ({ }), the result is false.

The following example returns true if the tags defined in any contained resource are a subset of the tags defined in the MedicationRequest resource:

MedicationRequest.contained.meta.tag.subsetOf(MedicationRequest.meta.tag)

GitOrigin-RevId: 520ee835d324807ada9458b1e75563cddacb5818

GitOrigin-RevId: 520ee835d324807ada9458b1e75563cddacb5818
@AlexJSully AlexJSully merged commit 2774b93 into main Sep 9, 2025
2 checks passed
@AlexJSully AlexJSully deleted the copybara branch September 9, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants