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

Uber components. Reports #414

Open
ruscoder opened this issue Dec 19, 2024 · 2 comments
Open

Uber components. Reports #414

ruscoder opened this issue Dec 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ruscoder
Copy link
Member

<ResourceListPage
  loadReport={(searchParams) => getFHIRResources<Encounter>('Encounter', {subject: searchParams.subject})}
  getReportColumns={(resourceBundle: Bundle, reportBundle?: Bundle) => [
    {
      title: 'Total',
      value: (resourceBundle.total ?? 0).toString()
    },
    {
      title: 'Outgoing encounters count',
      value: (reportBundle.total ?? 0).toString()
    },
]}

loadReport is not mandatory, and getReportColumns by default get resourceBundle

@ruscoder ruscoder added the enhancement New feature or request label Dec 19, 2024
@ruscoder
Copy link
Member Author

@vesnushka @ir4y please take a look at the proposed interface

@ruscoder
Copy link
Member Author

ruscoder commented Dec 19, 2024

I'm thinking about the future DSL (draft!)

bundleExpression: Encounter?_revinclude=Encounter:part-of:Encounter
primaryResourcesExpression: %Bundle.entry.resource.where(resourceType = 'Encounter' and partOf = null)
columns:
  - key: name
    expression: %Resource.name + ' ' + %Bundle.resolve(%Resource.encounter.partOf).period.start
filters:
  - key: name
    searchParam: name
    type: reference
    placement: [table]

reportColumns:
  title: Total
  expression: %Bundle.total

and for loadReport it does not fit well with searchParams, because searchParams are from resource bundle.
We need more usecases of how reports are going to be used to make a decision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant