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

PatientSummary Problem List uses US Core profile #4535

Merged
merged 13 commits into from
May 13, 2024

Conversation

mattlong
Copy link
Member

@mattlong mattlong commented May 9, 2024

A notable underlying change to facilitate this:

In order to get discriminators with a path of $this working, SliceDefinition now extends InternalSchemaElement. Previously they already had an awful lot of overlap, so this feels like a low risk change to make. The redundancy of SliceDefinition.definition and InternalSchemaElement.description is unfortunate. We could get rid of SliceDefinition.definition and normalize on description, but that would of course be a breaking change which would probably be best to leave for the next major release. If/when this PR gets merged, I'll make an issue to track that.

@mattlong mattlong requested a review from a team as a code owner May 9, 2024 21:02
Copy link

vercel bot commented May 9, 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 May 13, 2024 5:28pm
medplum-provider ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 5:28pm
medplum-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 5:28pm
medplum-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 5:28pm

@@ -589,7 +594,17 @@ export function matchDiscriminant(
if (!value || !sliceElement) {
return false;
}
if (matchesSpecifiedValue(value, sliceElement)) {
if (sliceElement.pattern) {
Copy link
Member Author

@mattlong mattlong May 9, 2024

Choose a reason for hiding this comment

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

This is a subtle but potentially validation-breaking change for malformed slice definitions. Since matchesSpecifiedValue returns true by default, checks on elements containing neither .fixed nor .pattern now return false whereas they used to return true. The only time fixed and pattern shouldn't be defined is when we're dealing with slicing by ValueSet which is handled below and retains the permissiveness for now.

Copy link
Member

Choose a reason for hiding this comment

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

@mattwiller - can you comment on this? Seems ok to me, but this is kinda out of my comfort zone.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, Matt and I discussed this and I think this change should be fine. In general, the possibility of malformed profile StructureDefinition resources makes validation tricky unless we assume the underlying profile is valid. Eventually, we may want to add explicit validation checks on the profile before using it for validation of another resource: at least then we could abort and display the issue with the profile

@mattlong mattlong force-pushed the medplum-provider-update-valuesets branch from 45af05e to a20514f Compare May 9, 2024 23:44
@mattlong mattlong self-assigned this May 10, 2024
@mattlong mattlong added this to the May 31st, 2024 milestone May 10, 2024
Copy link
Member

@codyebberson codyebberson left a comment

Choose a reason for hiding this comment

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

lgtm. I think we should wait for @mattwiller to clarify the matchesSpecifiedValue() change

export interface SliceDefinition {
export interface SliceDefinition extends InternalSchemaElement {
// narrowed InternalSchemaElement fields
slicing?: never;
Copy link
Member

Choose a reason for hiding this comment

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

Would this be more accurate?

export interface SliceDefinition extends Omit<InternalSchemaElement, 'slicing'> {

@@ -580,7 +580,12 @@ export function matchDiscriminant(
return false;
}

const sliceElement: InternalSchemaElement = (elements ?? slice.elements)[discriminator.path];
let sliceElement: InternalSchemaElement | undefined;
if (discriminator.path === '$this') {
Copy link
Member

Choose a reason for hiding this comment

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

Clarifying question: My understanding is that discriminator.path can be a full FHIRPath expression, so we're currently adding support for the special case of === '$this', but still have open future work here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's correct; the Restricted Subset ("Simple"):

  • All statements SHALL start with the name of the context element (e.g. on a Patient resource, Patient.contact.name.), or SHALL be simply "$this" to refer to the element that has focus
  • Operators SHALL NOT be used
  • Only the following functions may be used:
    • .resolve()
    • .extension("url")
    • .ofType(type)
  • All other functions SHALL NOT be used

@@ -589,7 +594,17 @@ export function matchDiscriminant(
if (!value || !sliceElement) {
return false;
}
if (matchesSpecifiedValue(value, sliceElement)) {
if (sliceElement.pattern) {
Copy link
Member

Choose a reason for hiding this comment

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

@mattwiller - can you comment on this? Seems ok to me, but this is kinda out of my comfort zone.

@reshmakh reshmakh added the react Features, fixes and enhancements to react component library label May 10, 2024
@mattlong mattlong force-pushed the medplum-provider-update-valuesets branch from cb9418a to 99579fb Compare May 13, 2024 17:04
Copy link

sonarcloud bot commented May 13, 2024

@mattlong mattlong added this pull request to the merge queue May 13, 2024
Merged via the queue into main with commit 2932e2e May 13, 2024
32 checks passed
@mattlong mattlong deleted the medplum-provider-update-valuesets branch May 13, 2024 17:48
medplumbot added a commit that referenced this pull request May 25, 2024
Fix age display in PatientSummary (#4484)Fixes #4471 - DetectedIssue.status valueset and search param (#4483)
Qualify columns with table name in generated SQL (#4487)
fix(migrations): only take lock if migrating (#4490)
Document updating profiles (#4402)
Run expand tests against old and new (#4503)
Adding OpenCareHub support post (#4504)
[Medplum Provider app] Various fixes and touchups (#4500)
ci(agent): add workflow for building agent outside of a release (#4512)
feat(agent): `Agent/$reload-config` operation (#4457)
Remove broken links to Foo Provider (#4518)
Dependency upgrades 2024-05-06 (#4515)
PatientSummary and provider app tweaks (#4521)
Fixes #4509 - Improve exact match search support for token parameters in `matchesTokenFilter` (#4516)
Link to new Demo Applications (#4514)
Clarify that autobatching only applies to `GET` requests (#4479)
Added missing useEffect dependency in chat demo (#4527)
fix: allows CORS for `keyvalue` API (#4476)
Fixes #4508 - MeasureReport-subject search param backport (#4530)
Fix CLI update-server version flag (#4534)
Patient summary appointments and encounters links (#4524)
Remove unused DB columns (#4532)
fix(agent): unwrap response for `$reload-config` by id (#4542)
`PatientSummary` Problem List uses US Core profile (#4535)
fix(cli): always exit with exit code 1 after error occurs during command (#4536)
Add failing test about validating nested extensions (#4548)
Add error message when `cli` fails on login (#4507)
Remove functions moved to core (#4547)
fix: AttachmentDisplay use uncached url for download link (#4501)
feat(agent): respect `Agent.status` and `Agent.channel.endpoint.status` being `off` (#4523)
CMS 1500 and Superbill (#4543)
Demo Bot: Agent Setup (#4555)
feat(Subscription): add `author` as a `SearchParameter` (#4540)
Dependency upgrades 2024-05-13 (#4544)
Full linked Project ordering in CodeSystem lookup (#4522)
Disable super admin refresh tokens (#4492)
Minor fixes for the agent setup bot (#4560)
docs(agent): document how logging works with `Bot` and `Agent` (#4563)
Split rate limits into two buckets (#4568)
Properly detect array elements (#4569)
Apply filter to ValueSet with expansion.contains (#4570)
More efficiently validate included concepts (#4573)
Dependency upgrades 2024-05-20 (#4574)
tweak(agent): add timezone in status `lastUpdated` time (#4564)
fix(client/keyvalue): set keyvalue content-type text (#4575)
Allow configuring server default rate limits (#4491)
feat(cli): add `token` command to get access token (#4579)
Updating device resources and videos (#4578)
fix(subscriptions): don't retry ws subs if sub is deleted (#4577)
Add support for 'pr' filter operation (#4584)
Super admin endpoint for database stats (#4443)
github-merge-queue bot pushed a commit that referenced this pull request May 25, 2024
Fix age display in PatientSummary (#4484)Fixes #4471 - DetectedIssue.status valueset and search param (#4483)
Qualify columns with table name in generated SQL (#4487)
fix(migrations): only take lock if migrating (#4490)
Document updating profiles (#4402)
Run expand tests against old and new (#4503)
Adding OpenCareHub support post (#4504)
[Medplum Provider app] Various fixes and touchups (#4500)
ci(agent): add workflow for building agent outside of a release (#4512)
feat(agent): `Agent/$reload-config` operation (#4457)
Remove broken links to Foo Provider (#4518)
Dependency upgrades 2024-05-06 (#4515)
PatientSummary and provider app tweaks (#4521)
Fixes #4509 - Improve exact match search support for token parameters in `matchesTokenFilter` (#4516)
Link to new Demo Applications (#4514)
Clarify that autobatching only applies to `GET` requests (#4479)
Added missing useEffect dependency in chat demo (#4527)
fix: allows CORS for `keyvalue` API (#4476)
Fixes #4508 - MeasureReport-subject search param backport (#4530)
Fix CLI update-server version flag (#4534)
Patient summary appointments and encounters links (#4524)
Remove unused DB columns (#4532)
fix(agent): unwrap response for `$reload-config` by id (#4542)
`PatientSummary` Problem List uses US Core profile (#4535)
fix(cli): always exit with exit code 1 after error occurs during command (#4536)
Add failing test about validating nested extensions (#4548)
Add error message when `cli` fails on login (#4507)
Remove functions moved to core (#4547)
fix: AttachmentDisplay use uncached url for download link (#4501)
feat(agent): respect `Agent.status` and `Agent.channel.endpoint.status` being `off` (#4523)
CMS 1500 and Superbill (#4543)
Demo Bot: Agent Setup (#4555)
feat(Subscription): add `author` as a `SearchParameter` (#4540)
Dependency upgrades 2024-05-13 (#4544)
Full linked Project ordering in CodeSystem lookup (#4522)
Disable super admin refresh tokens (#4492)
Minor fixes for the agent setup bot (#4560)
docs(agent): document how logging works with `Bot` and `Agent` (#4563)
Split rate limits into two buckets (#4568)
Properly detect array elements (#4569)
Apply filter to ValueSet with expansion.contains (#4570)
More efficiently validate included concepts (#4573)
Dependency upgrades 2024-05-20 (#4574)
tweak(agent): add timezone in status `lastUpdated` time (#4564)
fix(client/keyvalue): set keyvalue content-type text (#4575)
Allow configuring server default rate limits (#4491)
feat(cli): add `token` command to get access token (#4579)
Updating device resources and videos (#4578)
fix(subscriptions): don't retry ws subs if sub is deleted (#4577)
Add support for 'pr' filter operation (#4584)
Super admin endpoint for database stats (#4443)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
react Features, fixes and enhancements to react component library
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants