@openmrs/esm-report-builder 0.1.1-pre.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +19 -0
- package/.prettierrc +8 -0
- package/.tx/config +12 -0
- package/LICENSE +401 -0
- package/README.md +336 -0
- package/__mocks__/react-i18next.js +12 -0
- package/dist/162.js +1 -0
- package/dist/162.js.map +1 -0
- package/dist/184.js +2 -0
- package/dist/184.js.LICENSE.txt +14 -0
- package/dist/184.js.map +1 -0
- package/dist/242.js +2 -0
- package/dist/242.js.LICENSE.txt +21 -0
- package/dist/242.js.map +1 -0
- package/dist/253.js +1 -0
- package/dist/253.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/311.js +1 -0
- package/dist/311.js.map +1 -0
- package/dist/469.js +2 -0
- package/dist/469.js.LICENSE.txt +45 -0
- package/dist/469.js.map +1 -0
- package/dist/478.js +2 -0
- package/dist/478.js.LICENSE.txt +9 -0
- package/dist/478.js.map +1 -0
- package/dist/539.js +1 -0
- package/dist/539.js.map +1 -0
- package/dist/540.js +2 -0
- package/dist/540.js.LICENSE.txt +9 -0
- package/dist/540.js.map +1 -0
- package/dist/669.js +1 -0
- package/dist/669.js.map +1 -0
- package/dist/710.js +1 -0
- package/dist/710.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/838.js +2 -0
- package/dist/838.js.LICENSE.txt +9 -0
- package/dist/838.js.map +1 -0
- package/dist/917.js +1 -0
- package/dist/917.js.map +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.LICENSE.txt +19 -0
- package/dist/961.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-report-builder.js +1 -0
- package/dist/openmrs-esm-report-builder.js.buildmanifest.json +530 -0
- package/dist/openmrs-esm-report-builder.js.map +1 -0
- package/dist/routes.json +1 -0
- package/e2e/core/env.ts +5 -0
- package/e2e/core/global-setup.ts +34 -0
- package/e2e/core/test.ts +21 -0
- package/e2e/pages/app-shell.page.ts +34 -0
- package/e2e/pages/etl-sources.page.ts +35 -0
- package/e2e/pages/report-sections.page.ts +20 -0
- package/e2e/pages/section-preview.modal.ts +29 -0
- package/e2e/specs/etl-sources.spec.ts +51 -0
- package/e2e/specs/navigation.spec.ts +13 -0
- package/e2e/specs/section-preview-validation.spec.ts +38 -0
- package/e2e/specs/section-preview.spec.ts +94 -0
- package/e2e/support/github/Dockerfile +22 -0
- package/e2e/support/github/Dockerfile.dockerignore +13 -0
- package/e2e/support/github/docker-compose.yml +31 -0
- package/e2e/support/github/run-e2e-docker-env.sh +131 -0
- package/e2e/support/github/spa-assemble-config.json +9 -0
- package/e2e/tsconfig.json +11 -0
- package/example.env +5 -0
- package/jest.config.js +28 -0
- package/linelist_report_builder_design_spec.md +816 -0
- package/package.json +111 -0
- package/playwright.config.ts +28 -0
- package/routes.json +22 -0
- package/src/__debug__/all-designs.test.tsx +30 -0
- package/src/admin-card-link.extension.module.scss +55 -0
- package/src/admin-card-link.extension.tsx +24 -0
- package/src/components/admin/admin-page.component.tsx +75 -0
- package/src/components/admin/age-categories-page.component.tsx +109 -0
- package/src/components/admin/age-groups-page.component.tsx +146 -0
- package/src/components/admin/etl-browser/columns-tab.component.tsx +80 -0
- package/src/components/admin/etl-browser/etl-browser-page.component.tsx +309 -0
- package/src/components/admin/etl-browser/etl-browser.component.scss +424 -0
- package/src/components/admin/etl-browser/metadata-tab.component.tsx +65 -0
- package/src/components/admin/etl-browser/preview-grid.component.tsx +189 -0
- package/src/components/admin/etl-browser/relationships-tab.component.tsx +21 -0
- package/src/components/admin/etl-browser/sources-tree.component.tsx +118 -0
- package/src/components/admin/etl-browser/table-detail.component.tsx +124 -0
- package/src/components/admin/etl-browser/table-info-strip.component.tsx +51 -0
- package/src/components/admin/etl-browser/table-list.component.tsx +136 -0
- package/src/components/admin/etl-browser/use-table-preview.ts +47 -0
- package/src/components/admin/etl-sources-page.component.tsx +355 -0
- package/src/components/admin/etl-tasks-page.component.scss +370 -0
- package/src/components/admin/etl-tasks-page.component.tsx +768 -0
- package/src/components/admin/report-categories-page.component.tsx +267 -0
- package/src/components/admin/report-library-page.component.tsx +551 -0
- package/src/components/ai-support/ai-assist-button.component.tsx +30 -0
- package/src/components/ai-support/ai-assist-modal.component.tsx +81 -0
- package/src/components/ai-support/ai.service.ts +21 -0
- package/src/components/ai-support/ai.types.ts +12 -0
- package/src/components/app-shell/report-builder-shell.component.tsx +242 -0
- package/src/components/app-shell/report-builder-shell.scss +18 -0
- package/src/components/dashboards/dashboard-config.schema.ts +97 -0
- package/src/components/dashboards/dashboard-form-modal.component.tsx +150 -0
- package/src/components/dashboards/dashboards-admin.scss +62 -0
- package/src/components/dashboards/dashboards-page.component.tsx +153 -0
- package/src/components/dashboards/dashboards-table.component.tsx +130 -0
- package/src/components/dashboards/sections/dashboard-autoinclude.section.tsx +75 -0
- package/src/components/dashboards/sections/dashboard-basics.section.tsx +80 -0
- package/src/components/dashboards/sections/dashboard-json.section.tsx +79 -0
- package/src/components/dashboards/sections/dashboard-sections-editor.section.tsx +130 -0
- package/src/components/dashboards/sections/dashboard-widgets-editor.section.tsx +184 -0
- package/src/components/data-themes/data-theme-form.component.tsx +59 -0
- package/src/components/data-themes/data-theme-modal.component.tsx +349 -0
- package/src/components/data-themes/data-themes-page.component.tsx +139 -0
- package/src/components/data-themes/data-themes-table.component.tsx +98 -0
- package/src/components/data-themes/icon-registry.ts +35 -0
- package/src/components/data-themes/sections/data-theme-basics.section.tsx +63 -0
- package/src/components/data-themes/sections/data-theme-condition-columns.section.tsx +397 -0
- package/src/components/data-themes/sections/data-theme-fields-editor.section.tsx +125 -0
- package/src/components/data-themes/sections/data-theme-metadata.section.tsx +245 -0
- package/src/components/data-themes/sections/data-theme-preview.section.tsx +115 -0
- package/src/components/data-themes/sections/data-theme-source.section.tsx +184 -0
- package/src/components/data-visualizer/components/cqi-components/cqi-data-table.component.tsx +214 -0
- package/src/components/data-visualizer/components/cqi-components/cqi-elements.ts +203 -0
- package/src/components/data-visualizer/components/cqi-components/detail.component.tsx +110 -0
- package/src/components/data-visualizer/components/cqi-components/detail.scss +22 -0
- package/src/components/data-visualizer/components/data-table/data-table.component.tsx +208 -0
- package/src/components/data-visualizer/components/data-table/data-tables.scss +206 -0
- package/src/components/data-visualizer/components/empty-state/empty-state-illustration.component.tsx +53 -0
- package/src/components/data-visualizer/components/header/header.component.tsx +43 -0
- package/src/components/data-visualizer/components/header/header.scss +71 -0
- package/src/components/data-visualizer/components/model/confirm.component.tsx +40 -0
- package/src/components/data-visualizer/components/panel/panel.component.tsx +20 -0
- package/src/components/data-visualizer/components/panel/panel.scss +25 -0
- package/src/components/data-visualizer/components/popover/modifier-panel.tsx +53 -0
- package/src/components/data-visualizer/constants.ts +445 -0
- package/src/components/data-visualizer/data-visualizer-illustration.component.tsx +31 -0
- package/src/components/data-visualizer/data-visualizer.component.tsx +1935 -0
- package/src/components/data-visualizer/data-visualizer.resource.ts +462 -0
- package/src/components/data-visualizer/data-visualizer.scss +449 -0
- package/src/components/data-visualizer/declarations.d.ts +131 -0
- package/src/components/data-visualizer/parameter-inputs/boolean-parameter-input.component.tsx +34 -0
- package/src/components/data-visualizer/parameter-inputs/concept-parameter-input.component.tsx +81 -0
- package/src/components/data-visualizer/parameter-inputs/date-parameter-input.component.tsx +110 -0
- package/src/components/data-visualizer/parameter-inputs/date-range-input.component.scss +47 -0
- package/src/components/data-visualizer/parameter-inputs/date-range-input.component.tsx +228 -0
- package/src/components/data-visualizer/parameter-inputs/identifier-type-parameter-input.component.tsx +69 -0
- package/src/components/data-visualizer/parameter-inputs/list-parameter-input.component.tsx +73 -0
- package/src/components/data-visualizer/parameter-inputs/location-parameter-input.component.tsx +81 -0
- package/src/components/data-visualizer/parameter-inputs/number-parameter-input.component.tsx +40 -0
- package/src/components/data-visualizer/parameter-inputs/person-attribute-parameter-input.component.tsx +71 -0
- package/src/components/data-visualizer/parameter-inputs/text-parameter-input.component.tsx +52 -0
- package/src/components/data-visualizer/report-parameter-modal.component.tsx +383 -0
- package/src/components/data-visualizer/types.ts +206 -0
- package/src/components/etl-monitor/builder/builder-state-machine.ts +381 -0
- package/src/components/etl-monitor/builder/design-registry.tsx +139 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-context.tsx +702 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-modal.component.tsx +461 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-modal.scss +256 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-page.component.tsx +387 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-page.scss +976 -0
- package/src/components/etl-monitor/builder/generated-config-panel.component.tsx +168 -0
- package/src/components/etl-monitor/builder/generated-config-panel.scss +198 -0
- package/src/components/etl-monitor/builder/index.ts +5 -0
- package/src/components/etl-monitor/builder/monitor-preview.tsx +124 -0
- package/src/components/etl-monitor/builder/steps/data-source-step.component.tsx +667 -0
- package/src/components/etl-monitor/builder/steps/data-source-step.scss +284 -0
- package/src/components/etl-monitor/builder/steps/design-samples.ts +278 -0
- package/src/components/etl-monitor/builder/steps/design-step.component.tsx +299 -0
- package/src/components/etl-monitor/builder/steps/design-step.scss +479 -0
- package/src/components/etl-monitor/builder/steps/fields-step.component.tsx +859 -0
- package/src/components/etl-monitor/builder/steps/fields-step.scss +459 -0
- package/src/components/etl-monitor/builder/steps/general-step.component.tsx +288 -0
- package/src/components/etl-monitor/builder/steps/general-step.scss +103 -0
- package/src/components/etl-monitor/builder/steps/index.ts +5 -0
- package/src/components/etl-monitor/builder/steps/preview-step.component.tsx +245 -0
- package/src/components/etl-monitor/builder/steps/preview-step.scss +236 -0
- package/src/components/etl-monitor/etl-monitor-card-shell.component.tsx +154 -0
- package/src/components/etl-monitor/etl-monitor-card-shell.scss +103 -0
- package/src/components/etl-monitor/etl-monitor-dashboard.component.tsx +227 -0
- package/src/components/etl-monitor/etl-monitor-dashboard.scss +148 -0
- package/src/components/etl-monitor/etl-monitor-status-card.component.tsx +192 -0
- package/src/components/etl-monitor/etl-monitors-page.component.tsx +621 -0
- package/src/components/etl-monitor/renderers/DetailsRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/ErrorLogRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/EtlMonitorWidget.tsx +97 -0
- package/src/components/etl-monitor/renderers/MetricsGridRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/MonitorRenderer.tsx +175 -0
- package/src/components/etl-monitor/renderers/ProgressRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/StatusCardRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/SummaryCardRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/TableRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/component-icons.tsx +33 -0
- package/src/components/etl-monitor/renderers/components/details-renderer.tsx +195 -0
- package/src/components/etl-monitor/renderers/components/error-log-renderer.tsx +104 -0
- package/src/components/etl-monitor/renderers/components/index.ts +6 -0
- package/src/components/etl-monitor/renderers/components/log-renderer.tsx +86 -0
- package/src/components/etl-monitor/renderers/components/metrics-grid-renderer.tsx +133 -0
- package/src/components/etl-monitor/renderers/components/progress-renderer.tsx +188 -0
- package/src/components/etl-monitor/renderers/components/status-card-renderer.tsx +247 -0
- package/src/components/etl-monitor/renderers/components/summary-card-renderer.tsx +160 -0
- package/src/components/etl-monitor/renderers/components/table-renderer.tsx +175 -0
- package/src/components/etl-monitor/renderers/components/time-series-renderer.tsx +310 -0
- package/src/components/etl-monitor/renderers/data-transformer.ts +361 -0
- package/src/components/etl-monitor/renderers/index.ts +11 -0
- package/src/components/etl-monitor/renderers/legacy-monitor-renderer.tsx +69 -0
- package/src/components/etl-monitor/renderers/monitor-renderer.tsx +6 -0
- package/src/components/etl-monitor/renderers/monitor-renderers.scss +1621 -0
- package/src/components/etl-monitor/renderers/monitor-widget-card.component.tsx +54 -0
- package/src/components/etl-monitor/renderers/monitor-widget-card.scss +16 -0
- package/src/components/etl-monitor/renderers/v2-monitor-renderer.tsx +227 -0
- package/src/components/import-export/artifact-groups.ts +153 -0
- package/src/components/import-export/export-report-modal.component.tsx +265 -0
- package/src/components/import-export/import-export-page.component.tsx +610 -0
- package/src/components/import-export/import-export.styles.scss +825 -0
- package/src/components/import-export/import-package-modal.component.tsx +401 -0
- package/src/components/import-export/index.ts +3 -0
- package/src/components/indicators/README.md +24 -0
- package/src/components/indicators/base-indicator-basic-fields.component.tsx +18 -0
- package/src/components/indicators/base-indicator-basics.section.tsx +54 -0
- package/src/components/indicators/base-indicator-countby.section.tsx +25 -0
- package/src/components/indicators/base-indicator-criteria.section.tsx +83 -0
- package/src/components/indicators/base-indicator-details-form.component.tsx +80 -0
- package/src/components/indicators/base-indicator-theme-unit-fields.component.tsx +39 -0
- package/src/components/indicators/create-base-indicator-modal.component.tsx +623 -0
- package/src/components/indicators/create-composite-base-indicator-modal.component.tsx +295 -0
- package/src/components/indicators/create-custom-indicator-modal.component.tsx +548 -0
- package/src/components/indicators/create-final-indicator-modal.component.tsx +285 -0
- package/src/components/indicators/custom-condition-input.component.tsx +310 -0
- package/src/components/indicators/diagnosis-filters-form.component.tsx +101 -0
- package/src/components/indicators/disaggregation-panel.component.tsx +93 -0
- package/src/components/indicators/handler/concept-search-multiselect.component.tsx +153 -0
- package/src/components/indicators/handler/question-answer-concept-search.component.tsx +336 -0
- package/src/components/indicators/indicator-run-preview-modal.component.tsx +391 -0
- package/src/components/indicators/indicator-search-select.component.tsx +297 -0
- package/src/components/indicators/indicator-status-tag.component.tsx +9 -0
- package/src/components/indicators/indicators-page.component.tsx +673 -0
- package/src/components/indicators/indicators-page.scss +121 -0
- package/src/components/indicators/indicators-table.component.tsx +188 -0
- package/src/components/indicators/preview-table.component.tsx +31 -0
- package/src/components/indicators/sections/composite-indicator-basics.section.tsx +36 -0
- package/src/components/indicators/sections/composite-indicator-picker.section.tsx +116 -0
- package/src/components/indicators/sections/composite-indicator-sql-preview.section.tsx +31 -0
- package/src/components/indicators/sections/custom-indicator-basics.section.tsx +65 -0
- package/src/components/indicators/sections/custom-indicator-disaggregation.section.tsx +93 -0
- package/src/components/indicators/sections/custom-indicator-filters.section.tsx +203 -0
- package/src/components/indicators/sections/custom-indicator-population.section.tsx +107 -0
- package/src/components/indicators/sections/custom-indicator-sql-preview.section.tsx +108 -0
- package/src/components/indicators/sections/final-indicator-basics.section.tsx +46 -0
- package/src/components/indicators/sections/final-indicator-disaggregation.section.tsx +47 -0
- package/src/components/indicators/sections/final-indicator-picker.section.tsx +60 -0
- package/src/components/indicators/sections/final-indicator-preview.section.tsx +20 -0
- package/src/components/indicators/sections/final-indicator-results-preview.section.tsx +65 -0
- package/src/components/indicators/sections/indicator-basics.section.tsx +40 -0
- package/src/components/indicators/sections/indicator-conditions.section.tsx +279 -0
- package/src/components/indicators/sections/indicator-sql-preview.section.tsx +63 -0
- package/src/components/indicators/sections/indicator-theme.section.tsx +48 -0
- package/src/components/indicators/sql-preview.component.tsx +19 -0
- package/src/components/indicators/tag-input.component.tsx +177 -0
- package/src/components/indicators/types/base-indicator-form.types.ts +17 -0
- package/src/components/indicators/types/base-indicator-theme.constants.ts +8 -0
- package/src/components/indicators/types/composite-indicator.types.ts +27 -0
- package/src/components/indicators/types/condition-ui.types.ts +11 -0
- package/src/components/indicators/types/custom-indicator.types.ts +161 -0
- package/src/components/indicators/types/data-theme-config.types.ts +88 -0
- package/src/components/indicators/types/indicator-types.ts +57 -0
- package/src/components/indicators/types/sql-builders.ts +43 -0
- package/src/components/indicators/utils/composite-indicator-sql.utils.test.ts +143 -0
- package/src/components/indicators/utils/composite-indicator-sql.utils.ts +426 -0
- package/src/components/indicators/utils/concept-preload.utils.ts +21 -0
- package/src/components/indicators/utils/custom-indicator-interpreter.test.ts +493 -0
- package/src/components/indicators/utils/custom-indicator-interpreter.ts +702 -0
- package/src/components/indicators/utils/final-indicator-sql.utils.ts +190 -0
- package/src/components/indicators/utils/indicator-conditions-hydration.utils.ts +254 -0
- package/src/components/indicators/utils/indicator-sql-resolution.utils.ts +204 -0
- package/src/components/indicators/utils/indicator-sql.utils.ts +721 -0
- package/src/components/indicators/utils/population-sql.compiler.test.ts +999 -0
- package/src/components/indicators/utils/population-sql.compiler.ts +858 -0
- package/src/components/landing/landing-action-item.component.tsx +50 -0
- package/src/components/landing/landing-action-list.component.tsx +12 -0
- package/src/components/landing/landing-activity-list.component.tsx +47 -0
- package/src/components/landing/landing-footer-grid.component.tsx +45 -0
- package/src/components/landing/landing-hero.component.tsx +18 -0
- package/src/components/landing/landing-section-card.component.tsx +33 -0
- package/src/components/landing/report-builder-landing-page.component.tsx +186 -0
- package/src/components/landing/report-builder-landing-page.scss +131 -0
- package/src/components/legacy-reports/legacy-report-detail-page.component.tsx +300 -0
- package/src/components/legacy-reports/legacy-report-editor-page.component.tsx +324 -0
- package/src/components/legacy-reports/legacy-report-upload-modal.component.tsx +307 -0
- package/src/components/legacy-reports/legacy-reports-page.component.tsx +206 -0
- package/src/components/legacy-reports/legacy-reports-table.component.tsx +154 -0
- package/src/components/legacy-reports/tabs/legacy-report-datasets-tab.component.tsx +344 -0
- package/src/components/legacy-reports/tabs/legacy-report-dimensions-tab.component.tsx +590 -0
- package/src/components/legacy-reports/tabs/legacy-report-indicators-tab.component.tsx +490 -0
- package/src/components/legacy-reports/tabs/legacy-report-json-preview-tab.component.tsx +272 -0
- package/src/components/legacy-reports/tabs/legacy-report-overview-tab.component.tsx +218 -0
- package/src/components/legacy-reports/tabs/legacy-report-parameters-tab.component.tsx +279 -0
- package/src/components/linelist/definition/indicator-to-sql.utils.ts +281 -0
- package/src/components/linelist/definition/linelist-definition-editor.component.tsx +1676 -0
- package/src/components/linelist/definition/linelist-definition-editor.scss +461 -0
- package/src/components/linelist/definition/linelist-definition.types.ts +108 -0
- package/src/components/linelist/definition/panels/column-properties-panel.component.tsx +328 -0
- package/src/components/linelist/definition/panels/column-selector-panel.component.tsx +1082 -0
- package/src/components/linelist/definition/panels/column-selector-panel.scss +100 -0
- package/src/components/linelist/definition/panels/custom-sql-column-modal.component.tsx +248 -0
- package/src/components/linelist/definition/panels/encounter-diagnosis-column-modal.component.tsx +300 -0
- package/src/components/linelist/definition/panels/encounter-diagnosis-column-modal.scss +21 -0
- package/src/components/linelist/definition/panels/multi-datasource-selector.component.tsx +332 -0
- package/src/components/linelist/definition/panels/multi-datasource-selector.scss +161 -0
- package/src/components/linelist/definition/panels/observation-column-modal.component.tsx +450 -0
- package/src/components/linelist/definition/panels/observation-column-modal.scss +29 -0
- package/src/components/linelist/definition/panels/parameter-panel.component.tsx +659 -0
- package/src/components/linelist/definition/panels/parameter-panel.scss +64 -0
- package/src/components/linelist/definition/panels/population-source-selector.component.tsx +407 -0
- package/src/components/linelist/definition/panels/population-source-selector.scss +187 -0
- package/src/components/linelist/design/panels/column-category-selector.component.tsx +433 -0
- package/src/components/linelist/design/panels/column-category-selector.scss +329 -0
- package/src/components/linelist/design/panels/column-debug-panel.component.tsx +197 -0
- package/src/components/linelist/design/panels/column-debug-panel.scss +141 -0
- package/src/components/linelist/design/panels/data-catalogue.component.tsx +1062 -0
- package/src/components/linelist/design/panels/data-catalogue.scss +263 -0
- package/src/components/linelist/design/panels/display-settings-panel.component.tsx +405 -0
- package/src/components/linelist/design/panels/display-settings-panel.scss +78 -0
- package/src/components/linelist/design/panels/filtermap-editor.component.tsx +434 -0
- package/src/components/linelist/design/panels/filtermap-editor.scss +176 -0
- package/src/components/linelist/design/panels/json-preview.component.tsx +114 -0
- package/src/components/linelist/design/panels/json-preview.scss +85 -0
- package/src/components/linelist/design/panels/query-config-panel.component.tsx +1137 -0
- package/src/components/linelist/design/panels/query-config-panel.scss +342 -0
- package/src/components/linelist/design/panels/sort-config-panel.component.tsx +330 -0
- package/src/components/linelist/design/panels/sort-config-panel.scss +77 -0
- package/src/components/linelist/design/panels/sql-builder-panel.component.tsx +475 -0
- package/src/components/linelist/design/panels/sql-builder-panel.scss +226 -0
- package/src/components/linelist/design/panels/transformation-panel.component.tsx +687 -0
- package/src/components/linelist/design/panels/transformation-panel.scss +81 -0
- package/src/components/linelist/design/panels/visual-filter-panel.component.tsx +595 -0
- package/src/components/linelist/design/panels/visual-filter-panel.scss +76 -0
- package/src/components/linelist/linelist-dashboard.page.component.tsx +756 -0
- package/src/components/linelist/linelist-dashboard.page.scss +240 -0
- package/src/components/linelist/linelist-editor.page.component.tsx +134 -0
- package/src/components/linelist/linelist-editor.page.scss +28 -0
- package/src/components/linelist/linelist-run-report.page.component.tsx +715 -0
- package/src/components/linelist/linelist-run-report.page.scss +136 -0
- package/src/components/linelist/modals/linelist-report-builder-modal.component.tsx +1454 -0
- package/src/components/linelist/modals/linelist-report-builder-modal.scss +164 -0
- package/src/components/linelist/modals/preview-parameter-modal.component.tsx +361 -0
- package/src/components/report/dashboard/reports-table.component.tsx +186 -0
- package/src/components/report/definition/panels/properties-panel.component.tsx +38 -0
- package/src/components/report/definition/panels/report-structure-panel.component.tsx +61 -0
- package/src/components/report/definition/panels/selection-panel.component.tsx +58 -0
- package/src/components/report/definition/report-definition-editor.component.tsx +99 -0
- package/src/components/report/definition/report-definition.types.ts +66 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/report/design/panels/JsonPreviewPanel.scss +32 -0
- package/src/components/report/design/panels/JsonPreviewPanel.tsx +104 -0
- package/src/components/report/design/panels/mapping-preview-panel.component.tsx +82 -0
- package/src/components/report/design/panels/mapping-preview-panel.scss +55 -0
- package/src/components/report/design/panels/template-structure-panel.component.tsx +296 -0
- package/src/components/report/design/panels/template-structure-panel.scss +81 -0
- package/src/components/report/design/report-design-editor.component.tsx +1170 -0
- package/src/components/report/design/report-design.types.ts +48 -0
- package/src/components/report/design/report-design.utils.ts +86 -0
- package/src/components/report/panels/report-detail.component.tsx +71 -0
- package/src/components/report/panels/report-panel-shell.component.tsx +60 -0
- package/src/components/report/report-dashboard.page.component.tsx +554 -0
- package/src/components/report/report-editor.page.component.tsx +590 -0
- package/src/components/report/report.routes.tsx +32 -0
- package/src/components/report-sections/create-report-section-modal.component.tsx +388 -0
- package/src/components/report-sections/hooks/useAgeCategories.ts +25 -0
- package/src/components/report-sections/hooks/useSectionEditorState.ts +449 -0
- package/src/components/report-sections/panels/Dhis2MappingPanel.tsx +157 -0
- package/src/components/report-sections/panels/DisaggregationPanel.tsx +97 -0
- package/src/components/report-sections/panels/IndicatorPickerPanel.tsx +201 -0
- package/src/components/report-sections/panels/SectionBasicsPanel.tsx +27 -0
- package/src/components/report-sections/report-section-preview-modal.component.tsx +548 -0
- package/src/components/report-sections/report-sections-page.component.tsx +325 -0
- package/src/components/report-sections/section-disaggregation.utils.ts +637 -0
- package/src/components/report-sections/section-types.ts +55 -0
- package/src/components/report-sections/section-utils.ts +50 -0
- package/src/components/report-sections/sections-page.scss +79 -0
- package/src/components/run-reports/run-reports-page.component.tsx +8 -0
- package/src/components/security/access-denied-page.component.tsx +69 -0
- package/src/components/security/access-denied-page.scss +39 -0
- package/src/components/security/privilege-route.component.test.tsx +79 -0
- package/src/components/security/privilege-route.component.tsx +39 -0
- package/src/components/shared/compile-setup-modal.component.tsx +182 -0
- package/src/components/shared/concept-selector.component.tsx +245 -0
- package/src/components/shared/concept-selector.scss +121 -0
- package/src/components/shared/header/builder-header-actions.component.tsx +38 -0
- package/src/components/shared/header/header.component.tsx +85 -0
- package/src/components/shared/header/header.scss +150 -0
- package/src/components/shared/header/illustration.component.tsx +34 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.scss +32 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.tsx +104 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.component.tsx +82 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.scss +55 -0
- package/src/components/shared/preview/query-results-preview.component.tsx +204 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.component.tsx +296 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.scss +81 -0
- package/src/config-schema.ts +43 -0
- package/src/constants/privileges.test.ts +53 -0
- package/src/constants/privileges.ts +118 -0
- package/src/features/dashboards/DashboardRendererPage.tsx +174 -0
- package/src/features/dashboards/DashboardsPage.tsx +164 -0
- package/src/features/dashboards/EtlDashboardPage.tsx +32 -0
- package/src/features/dashboards/components/DashboardEmptyState.tsx +41 -0
- package/src/features/dashboards/components/DashboardGrid.tsx +48 -0
- package/src/features/dashboards/components/DashboardHeader.tsx +58 -0
- package/src/features/dashboards/components/DashboardSection.tsx +46 -0
- package/src/features/dashboards/components/ReportLaunchCard.tsx +51 -0
- package/src/features/dashboards/components/WidgetSlotDispatcher.tsx +61 -0
- package/src/features/dashboards/components/WidgetUnavailableCard.tsx +36 -0
- package/src/features/dashboards/dashboards.scss +196 -0
- package/src/features/dashboards/hooks/useDashboard.ts +61 -0
- package/src/features/dashboards/hooks/useDashboardWidgets.ts +74 -0
- package/src/features/dashboards/hooks/useDashboards.ts +56 -0
- package/src/features/dashboards/hooks/useMonitorDataMap.ts +84 -0
- package/src/features/dashboards/index.ts +11 -0
- package/src/features/dashboards/utils/dashboard-config.util.test.ts +255 -0
- package/src/features/dashboards/utils/dashboard-config.util.ts +382 -0
- package/src/features/report-visualizer/ReportVisualizerPage.tsx +448 -0
- package/src/features/report-visualizer/components/Export/ExportMenu.tsx +141 -0
- package/src/features/report-visualizer/components/Export/index.ts +2 -0
- package/src/features/report-visualizer/components/ReportExplorer/QuickFilters.tsx +152 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportCategoryFilter.tsx +54 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportExplorerPanel.tsx +201 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportExplorerRail.tsx +202 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportList.tsx +287 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportSearch.tsx +151 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportTagFilter.tsx +100 -0
- package/src/features/report-visualizer/components/ReportExplorer/RunReportButton.tsx +42 -0
- package/src/features/report-visualizer/components/ReportExplorer/RuntimeParameterForm.tsx +259 -0
- package/src/features/report-visualizer/components/ReportExplorer/index.ts +8 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportLayer.tsx +33 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportSummary.tsx +88 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportViewTabs.tsx +72 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportWorkspaceHeader.tsx +92 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportWorkspacePanel.tsx +242 -0
- package/src/features/report-visualizer/components/ReportWorkspace/index.ts +5 -0
- package/src/features/report-visualizer/components/TableView/ColumnVisibilityMenu.tsx +206 -0
- package/src/features/report-visualizer/components/TableView/ReportTable.tsx +253 -0
- package/src/features/report-visualizer/components/TableView/index.ts +2 -0
- package/src/features/report-visualizer/hooks/index.ts +4 -0
- package/src/features/report-visualizer/hooks/useExplorerPreferences.ts +103 -0
- package/src/features/report-visualizer/hooks/useReportCapabilities.ts +112 -0
- package/src/features/report-visualizer/hooks/useReportParameters.ts +152 -0
- package/src/features/report-visualizer/hooks/useReports.ts +135 -0
- package/src/features/report-visualizer/index.ts +6 -0
- package/src/features/report-visualizer/report-visualizer.scss +593 -0
- package/src/features/report-visualizer/types/index.ts +1 -0
- package/src/features/report-visualizer/types/report-visualizer.types.ts +104 -0
- package/src/features/report-visualizer/utils/status-colors.ts +117 -0
- package/src/globals.d.ts +14 -0
- package/src/hooks/address-template.ts +86 -0
- package/src/hooks/concept.ts +112 -0
- package/src/hooks/indicator/index.ts +1 -0
- package/src/hooks/indicator/useIndicatorsByTheme.ts +41 -0
- package/src/hooks/openmrs-reference-data.ts +432 -0
- package/src/hooks/theme/index.ts +4 -0
- package/src/hooks/theme/useDataTheme.ts +61 -0
- package/src/hooks/theme/useDataThemes.ts +28 -0
- package/src/hooks/theme/useMambaTableMeta.ts +34 -0
- package/src/hooks/theme/useMambaTables.ts +95 -0
- package/src/hooks/use-report-builder-privileges.test.tsx +98 -0
- package/src/hooks/use-report-builder-privileges.ts +58 -0
- package/src/index.ts +29 -0
- package/src/resources/address-template/address-template.api.ts +180 -0
- package/src/resources/agegroup/agegroups.api.ts +58 -0
- package/src/resources/concept/concept.api.ts +116 -0
- package/src/resources/concepts/concept-mapper.ts +21 -0
- package/src/resources/concepts/concept-types.ts +31 -0
- package/src/resources/concepts/concepts.resource.ts +44 -0
- package/src/resources/concepts/useConceptSearch.ts +41 -0
- package/src/resources/dashboard/dashboard.api.ts +107 -0
- package/src/resources/etl-monitor/etl-monitor-test.api.ts +409 -0
- package/src/resources/etl-monitor/etl-monitor.api.ts +381 -0
- package/src/resources/etl-source/etl-source.api.ts +65 -0
- package/src/resources/etl-task/etl-task.api.ts +96 -0
- package/src/resources/etl-task/etl-task.types.ts +31 -0
- package/src/resources/indicator/indicators.api.ts +125 -0
- package/src/resources/legacy-reports/legacy-reports.api.ts +144 -0
- package/src/resources/linelist/linelist-reports.api.ts +616 -0
- package/src/resources/location/location.api.ts +135 -0
- package/src/resources/openmrs-api.ts +40 -0
- package/src/resources/patient-identifier-type/patient-identifier-type.api.ts +65 -0
- package/src/resources/person-attribute-type/person-attribute-type.api.ts +71 -0
- package/src/resources/preview/sql-preview.api.ts +54 -0
- package/src/resources/report/reports.api.ts +140 -0
- package/src/resources/report-category/report-category.api.ts +41 -0
- package/src/resources/report-import-export/import-export-api.ts +164 -0
- package/src/resources/report-library/report-library.api.ts +63 -0
- package/src/resources/report-section/report-sections.api.ts +73 -0
- package/src/resources/report-section/section-preview.api.ts +25 -0
- package/src/resources/theme/data-theme.api.ts +88 -0
- package/src/resources/theme/etl-schema.api.ts +101 -0
- package/src/resources/theme/etl-table-meta.api.ts +45 -0
- package/src/root.component.tsx +20 -0
- package/src/routes/report-builder.routes.tsx +160 -0
- package/src/routes/report-builder.scss +56 -0
- package/src/routes.json +28 -0
- package/src/sample-template.ts +121 -0
- package/src/template-utils.ts +110 -0
- package/src/types/carbon-react-inert.d.ts +13 -0
- package/src/types/condition-operators.ts +63 -0
- package/src/types/dashboard/dashboard.types.ts +137 -0
- package/src/types/dashboard/index.ts +4 -0
- package/src/types/etl/etl-types.ts +238 -0
- package/src/types/etl-monitor/etl-monitor-builder.types.ts +555 -0
- package/src/types/etl-monitor/etl-monitor-v2.types.ts +397 -0
- package/src/types/etl-monitor/etl-monitor.types.ts +188 -0
- package/src/types/etl-monitor/index.ts +6 -0
- package/src/types/linelist/compile-config.ts +455 -0
- package/src/types/linelist-types.ts +2059 -0
- package/src/types/theme/data-theme.types.ts +88 -0
- package/src/utils/api-error.utils.test.ts +151 -0
- package/src/utils/api-error.utils.ts +131 -0
- package/src/utils/config-enhancer.ts +62 -0
- package/src/utils/etl-browser/etl-browser.util.test.ts +145 -0
- package/src/utils/etl-browser/export-csv.util.ts +43 -0
- package/src/utils/etl-browser/group-tables.util.ts +84 -0
- package/src/utils/etl-browser/index.ts +4 -0
- package/src/utils/etl-browser/summarize-columns.util.ts +27 -0
- package/src/utils/etl-browser/table-sql.util.ts +20 -0
- package/src/utils/etl-monitor/config-v2-adapter.util.ts +460 -0
- package/src/utils/etl-monitor/endpoint-config-normalizer.util.ts +383 -0
- package/src/utils/etl-monitor/index.ts +10 -0
- package/src/utils/etl-monitor/jsonpath-resolver.util.ts +118 -0
- package/src/utils/etl-monitor/normalization-examples.ts +0 -0
- package/src/utils/etl-monitor/schema-inspector.util.ts +76 -0
- package/src/utils/etl-monitor/semantic-type-detector.util.ts +76 -0
- package/src/utils/etl-monitor/status-mapper.util.ts +105 -0
- package/src/utils/etl-monitor/value-formatters.util.ts +167 -0
- package/src/utils/etl-task/etl-task-card.util.test.ts +239 -0
- package/src/utils/etl-task/etl-task-card.util.ts +276 -0
- package/src/utils/etl-task/index.ts +1 -0
- package/src/utils/html-entities.utils.ts +34 -0
- package/src/utils/parameter-resolution.ts +218 -0
- package/src/views/etl-monitor-builder/add-monitor-modal.component.scss +0 -0
- package/src/views/etl-monitor-builder/add-monitor-modal.component.tsx +210 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.component.scss +157 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.component.tsx +252 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.store.ts +126 -0
- package/tools/scss-stub.js +12 -0
- package/tools/setup-tests.ts +1 -0
- package/translations/en.json +65 -0
- package/tsconfig.json +43 -0
- package/webpack.config.js +30 -0
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
# UgandaEMR Report Builder — Linelist Builder Design Specification
|
|
2
|
+
|
|
3
|
+
## 1. Product decision
|
|
4
|
+
|
|
5
|
+
Keep the existing aggregate-report workflow (`Reports → Indicators → Sections → Run Reports`) unchanged. Add a dedicated linelist builder under `Linelist Reports` because a linelist has a different mental model:
|
|
6
|
+
|
|
7
|
+
- Aggregate report: define indicators, compose sections, calculate totals.
|
|
8
|
+
- Linelist report: define a row grain, select columns, filter records, resolve repeated clinical data, preview individual rows.
|
|
9
|
+
|
|
10
|
+
The new builder should be inspired by Apache Superset's Explore workspace but use the existing OpenMRS/Carbon visual language.
|
|
11
|
+
|
|
12
|
+
## 2. Design goals
|
|
13
|
+
|
|
14
|
+
1. Allow a report designer to create a usable linelist without writing SQL.
|
|
15
|
+
2. Preserve an advanced SQL path for expert users.
|
|
16
|
+
3. Build and save the current JSON report definition format.
|
|
17
|
+
4. Prevent accidental duplicate rows caused by one-to-many clinical data.
|
|
18
|
+
5. Show a live preview before publication.
|
|
19
|
+
6. Enforce facility and patient-data permissions at query time and export time.
|
|
20
|
+
7. Reuse existing administration areas: Report Categories, Report Library, Data Themes and ETL Sources.
|
|
21
|
+
|
|
22
|
+
## 3. Information architecture
|
|
23
|
+
|
|
24
|
+
### Existing navigation
|
|
25
|
+
|
|
26
|
+
- Home
|
|
27
|
+
- Reports
|
|
28
|
+
- Indicators
|
|
29
|
+
- Sections
|
|
30
|
+
- Run Reports
|
|
31
|
+
- Linelist Reports
|
|
32
|
+
- Admin
|
|
33
|
+
|
|
34
|
+
### Recommended Linelist Reports sub-routes
|
|
35
|
+
|
|
36
|
+
- `/linelist-reports` — report list
|
|
37
|
+
- `/linelist-reports/new` — create report
|
|
38
|
+
- `/linelist-reports/:uuid/edit` — builder workspace
|
|
39
|
+
- `/linelist-reports/:uuid/run` — run and view report
|
|
40
|
+
- `/linelist-reports/:uuid/history` — revisions and audit history
|
|
41
|
+
|
|
42
|
+
Do not add more permanent items to the left navigation. Use tabs and breadcrumbs inside Linelist Reports.
|
|
43
|
+
|
|
44
|
+
## 4. Screen 1 — Linelist report list
|
|
45
|
+
|
|
46
|
+
### Header
|
|
47
|
+
|
|
48
|
+
- Breadcrumb: `Report builder / Linelist reports`
|
|
49
|
+
- Page title: `Linelist Reports`
|
|
50
|
+
- Description: `Create and manage reports that return individual patient or clinical records.`
|
|
51
|
+
- Primary button: `Create linelist report`
|
|
52
|
+
|
|
53
|
+
### Toolbar
|
|
54
|
+
|
|
55
|
+
- Search: name, code or description
|
|
56
|
+
- Status filter: All, Draft, Published, Retired
|
|
57
|
+
- Category filter
|
|
58
|
+
- Row type filter: Patient, Encounter, Observation, Enrollment, Appointment
|
|
59
|
+
- Sort: Last modified, Name, Created date
|
|
60
|
+
|
|
61
|
+
### Table columns
|
|
62
|
+
|
|
63
|
+
- Name
|
|
64
|
+
- Code
|
|
65
|
+
- Row type
|
|
66
|
+
- Category
|
|
67
|
+
- Data source
|
|
68
|
+
- Status
|
|
69
|
+
- Last modified
|
|
70
|
+
- Owner
|
|
71
|
+
- Overflow actions
|
|
72
|
+
|
|
73
|
+
### Overflow actions
|
|
74
|
+
|
|
75
|
+
- Edit
|
|
76
|
+
- Run
|
|
77
|
+
- Duplicate
|
|
78
|
+
- Export definition
|
|
79
|
+
- View revisions
|
|
80
|
+
- Retire/Delete, subject to status and permissions
|
|
81
|
+
|
|
82
|
+
### Empty and error states
|
|
83
|
+
|
|
84
|
+
- Show one primary create action, not duplicate buttons.
|
|
85
|
+
- Empty state is shown only when the request succeeds with zero records.
|
|
86
|
+
- A failed request shows an inline notification with `Retry` and the technical details in an expandable area.
|
|
87
|
+
- Do not show “No reports found” after a failed request.
|
|
88
|
+
|
|
89
|
+
## 5. Screen 2 — Create report dialog
|
|
90
|
+
|
|
91
|
+
Open a Carbon modal when the user selects `Create linelist report`.
|
|
92
|
+
|
|
93
|
+
### Fields
|
|
94
|
+
|
|
95
|
+
- Name — required
|
|
96
|
+
- Code — optional, unique when supplied
|
|
97
|
+
- Description
|
|
98
|
+
- Category — required
|
|
99
|
+
- Data theme — required
|
|
100
|
+
- Data source — required
|
|
101
|
+
- One row represents — required
|
|
102
|
+
- Patient
|
|
103
|
+
- Encounter
|
|
104
|
+
- Observation/Lab result
|
|
105
|
+
- Program enrollment
|
|
106
|
+
- Appointment
|
|
107
|
+
- Order
|
|
108
|
+
- Template — optional
|
|
109
|
+
- Blank report
|
|
110
|
+
- Appointment list
|
|
111
|
+
- Patient demographic list
|
|
112
|
+
- Missed appointment list
|
|
113
|
+
- Laboratory result list
|
|
114
|
+
|
|
115
|
+
### Actions
|
|
116
|
+
|
|
117
|
+
- Cancel
|
|
118
|
+
- Create and open builder
|
|
119
|
+
|
|
120
|
+
On create, save a minimal Draft definition and navigate to the builder.
|
|
121
|
+
|
|
122
|
+
## 6. Screen 3 — Builder workspace
|
|
123
|
+
|
|
124
|
+
Use a full-width, three-panel workspace below the existing global header.
|
|
125
|
+
|
|
126
|
+
### Page header
|
|
127
|
+
|
|
128
|
+
Left side:
|
|
129
|
+
|
|
130
|
+
- Breadcrumb: `Linelist reports / Appointment List`
|
|
131
|
+
- Editable report name
|
|
132
|
+
- Status tag: Draft, Published, Retired
|
|
133
|
+
- Unsaved changes indicator
|
|
134
|
+
|
|
135
|
+
Right side:
|
|
136
|
+
|
|
137
|
+
- `Save` secondary button
|
|
138
|
+
- `Preview` button
|
|
139
|
+
- `Publish` primary button
|
|
140
|
+
- Overflow: Save as, Export JSON, Import JSON, Validate, View history, Retire
|
|
141
|
+
|
|
142
|
+
### Workspace layout
|
|
143
|
+
|
|
144
|
+
Desktop width 1440 px and above:
|
|
145
|
+
|
|
146
|
+
- Left catalogue: 280 px, resizable
|
|
147
|
+
- Middle configuration: 400 px, resizable
|
|
148
|
+
- Right preview: remaining width, minimum 560 px
|
|
149
|
+
|
|
150
|
+
At smaller desktop widths, allow the catalogue and configuration panels to collapse. The builder is desktop-first; do not attempt to make full configuration usable on a phone.
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
154
|
+
│ Linelist reports / Appointment List Draft Save Preview Publish ⋮ │
|
|
155
|
+
├──────────────────┬──────────────────────────┬────────────────────────────────┤
|
|
156
|
+
│ DATA CATALOGUE │ QUERY CONFIGURATION │ PREVIEW │
|
|
157
|
+
│ │ │ │
|
|
158
|
+
│ Data theme │ Dataset │ 100 sample rows │
|
|
159
|
+
│ Search fields │ Population │ Query time: 1.2 s │
|
|
160
|
+
│ │ Columns │ │
|
|
161
|
+
│ Patient │ Filters │ Clinic No | Name | Sex | Age │
|
|
162
|
+
│ Demographics │ Sort │ ... │
|
|
163
|
+
│ Visits │ Parameters │ │
|
|
164
|
+
│ Observations │ Display & export │ │
|
|
165
|
+
│ Programs │ │ │
|
|
166
|
+
│ Laboratory │ │ │
|
|
167
|
+
└──────────────────┴──────────────────────────┴────────────────────────────────┘
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 7. Left panel — Data catalogue
|
|
171
|
+
|
|
172
|
+
### Top controls
|
|
173
|
+
|
|
174
|
+
- Data theme dropdown
|
|
175
|
+
- ETL source/dataset dropdown
|
|
176
|
+
- Search field catalogue
|
|
177
|
+
- Toggle: `Available` / `Selected`
|
|
178
|
+
|
|
179
|
+
### Field grouping
|
|
180
|
+
|
|
181
|
+
Use a Carbon Accordion for:
|
|
182
|
+
|
|
183
|
+
- Patient identifiers
|
|
184
|
+
- Demographics
|
|
185
|
+
- Addresses and contacts
|
|
186
|
+
- Encounters and visits
|
|
187
|
+
- Programs and enrollments
|
|
188
|
+
- Appointments
|
|
189
|
+
- Diagnoses
|
|
190
|
+
- Observations
|
|
191
|
+
- Laboratory results
|
|
192
|
+
- Medications and regimens
|
|
193
|
+
- Providers
|
|
194
|
+
- Locations
|
|
195
|
+
- Calculated fields
|
|
196
|
+
- Advanced SQL fields
|
|
197
|
+
|
|
198
|
+
### Field item
|
|
199
|
+
|
|
200
|
+
Each item displays:
|
|
201
|
+
|
|
202
|
+
- Field label
|
|
203
|
+
- Data type icon: Text, Number, Date, Coded, Boolean, Identifier
|
|
204
|
+
- Source badge: Core, ETL, Calculation, SQL
|
|
205
|
+
- Repeated-data badge when the field can have more than one value per row
|
|
206
|
+
- PII badge for identifiable fields
|
|
207
|
+
|
|
208
|
+
Actions:
|
|
209
|
+
|
|
210
|
+
- Add to columns
|
|
211
|
+
- Add to filters
|
|
212
|
+
- View field details
|
|
213
|
+
|
|
214
|
+
Support drag-and-drop, but always provide keyboard-accessible add buttons.
|
|
215
|
+
|
|
216
|
+
## 8. Middle panel — Query configuration
|
|
217
|
+
|
|
218
|
+
Use stacked, collapsible sections. A section header shows its item count and validation state.
|
|
219
|
+
|
|
220
|
+
### 8.1 Dataset
|
|
221
|
+
|
|
222
|
+
Display:
|
|
223
|
+
|
|
224
|
+
- Data theme
|
|
225
|
+
- Data source
|
|
226
|
+
- Row grain
|
|
227
|
+
- Primary row key
|
|
228
|
+
- Base location restriction
|
|
229
|
+
|
|
230
|
+
Allow changing the dataset only after confirmation because it can invalidate columns and filters.
|
|
231
|
+
|
|
232
|
+
### 8.2 Population
|
|
233
|
+
|
|
234
|
+
This defines which row entities qualify for the report. It maps to `baseCohortDefinition`.
|
|
235
|
+
|
|
236
|
+
Provide two modes:
|
|
237
|
+
|
|
238
|
+
1. Visual filter builder — default
|
|
239
|
+
2. SQL definition — advanced permission only
|
|
240
|
+
|
|
241
|
+
Visual filter groups support nested `AND` and `OR` conditions.
|
|
242
|
+
|
|
243
|
+
Example:
|
|
244
|
+
|
|
245
|
+
```text
|
|
246
|
+
ALL conditions
|
|
247
|
+
Appointment date is between [Start Date] and [End Date]
|
|
248
|
+
Voided equals No
|
|
249
|
+
Facility is [Location]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
A condition contains:
|
|
253
|
+
|
|
254
|
+
- Field
|
|
255
|
+
- Operator
|
|
256
|
+
- Value or parameter reference
|
|
257
|
+
- Optional value source
|
|
258
|
+
|
|
259
|
+
Supported operators depend on field type:
|
|
260
|
+
|
|
261
|
+
- Text: equals, not equals, contains, starts with, is blank
|
|
262
|
+
- Number: equals, greater than, less than, between
|
|
263
|
+
- Date: on, before, after, between, in previous period
|
|
264
|
+
- Coded: is one of, is not one of
|
|
265
|
+
- Boolean: yes, no, not recorded
|
|
266
|
+
- Location: equals, within hierarchy
|
|
267
|
+
|
|
268
|
+
### 8.3 Columns
|
|
269
|
+
|
|
270
|
+
Show selected columns as a sortable list.
|
|
271
|
+
|
|
272
|
+
Each row shows:
|
|
273
|
+
|
|
274
|
+
- Drag handle
|
|
275
|
+
- Display label
|
|
276
|
+
- Source field
|
|
277
|
+
- Data type
|
|
278
|
+
- Repeated-value rule
|
|
279
|
+
- Visibility
|
|
280
|
+
- Configuration action
|
|
281
|
+
- Remove action
|
|
282
|
+
|
|
283
|
+
Actions:
|
|
284
|
+
|
|
285
|
+
- Add calculated column
|
|
286
|
+
- Add SQL column, permission controlled
|
|
287
|
+
- Add all fields from a saved field set
|
|
288
|
+
|
|
289
|
+
### 8.4 Filters
|
|
290
|
+
|
|
291
|
+
Filters are user-configurable restrictions separate from the base population.
|
|
292
|
+
|
|
293
|
+
A filter can be:
|
|
294
|
+
|
|
295
|
+
- Fixed — always applied
|
|
296
|
+
- Runtime — shown to the user when the report is run
|
|
297
|
+
- Optional runtime — may be left blank
|
|
298
|
+
- Hidden/system — always applied and not editable when running
|
|
299
|
+
|
|
300
|
+
Example:
|
|
301
|
+
|
|
302
|
+
```text
|
|
303
|
+
Appointment date BETWEEN ${startDate} AND ${endDate} — Runtime
|
|
304
|
+
Voided EQUALS false — Hidden/system
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### 8.5 Sort
|
|
308
|
+
|
|
309
|
+
Support ordered multi-column sorting.
|
|
310
|
+
|
|
311
|
+
Each sort item contains:
|
|
312
|
+
|
|
313
|
+
- Column
|
|
314
|
+
- Ascending/Descending
|
|
315
|
+
- Nulls first/last
|
|
316
|
+
|
|
317
|
+
### 8.6 Parameters
|
|
318
|
+
|
|
319
|
+
Display the report parameters and their use count.
|
|
320
|
+
|
|
321
|
+
Fields:
|
|
322
|
+
|
|
323
|
+
- Name
|
|
324
|
+
- Label
|
|
325
|
+
- Type
|
|
326
|
+
- Required
|
|
327
|
+
- Default value
|
|
328
|
+
- Allowed values/value source
|
|
329
|
+
- Display order
|
|
330
|
+
|
|
331
|
+
Initial supported parameter types:
|
|
332
|
+
|
|
333
|
+
- DATE
|
|
334
|
+
- DATETIME
|
|
335
|
+
- LOCATION
|
|
336
|
+
- PROGRAM
|
|
337
|
+
- PROVIDER
|
|
338
|
+
- CONCEPT
|
|
339
|
+
- CODED_VALUE
|
|
340
|
+
- BOOLEAN
|
|
341
|
+
- NUMBER
|
|
342
|
+
- TEXT
|
|
343
|
+
|
|
344
|
+
### 8.7 Display and export
|
|
345
|
+
|
|
346
|
+
Controls:
|
|
347
|
+
|
|
348
|
+
- Default page size
|
|
349
|
+
- Freeze first column
|
|
350
|
+
- Freeze header
|
|
351
|
+
- Show record count
|
|
352
|
+
- Default visible columns
|
|
353
|
+
- Date display format
|
|
354
|
+
- Null display value
|
|
355
|
+
- Maximum interactive rows
|
|
356
|
+
- Maximum export rows
|
|
357
|
+
- Allowed exports: CSV, XLSX, PDF/print
|
|
358
|
+
- Include report parameters in export header
|
|
359
|
+
- Include generated timestamp
|
|
360
|
+
|
|
361
|
+
## 9. Column configuration side panel
|
|
362
|
+
|
|
363
|
+
Selecting a column opens a Carbon SidePanel.
|
|
364
|
+
|
|
365
|
+
### General
|
|
366
|
+
|
|
367
|
+
- Display label
|
|
368
|
+
- Internal name/ID
|
|
369
|
+
- Description
|
|
370
|
+
- Data type
|
|
371
|
+
- Visible by default
|
|
372
|
+
- Exportable
|
|
373
|
+
- PII classification
|
|
374
|
+
|
|
375
|
+
### Definition
|
|
376
|
+
|
|
377
|
+
The editor is selected from the column definition `type`.
|
|
378
|
+
|
|
379
|
+
Supported definition editors:
|
|
380
|
+
|
|
381
|
+
- IDENTIFIER
|
|
382
|
+
- PERSON_NAME
|
|
383
|
+
- PERSON_ATTRIBUTE
|
|
384
|
+
- PERSON_ADDRESS
|
|
385
|
+
- OBSERVATION
|
|
386
|
+
- PROGRAM_ATTRIBUTE
|
|
387
|
+
- ENCOUNTER_PROPERTY
|
|
388
|
+
- CALCULATION
|
|
389
|
+
- SQL
|
|
390
|
+
|
|
391
|
+
The UI must use a registry pattern:
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
const definitionEditors = {
|
|
395
|
+
IDENTIFIER: IdentifierDefinitionEditor,
|
|
396
|
+
PERSON_NAME: PersonNameDefinitionEditor,
|
|
397
|
+
PERSON_ATTRIBUTE: PersonAttributeDefinitionEditor,
|
|
398
|
+
PERSON_ADDRESS: PersonAddressDefinitionEditor,
|
|
399
|
+
CALCULATION: CalculationDefinitionEditor,
|
|
400
|
+
SQL: SqlDefinitionEditor,
|
|
401
|
+
};
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Repeated-value resolution
|
|
405
|
+
|
|
406
|
+
This section is required when a field can return multiple values for one row.
|
|
407
|
+
|
|
408
|
+
Options:
|
|
409
|
+
|
|
410
|
+
- Latest value
|
|
411
|
+
- Earliest value
|
|
412
|
+
- Highest value
|
|
413
|
+
- Lowest value
|
|
414
|
+
- Closest to report start date
|
|
415
|
+
- Closest to report end date
|
|
416
|
+
- First value within period
|
|
417
|
+
- Last value within period
|
|
418
|
+
- Concatenate values
|
|
419
|
+
- Return all values and change row grain
|
|
420
|
+
|
|
421
|
+
Additional controls:
|
|
422
|
+
|
|
423
|
+
- Date field used for ordering
|
|
424
|
+
- Restrict to reporting period
|
|
425
|
+
- Ignore voided records
|
|
426
|
+
- Tie-break field
|
|
427
|
+
|
|
428
|
+
The builder must not preview or publish a patient-grain report with an unresolved repeated field.
|
|
429
|
+
|
|
430
|
+
### Transformations
|
|
431
|
+
|
|
432
|
+
Allow an ordered transformation pipeline:
|
|
433
|
+
|
|
434
|
+
- Date format
|
|
435
|
+
- Age on date
|
|
436
|
+
- Coded value to display name
|
|
437
|
+
- Boolean mapping
|
|
438
|
+
- Replace null
|
|
439
|
+
- Numeric rounding
|
|
440
|
+
- Categorize numeric value
|
|
441
|
+
- Concatenate text
|
|
442
|
+
- Mask identifier
|
|
443
|
+
|
|
444
|
+
## 10. Right panel — Preview
|
|
445
|
+
|
|
446
|
+
### Preview toolbar
|
|
447
|
+
|
|
448
|
+
- Run preview
|
|
449
|
+
- Auto-preview toggle, off by default for expensive sources
|
|
450
|
+
- Sample size: 25, 50, 100, 500
|
|
451
|
+
- Refresh
|
|
452
|
+
- Full-screen table
|
|
453
|
+
- Export sample
|
|
454
|
+
- View generated query, advanced permission only
|
|
455
|
+
|
|
456
|
+
### Status area
|
|
457
|
+
|
|
458
|
+
Show:
|
|
459
|
+
|
|
460
|
+
- Matching row count, when available
|
|
461
|
+
- Preview row count
|
|
462
|
+
- Query duration
|
|
463
|
+
- Last preview time
|
|
464
|
+
- Warnings
|
|
465
|
+
|
|
466
|
+
### Table behavior
|
|
467
|
+
|
|
468
|
+
- Sticky header
|
|
469
|
+
- Horizontal scrolling
|
|
470
|
+
- Column resizing
|
|
471
|
+
- Sort preview locally only when clearly labelled
|
|
472
|
+
- Truncated cell values with tooltip
|
|
473
|
+
- PII masking according to permissions
|
|
474
|
+
- Empty, loading, error and partial-result states
|
|
475
|
+
|
|
476
|
+
### Query warnings
|
|
477
|
+
|
|
478
|
+
Examples:
|
|
479
|
+
|
|
480
|
+
- “This field can return multiple values per patient. Select a repeated-value rule.”
|
|
481
|
+
- “The current report may generate more than 100,000 rows.”
|
|
482
|
+
- “Three SQL columns may execute per patient. Consider an ETL join field.”
|
|
483
|
+
- “Location is not applied. Users may retrieve records from all permitted facilities.”
|
|
484
|
+
|
|
485
|
+
## 11. Run report screen
|
|
486
|
+
|
|
487
|
+
The run screen should reuse the existing report filter area but generate controls from the saved parameter definitions.
|
|
488
|
+
|
|
489
|
+
### Header
|
|
490
|
+
|
|
491
|
+
- Report name
|
|
492
|
+
- Description
|
|
493
|
+
- Status
|
|
494
|
+
- Last published version
|
|
495
|
+
|
|
496
|
+
### Runtime filters
|
|
497
|
+
|
|
498
|
+
Generate controls in parameter order. Provide:
|
|
499
|
+
|
|
500
|
+
- Run report
|
|
501
|
+
- Reset
|
|
502
|
+
- Save parameter preset
|
|
503
|
+
|
|
504
|
+
### Results
|
|
505
|
+
|
|
506
|
+
- Record count
|
|
507
|
+
- Parameters summary
|
|
508
|
+
- Generated timestamp
|
|
509
|
+
- Data table
|
|
510
|
+
- Pagination/server-side page loading
|
|
511
|
+
- Export actions
|
|
512
|
+
|
|
513
|
+
For very large exports, create an asynchronous export job and notify the user when the file is ready.
|
|
514
|
+
|
|
515
|
+
## 12. Mapping to the current JSON definition
|
|
516
|
+
|
|
517
|
+
The builder should initially produce the current JSON structure to preserve compatibility.
|
|
518
|
+
|
|
519
|
+
| Builder concept | Current JSON property |
|
|
520
|
+
|---|---|
|
|
521
|
+
| Report metadata | `name`, `description`, `uuid`, `version`, `status`, `category`, `reportType` |
|
|
522
|
+
| Runtime inputs | `parameters[]` |
|
|
523
|
+
| Population | `baseCohortDefinition` |
|
|
524
|
+
| Dataset | `dataSetDefinitions[]` |
|
|
525
|
+
| Row grain | `dataSetDefinitions[].type` |
|
|
526
|
+
| Dataset population | `dataSetDefinitions[].rowFilter` |
|
|
527
|
+
| Columns | `dataSetDefinitions[].columns[]` |
|
|
528
|
+
| Column source | `columns[].dataDefinition` |
|
|
529
|
+
| Column transformation | `columns[].converter` |
|
|
530
|
+
|
|
531
|
+
Use the existing `type + config` pattern throughout. It allows the frontend to load an editor dynamically for every definition type.
|
|
532
|
+
|
|
533
|
+
### Compatibility requirements
|
|
534
|
+
|
|
535
|
+
- Import an existing definition and open it in the builder.
|
|
536
|
+
- Export the saved definition as JSON.
|
|
537
|
+
- Preserve unknown properties during edit/save so newer backend fields are not silently deleted.
|
|
538
|
+
- When a definition is SQL-based, show it as an advanced field rather than attempting an unreliable visual conversion.
|
|
539
|
+
- Allow the visual builder to generate SQL-backed output where needed without exposing SQL to ordinary users.
|
|
540
|
+
|
|
541
|
+
## 13. Recommended schema extensions
|
|
542
|
+
|
|
543
|
+
Add stable IDs and UI metadata without removing existing fields.
|
|
544
|
+
|
|
545
|
+
```json
|
|
546
|
+
{
|
|
547
|
+
"name": "Appointment Date",
|
|
548
|
+
"id": "appointmentDate",
|
|
549
|
+
"dataDefinition": {
|
|
550
|
+
"type": "SQL",
|
|
551
|
+
"config": {
|
|
552
|
+
"sql": "SELECT ..."
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
"repeatResolution": {
|
|
556
|
+
"strategy": "LATEST",
|
|
557
|
+
"orderBy": "return_visit_date"
|
|
558
|
+
},
|
|
559
|
+
"display": {
|
|
560
|
+
"format": "dd MMM yyyy",
|
|
561
|
+
"visible": true,
|
|
562
|
+
"exportable": true
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
Normalize parameter references in new visual definitions:
|
|
568
|
+
|
|
569
|
+
```json
|
|
570
|
+
{
|
|
571
|
+
"type": "PARAMETER_REFERENCE",
|
|
572
|
+
"config": {
|
|
573
|
+
"parameter": "startDate"
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
The backend adapter may translate this to `${startDate}` or `:startDate` as required by the target definition.
|
|
579
|
+
|
|
580
|
+
## 14. Backend/API requirements
|
|
581
|
+
|
|
582
|
+
### Report definitions
|
|
583
|
+
|
|
584
|
+
- `GET /reportdefinition?reportType=LINELIST`
|
|
585
|
+
- `POST /reportdefinition`
|
|
586
|
+
- `GET /reportdefinition/{uuid}`
|
|
587
|
+
- `PUT /reportdefinition/{uuid}`
|
|
588
|
+
- `POST /reportdefinition/{uuid}/publish`
|
|
589
|
+
- `POST /reportdefinition/{uuid}/duplicate`
|
|
590
|
+
- `GET /reportdefinition/{uuid}/revisions`
|
|
591
|
+
|
|
592
|
+
### Builder metadata
|
|
593
|
+
|
|
594
|
+
- `GET /linelist/row-grains`
|
|
595
|
+
- `GET /linelist/data-themes`
|
|
596
|
+
- `GET /linelist/data-sources?theme={uuid}`
|
|
597
|
+
- `GET /linelist/fields?source={uuid}&rowGrain=PATIENT`
|
|
598
|
+
- `GET /linelist/definition-types`
|
|
599
|
+
- `GET /linelist/operators?dataType=DATE`
|
|
600
|
+
- `GET /linelist/transformations?dataType=DATE`
|
|
601
|
+
|
|
602
|
+
### Validation and preview
|
|
603
|
+
|
|
604
|
+
- `POST /linelist/validate`
|
|
605
|
+
- `POST /linelist/preview`
|
|
606
|
+
- `POST /linelist/count`
|
|
607
|
+
- `POST /linelist/run`
|
|
608
|
+
- `POST /linelist/export`
|
|
609
|
+
|
|
610
|
+
Preview request should accept an unsaved definition, parameters and row limit.
|
|
611
|
+
|
|
612
|
+
### Error contract
|
|
613
|
+
|
|
614
|
+
Return structured errors:
|
|
615
|
+
|
|
616
|
+
```json
|
|
617
|
+
{
|
|
618
|
+
"code": "UNRESOLVED_REPEAT",
|
|
619
|
+
"message": "Appointment Date can return multiple values per patient.",
|
|
620
|
+
"path": "dataSetDefinitions[0].columns[5]",
|
|
621
|
+
"suggestedAction": "Choose Latest, Earliest or All values."
|
|
622
|
+
}
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
## 15. Query execution architecture
|
|
626
|
+
|
|
627
|
+
Use a query-plan/compiler layer rather than executing one query for each patient and each SQL column.
|
|
628
|
+
|
|
629
|
+
### Required pipeline
|
|
630
|
+
|
|
631
|
+
1. Parse and validate report definition.
|
|
632
|
+
2. Resolve parameters.
|
|
633
|
+
3. Determine row grain and primary dataset.
|
|
634
|
+
4. Compile population filters.
|
|
635
|
+
5. Resolve each field into a projection or join.
|
|
636
|
+
6. Apply repeated-value strategies using window functions, grouped subqueries or ETL views.
|
|
637
|
+
7. Apply location and permission restrictions.
|
|
638
|
+
8. Execute one main paginated query where possible.
|
|
639
|
+
9. Format and mask results.
|
|
640
|
+
|
|
641
|
+
### Performance guardrails
|
|
642
|
+
|
|
643
|
+
- Detect per-patient SQL columns and warn or reject above a configured row threshold.
|
|
644
|
+
- Prefer joins to ETL fact/dimension tables.
|
|
645
|
+
- Use server-side pagination.
|
|
646
|
+
- Apply a preview timeout.
|
|
647
|
+
- Limit preview rows.
|
|
648
|
+
- Cache catalogue metadata, not patient result data.
|
|
649
|
+
- Never send all matching rows to the browser for client-side pagination.
|
|
650
|
+
|
|
651
|
+
## 16. Security requirements
|
|
652
|
+
|
|
653
|
+
- Validate all SQL definitions on the server.
|
|
654
|
+
- Parameterize values; do not concatenate user values into SQL.
|
|
655
|
+
- Enforce location access in the query plan.
|
|
656
|
+
- Restrict advanced SQL to a dedicated privilege.
|
|
657
|
+
- Classify fields as PII, sensitive clinical data or non-sensitive.
|
|
658
|
+
- Enforce display and export privileges separately.
|
|
659
|
+
- Record audit events for create, edit, publish, run and export.
|
|
660
|
+
- Mask or omit restricted columns in preview and output.
|
|
661
|
+
|
|
662
|
+
## 17. Frontend implementation notes
|
|
663
|
+
|
|
664
|
+
Recommended stack:
|
|
665
|
+
|
|
666
|
+
- React
|
|
667
|
+
- TypeScript
|
|
668
|
+
- IBM Carbon Design System
|
|
669
|
+
- React Query for server state
|
|
670
|
+
- React Hook Form for configuration forms
|
|
671
|
+
- Zod or equivalent for client-side schema validation
|
|
672
|
+
- Accessible drag-and-drop library, with non-drag alternatives
|
|
673
|
+
|
|
674
|
+
Suggested feature structure:
|
|
675
|
+
|
|
676
|
+
```text
|
|
677
|
+
features/linelist-reports/
|
|
678
|
+
api/
|
|
679
|
+
components/
|
|
680
|
+
ReportList/
|
|
681
|
+
CreateReportModal/
|
|
682
|
+
BuilderShell/
|
|
683
|
+
DataCatalogue/
|
|
684
|
+
QueryConfiguration/
|
|
685
|
+
PopulationBuilder/
|
|
686
|
+
ColumnShelf/
|
|
687
|
+
ColumnEditor/
|
|
688
|
+
FilterBuilder/
|
|
689
|
+
ParameterEditor/
|
|
690
|
+
PreviewTable/
|
|
691
|
+
definition-editors/
|
|
692
|
+
transformation-editors/
|
|
693
|
+
hooks/
|
|
694
|
+
schemas/
|
|
695
|
+
state/
|
|
696
|
+
routes/
|
|
697
|
+
utils/
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
Keep the report definition as the canonical builder state. Avoid maintaining a second unrelated UI-only query model. Use adapters only for temporary form state and server compatibility.
|
|
701
|
+
|
|
702
|
+
## 18. Validation rules
|
|
703
|
+
|
|
704
|
+
A report cannot be published unless:
|
|
705
|
+
|
|
706
|
+
- Name, category, data source and row grain are present.
|
|
707
|
+
- At least one column exists.
|
|
708
|
+
- Every referenced parameter exists.
|
|
709
|
+
- Every required parameter has a valid type.
|
|
710
|
+
- Repeated fields have an explicit resolution strategy.
|
|
711
|
+
- The base population is valid.
|
|
712
|
+
- Column internal IDs are unique.
|
|
713
|
+
- Sort references valid columns.
|
|
714
|
+
- SQL definitions pass server validation.
|
|
715
|
+
- The user has permission to publish all selected fields.
|
|
716
|
+
- A preview or validation request has succeeded against the current saved revision.
|
|
717
|
+
|
|
718
|
+
Drafts may be saved with validation errors.
|
|
719
|
+
|
|
720
|
+
## 19. Minimum viable release
|
|
721
|
+
|
|
722
|
+
### Phase 1
|
|
723
|
+
|
|
724
|
+
- Linelist report list
|
|
725
|
+
- Create report modal
|
|
726
|
+
- Patient row grain
|
|
727
|
+
- Data catalogue
|
|
728
|
+
- Columns
|
|
729
|
+
- Base population filters
|
|
730
|
+
- Date and location parameters
|
|
731
|
+
- Sort
|
|
732
|
+
- Preview 100 rows
|
|
733
|
+
- Save Draft
|
|
734
|
+
- Publish
|
|
735
|
+
- Run and CSV export
|
|
736
|
+
- Import and export current JSON
|
|
737
|
+
- Support existing definition types used by Appointment List
|
|
738
|
+
|
|
739
|
+
### Phase 2
|
|
740
|
+
|
|
741
|
+
- Encounter, observation, enrollment and appointment row grains
|
|
742
|
+
- Nested filter groups
|
|
743
|
+
- Repeated-value strategies
|
|
744
|
+
- Calculated columns
|
|
745
|
+
- XLSX export
|
|
746
|
+
- Revisions and duplication
|
|
747
|
+
- Templates
|
|
748
|
+
|
|
749
|
+
### Phase 3
|
|
750
|
+
|
|
751
|
+
- Visual joins
|
|
752
|
+
- Saved field sets
|
|
753
|
+
- Asynchronous large exports
|
|
754
|
+
- Query cost estimation
|
|
755
|
+
- AI-assisted field and filter suggestions
|
|
756
|
+
|
|
757
|
+
## 20. Acceptance criteria for the Appointment List example
|
|
758
|
+
|
|
759
|
+
The implementation is acceptable when a user can visually create a report equivalent to the Appointment List definition with:
|
|
760
|
+
|
|
761
|
+
- Start Date, End Date and Location parameters
|
|
762
|
+
- Patient row grain
|
|
763
|
+
- Appointment population restricted to the date range
|
|
764
|
+
- Clinic No
|
|
765
|
+
- Patient Name
|
|
766
|
+
- Sex
|
|
767
|
+
- Birth Date
|
|
768
|
+
- Age calculated on Start Date
|
|
769
|
+
- Latest Appointment Date in the range
|
|
770
|
+
- Latest Appointment Fulfillment in the range
|
|
771
|
+
- Current Regimen
|
|
772
|
+
- Telephone
|
|
773
|
+
- Village
|
|
774
|
+
- Draft and Published states
|
|
775
|
+
- Preview and CSV export
|
|
776
|
+
|
|
777
|
+
The saved JSON must be accepted by the existing report backend or by a compatibility adapter without manual editing.
|
|
778
|
+
|
|
779
|
+
---
|
|
780
|
+
|
|
781
|
+
# Copy-paste implementation prompt for a coding agent
|
|
782
|
+
|
|
783
|
+
Implement a Superset-inspired linelist report builder inside the existing OpenMRS report-builder frontend. Preserve the current aggregate-report workflow and add the builder under the existing `Linelist Reports` route.
|
|
784
|
+
|
|
785
|
+
Use React, TypeScript and IBM Carbon components. Build these screens:
|
|
786
|
+
|
|
787
|
+
1. A linelist report list with search, status/category/row-type filters, a single create action, correct empty/error states and row overflow actions.
|
|
788
|
+
2. A create-report modal that captures name, description, category, data theme, data source, row grain and optional template.
|
|
789
|
+
3. A three-panel builder workspace:
|
|
790
|
+
- Left: searchable field catalogue grouped by clinical domain.
|
|
791
|
+
- Middle: Dataset, Population, Columns, Filters, Sort, Parameters and Display/Export sections.
|
|
792
|
+
- Right: paginated sample preview with status, warnings and errors.
|
|
793
|
+
4. A run-report screen that generates runtime controls from `parameters[]` and displays paginated records with export actions.
|
|
794
|
+
|
|
795
|
+
Use the report JSON as the canonical state and preserve the existing schema:
|
|
796
|
+
|
|
797
|
+
- metadata fields at the root
|
|
798
|
+
- `parameters[]`
|
|
799
|
+
- `baseCohortDefinition`
|
|
800
|
+
- `dataSetDefinitions[]`
|
|
801
|
+
- `columns[].dataDefinition`
|
|
802
|
+
- optional `columns[].converter`
|
|
803
|
+
|
|
804
|
+
Implement a registry-based editor for typed definitions using the common `{ type, config }` pattern. Support at minimum `IDENTIFIER`, `PERSON_NAME`, `PERSON_ATTRIBUTE`, `PERSON_ADDRESS`, `CALCULATION` and `SQL`.
|
|
805
|
+
|
|
806
|
+
For every field that can return more than one value for the selected row grain, require a repeat-resolution strategy such as Latest, Earliest, Highest, Lowest, Within period, Concatenate or Return all/change row grain. Prevent publication while a repeated field is unresolved.
|
|
807
|
+
|
|
808
|
+
Provide visual filters with field-specific operators and nested AND/OR groups. Allow filters to be Fixed, Runtime, Optional Runtime or Hidden/System. Generate parameter controls for DATE, LOCATION, TEXT, NUMBER, BOOLEAN, CODED_VALUE, PROGRAM and PROVIDER.
|
|
809
|
+
|
|
810
|
+
Implement preview against an unsaved definition. Preview must use server-side pagination and a row limit. Do not execute one SQL query per patient per column. Add validation and warnings for N+1 SQL definitions, missing parameters, invalid column references, unrestricted location scope and excessive estimated row counts.
|
|
811
|
+
|
|
812
|
+
Preserve unknown JSON properties when loading and saving. Existing SQL-based definitions must remain editable in an advanced SQL editor rather than being incorrectly converted into visual filters. Add import/export JSON actions.
|
|
813
|
+
|
|
814
|
+
Use Carbon SidePanel for column configuration, DataTable for preview and list screens, Accordion for field groups, Search, ComboBox/Dropdown, Tag, InlineNotification, Modal, Tabs, Pagination, OverflowMenu and Button components. All drag-and-drop interactions must have keyboard-accessible add/reorder alternatives.
|
|
815
|
+
|
|
816
|
+
Deliver the implementation in phases. Phase 1 must support creation of the existing Appointment List report, including Start Date, End Date, Location, patient row grain, demographic columns, calculated Age, appointment date/fulfillment, current regimen, telephone and village, plus Draft, Publish, Preview, Run and CSV export.
|