Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-3807 rectify fhirpath exists and empty #3808

Merged
merged 6 commits into from
Feb 7, 2024

Conversation

dillonstreator
Copy link
Contributor

Fixes #3807

@dillonstreator dillonstreator requested a review from a team as a code owner January 25, 2024 01:44
Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medplum-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2024 5:48pm
medplum-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2024 5:48pm
medplum-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2024 5:48pm

Copy link

vercel bot commented Jan 25, 2024

@dillonstreator is attempting to deploy a commit to the Medplum Team on Vercel.

A member of the Team first needs to authorize it.

@@ -34,7 +34,7 @@ export const functions: Record<string, FhirPathFunction> = {
* @returns True if the input collection is empty ({ }) and false otherwise.
*/
empty: (_context: AtomContext, input: TypedValue[]): TypedValue[] => {
return booleanToTypedValue(input.length === 0);
return booleanToTypedValue(input.length === 0 || input.every((e) => isEmpty(e.value)));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively the same as the following:

    return booleanToTypedValue(input.every((e) => isEmpty(e.value)));

However, the current change is a bit more obvious IMO. Defer to maintainers on preference.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that case be added to isEmpty() directly? 🤔

@dillonstreator dillonstreator changed the title fix-3807 rectify fhirpath exists and empty fix-3807 rectify fhirpath exists and empty Jan 25, 2024
@rahul1
Copy link
Member

rahul1 commented Feb 5, 2024

HI @dillonstreator, if you'd like to fix the prettier errors and fix conflicts, we can take another look

@codyebberson codyebberson added this pull request to the merge queue Feb 7, 2024
Merged via the queue into medplum:main with commit 7c9ce41 Feb 7, 2024
18 checks passed
medplumbot added a commit that referenced this pull request Feb 8, 2024
fix-3885 propagate `traceId` through asynchronous jobs (#3886)
Expand profile operation (#3875)
feat: Support OperationDefinition inputs for patient-everything (#3908)
Remove TURBO_REMOTE_ONLY from build step (#3907)
Server config setting for accurate count threshold (#3902)
Remove global systemRepo (#3884)
Maintain full `traceparent` header value for `traceId` (#3877)
fix-3807 rectify fhirpath `exists` and `empty` (#3808)
Fix return documentation for client read methods (#3891)
Document how to switch to super admin project in projects (#3873)
Refactor elements context and slicing logic (#3869)
Dependency upgrades (#3874)
No longer need to build core for @medplum/react npm run dev (#3871)
Fixes to ResourceDiffTable with arrays (#3870)
feat(agent): add `ping` via `Agent/$push` (#3846)
Fix token search with pipe in value (#3867)
Revert nested transactions (#3866)
Evict connection on rollback (#3865)
@medplumbot medplumbot mentioned this pull request Feb 8, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 8, 2024
fix-3885 propagate `traceId` through asynchronous jobs (#3886)
Expand profile operation (#3875)
feat: Support OperationDefinition inputs for patient-everything (#3908)
Remove TURBO_REMOTE_ONLY from build step (#3907)
Server config setting for accurate count threshold (#3902)
Remove global systemRepo (#3884)
Maintain full `traceparent` header value for `traceId` (#3877)
fix-3807 rectify fhirpath `exists` and `empty` (#3808)
Fix return documentation for client read methods (#3891)
Document how to switch to super admin project in projects (#3873)
Refactor elements context and slicing logic (#3869)
Dependency upgrades (#3874)
No longer need to build core for @medplum/react npm run dev (#3871)
Fixes to ResourceDiffTable with arrays (#3870)
feat(agent): add `ping` via `Agent/$push` (#3846)
Fix token search with pipe in value (#3867)
Revert nested transactions (#3866)
Evict connection on rollback (#3865)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Unexpected fhirpath result for empty %previous value with exists() and empty()
3 participants