@openmrs/esm-report-builder 0.1.1-pre.101
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/128.css +1 -0
- package/dist/128.css.map +1 -0
- package/dist/128.js +338 -0
- package/dist/128.js.map +1 -0
- package/dist/1480.js +1 -0
- package/dist/1480.js.map +1 -0
- package/dist/1646.js +1 -0
- package/dist/1646.js.map +1 -0
- package/dist/1869.js +1 -0
- package/dist/1869.js.map +1 -0
- package/dist/1877.js +1 -0
- package/dist/1877.js.map +1 -0
- package/dist/2131.js +1 -0
- package/dist/2131.js.map +1 -0
- package/dist/2317.js +1 -0
- package/dist/2317.js.map +1 -0
- package/dist/2408.js +1 -0
- package/dist/2408.js.map +1 -0
- package/dist/2416.js +1 -0
- package/dist/2416.js.map +1 -0
- package/dist/282.js +1 -0
- package/dist/282.js.map +1 -0
- package/dist/2881.js +1 -0
- package/dist/2881.js.map +1 -0
- package/dist/2997.js +1 -0
- package/dist/2997.js.map +1 -0
- package/dist/3378.js +1 -0
- package/dist/3378.js.map +1 -0
- package/dist/3963.js +1 -0
- package/dist/3963.js.map +1 -0
- package/dist/4106.js +1 -0
- package/dist/4106.js.map +1 -0
- package/dist/4111.js +1 -0
- package/dist/4111.js.map +1 -0
- package/dist/4171.css +1 -0
- package/dist/4171.css.map +1 -0
- package/dist/4171.js +43 -0
- package/dist/4171.js.map +1 -0
- package/dist/434.js +1 -0
- package/dist/434.js.map +1 -0
- package/dist/4348.js +1 -0
- package/dist/4348.js.map +1 -0
- package/dist/4383.js +1 -0
- package/dist/4383.js.map +1 -0
- package/dist/4658.js +1 -0
- package/dist/4658.js.map +1 -0
- package/dist/4668.js +1 -0
- package/dist/4668.js.map +1 -0
- package/dist/4928.js +1 -0
- package/dist/4928.js.map +1 -0
- package/dist/5098.js +1 -0
- package/dist/5098.js.map +1 -0
- package/dist/5117.js +1 -0
- package/dist/5117.js.map +1 -0
- package/dist/5132.js +1 -0
- package/dist/5132.js.map +1 -0
- package/dist/5145.js +1 -0
- package/dist/5145.js.map +1 -0
- package/dist/550.js +1 -0
- package/dist/550.js.map +1 -0
- package/dist/5503.js +1 -0
- package/dist/5503.js.map +1 -0
- package/dist/556.js +1 -0
- package/dist/556.js.map +1 -0
- package/dist/5644.js +1 -0
- package/dist/5644.js.map +1 -0
- package/dist/5940.js +1 -0
- package/dist/5940.js.map +1 -0
- package/dist/6047.js +1 -0
- package/dist/6047.js.map +1 -0
- package/dist/6237.js +1 -0
- package/dist/6237.js.map +1 -0
- package/dist/6371.js +1 -0
- package/dist/6371.js.map +1 -0
- package/dist/6377.js +1 -0
- package/dist/6377.js.map +1 -0
- package/dist/6444.js +1 -0
- package/dist/6444.js.map +1 -0
- package/dist/6508.js +1 -0
- package/dist/6508.js.map +1 -0
- package/dist/6652.js +1 -0
- package/dist/6652.js.map +1 -0
- package/dist/6686.js +1 -0
- package/dist/6686.js.map +1 -0
- package/dist/6724.js +1 -0
- package/dist/6724.js.map +1 -0
- package/dist/6867.js +19 -0
- package/dist/6867.js.map +1 -0
- package/dist/6904.js +1 -0
- package/dist/6904.js.map +1 -0
- package/dist/7045.js +1 -0
- package/dist/7045.js.map +1 -0
- package/dist/7175.js +1 -0
- package/dist/7175.js.map +1 -0
- package/dist/7182.js +1 -0
- package/dist/7182.js.map +1 -0
- package/dist/7475.js +1 -0
- package/dist/7475.js.map +1 -0
- package/dist/7742.js +1 -0
- package/dist/7742.js.map +1 -0
- package/dist/7912.js +1 -0
- package/dist/7912.js.map +1 -0
- package/dist/8251.js +1 -0
- package/dist/8251.js.map +1 -0
- package/dist/8358.js +1 -0
- package/dist/8358.js.map +1 -0
- package/dist/8359.js +1 -0
- package/dist/8359.js.map +1 -0
- package/dist/8695.js +1 -0
- package/dist/8695.js.map +1 -0
- package/dist/903.js +1 -0
- package/dist/903.js.map +1 -0
- package/dist/9072.js +1 -0
- package/dist/9072.js.map +1 -0
- package/dist/9806.js +1 -0
- package/dist/9806.js.map +1 -0
- package/dist/997.js +1 -0
- package/dist/997.js.map +1 -0
- package/dist/openmrs-esm-report-builder.js +3 -0
- package/dist/openmrs-esm-report-builder.js.buildmanifest.json +1433 -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 +35 -0
- package/e2e/pages/etl-sources.page.ts +36 -0
- package/e2e/pages/report-sections.page.ts +21 -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 +32 -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 +6 -0
- package/e2e/tsconfig.json +11 -0
- package/example.env +5 -0
- package/linelist_report_builder_design_spec.md +816 -0
- package/package.json +98 -0
- package/playwright.config.ts +28 -0
- package/rspack.config.js +2 -0
- package/src/__debug__/all-designs.test.tsx +33 -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 +448 -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 +985 -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 +324 -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 +341 -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 +64 -0
- package/src/components/security/access-denied-page.scss +39 -0
- package/src/components/security/privilege-route.component.test.tsx +76 -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 +151 -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 +54 -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 +286 -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 +9 -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 +92 -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 +31 -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 +147 -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 +151 -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 +240 -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/i18next-parser.config.js +0 -0
- package/tools/setup-tests.ts +1 -0
- package/tools/update-openmrs-deps.mjs +42 -0
- package/translations/am.json +65 -0
- package/translations/ar.json +65 -0
- package/translations/ar_SY.json +65 -0
- package/translations/bn.json +65 -0
- package/translations/cs.json +65 -0
- package/translations/de.json +65 -0
- package/translations/en.json +65 -0
- package/translations/en_US.json +65 -0
- package/translations/es.json +65 -0
- package/translations/es_MX.json +65 -0
- package/translations/fr.json +65 -0
- package/translations/he.json +65 -0
- package/translations/hi.json +65 -0
- package/translations/hi_IN.json +65 -0
- package/translations/id.json +65 -0
- package/translations/it.json +65 -0
- package/translations/ka.json +65 -0
- package/translations/km.json +65 -0
- package/translations/ku.json +65 -0
- package/translations/ky.json +65 -0
- package/translations/lg.json +65 -0
- package/translations/ne.json +65 -0
- package/translations/pl.json +65 -0
- package/translations/pt.json +65 -0
- package/translations/pt_BR.json +65 -0
- package/translations/qu.json +65 -0
- package/translations/ro_RO.json +65 -0
- package/translations/ru_RU.json +65 -0
- package/translations/si.json +65 -0
- package/translations/sq.json +65 -0
- package/translations/sw.json +65 -0
- package/translations/sw_KE.json +65 -0
- package/translations/tr.json +65 -0
- package/translations/tr_TR.json +65 -0
- package/translations/uk.json +65 -0
- package/translations/uz.json +65 -0
- package/translations/uz@Latn.json +65 -0
- package/translations/uz_UZ.json +65 -0
- package/translations/vi.json +65 -0
- package/translations/zh.json +65 -0
- package/translations/zh_CN.json +65 -0
- package/translations/zh_TW.json +65 -0
- package/tsconfig.json +24 -0
- package/vitest.config.mts +42 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
.column-selector-container {
|
|
2
|
+
padding: 1rem 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.column-selector-error {
|
|
6
|
+
margin-bottom: 1rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.column-selector-table-selector {
|
|
10
|
+
padding: 1rem;
|
|
11
|
+
border: 1px solid #e0e0e0;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
margin-bottom: 1.5rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.column-selector-section-title {
|
|
17
|
+
margin-bottom: 1rem;
|
|
18
|
+
font-size: 1rem;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.column-selector-column-list {
|
|
23
|
+
margin-top: 1rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.column-selector-helper-text {
|
|
27
|
+
font-size: 0.875rem;
|
|
28
|
+
color: #525252;
|
|
29
|
+
margin-bottom: 0.5rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.column-selector-chips {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
gap: 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.column-selector-chips button {
|
|
39
|
+
margin-right: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.column-selector-column-type {
|
|
43
|
+
font-size: 0.75rem;
|
|
44
|
+
color: #525252;
|
|
45
|
+
margin-left: 0.25rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.column-selector-empty-state {
|
|
49
|
+
text-align: center;
|
|
50
|
+
padding: 2rem;
|
|
51
|
+
color: #525252;
|
|
52
|
+
font-size: 0.875rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.column-selector-sql-templates {
|
|
56
|
+
padding: 1rem;
|
|
57
|
+
border: 1px solid #e0e0e0;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
margin-bottom: 1.5rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.column-selector-template-label {
|
|
63
|
+
font-size: 0.875rem;
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
margin-bottom: 0.5rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.column-selector-template-buttons {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-wrap: wrap;
|
|
71
|
+
gap: 0.5rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.column-selector-table {
|
|
75
|
+
margin-top: 1.5rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.column-selector-order-cell {
|
|
79
|
+
width: 50px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.column-selector-actions-cell {
|
|
85
|
+
width: 200px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.column-selector-expanded-row {
|
|
89
|
+
background-color: #f4f4f4;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.column-selector-expanded-content {
|
|
93
|
+
padding: 1rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.transformationSection {
|
|
97
|
+
margin-top: 1rem;
|
|
98
|
+
padding-top: 1rem;
|
|
99
|
+
border-top: 1px solid #e0e0e0;
|
|
100
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom SQL Column Modal
|
|
3
|
+
*
|
|
4
|
+
* Lets users add a custom column backed by a SQL expression.
|
|
5
|
+
* The SQL runs per-row and can reference the patient/client ID via
|
|
6
|
+
* the :patient_id or :patient_id bind parameter.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React, { useState, useEffect } from 'react';
|
|
10
|
+
import {
|
|
11
|
+
Modal,
|
|
12
|
+
Stack,
|
|
13
|
+
TextInput,
|
|
14
|
+
TextArea,
|
|
15
|
+
InlineNotification,
|
|
16
|
+
Button,
|
|
17
|
+
Toggle,
|
|
18
|
+
CodeSnippet,
|
|
19
|
+
} from '@carbon/react';
|
|
20
|
+
|
|
21
|
+
export type CustomSqlColumnConfig = {
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
sql: string;
|
|
25
|
+
repeatResolution?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type Props = {
|
|
29
|
+
open: boolean;
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
onSave: (config: CustomSqlColumnConfig) => void;
|
|
32
|
+
/** Existing column names, used to prevent duplicates */
|
|
33
|
+
existingColumnNames?: string[];
|
|
34
|
+
/** The patient/client ID column alias used by the base cohort SQL */
|
|
35
|
+
idColumnAlias?: 'patient_id' | 'patient_id';
|
|
36
|
+
/** Name of the current primary datasource (for display) */
|
|
37
|
+
primaryDatasourceName?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const EXAMPLES = [
|
|
41
|
+
{
|
|
42
|
+
label: 'Last visit date',
|
|
43
|
+
sql: 'SELECT MAX(encounter_datetime) FROM encounter WHERE patient_id = :patient_id',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'Latest CD4 count',
|
|
47
|
+
sql: "SELECT value_numeric FROM obs WHERE patient_id = :patient_id AND concept_id = 5497 ORDER BY obs_datetime DESC LIMIT 1",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: 'Current ART regimen',
|
|
51
|
+
sql: "SELECT value_text FROM obs WHERE patient_id = :patient_id AND concept_id = 1085 ORDER BY obs_datetime DESC LIMIT 1",
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const CustomSqlColumnModal: React.FC<Props> = ({
|
|
56
|
+
open,
|
|
57
|
+
onClose,
|
|
58
|
+
onSave,
|
|
59
|
+
existingColumnNames = [],
|
|
60
|
+
idColumnAlias = 'patient_id',
|
|
61
|
+
primaryDatasourceName = '',
|
|
62
|
+
}) => {
|
|
63
|
+
const [name, setName] = useState('');
|
|
64
|
+
const [description, setDescription] = useState('');
|
|
65
|
+
const [sql, setSql] = useState('');
|
|
66
|
+
const [useRepeatResolution, setUseRepeatResolution] = useState(false);
|
|
67
|
+
const [error, setError] = useState<string | null>(null);
|
|
68
|
+
|
|
69
|
+
// Reset state when modal opens
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (open) {
|
|
72
|
+
setName('');
|
|
73
|
+
setDescription('');
|
|
74
|
+
setSql('');
|
|
75
|
+
setUseRepeatResolution(false);
|
|
76
|
+
setError(null);
|
|
77
|
+
}
|
|
78
|
+
}, [open]);
|
|
79
|
+
|
|
80
|
+
const handleSave = () => {
|
|
81
|
+
// Validate name
|
|
82
|
+
if (!name.trim()) {
|
|
83
|
+
setError('Column name is required');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Check for duplicate name
|
|
88
|
+
if (existingColumnNames.some((n) => n.toLowerCase() === name.trim().toLowerCase())) {
|
|
89
|
+
setError('A column with this name already exists');
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Validate SQL
|
|
94
|
+
if (!sql.trim()) {
|
|
95
|
+
setError('SQL expression is required');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Warn (but allow) if SQL doesn't reference the patient/client ID
|
|
100
|
+
const paramPattern = /:(patient_id|patient_id|clientId|patientId)\b/i;
|
|
101
|
+
if (!paramPattern.test(sql)) {
|
|
102
|
+
setError(
|
|
103
|
+
`SQL should reference :${idColumnAlias} to return a value per patient. ` +
|
|
104
|
+
'Add it to your WHERE clause.'
|
|
105
|
+
);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
onSave({
|
|
110
|
+
name: name.trim(),
|
|
111
|
+
description: description.trim() || undefined,
|
|
112
|
+
sql: sql.trim(),
|
|
113
|
+
repeatResolution: useRepeatResolution,
|
|
114
|
+
});
|
|
115
|
+
onClose();
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<Modal
|
|
120
|
+
open={open}
|
|
121
|
+
onRequestClose={onClose}
|
|
122
|
+
onRequestSubmit={handleSave}
|
|
123
|
+
modalHeading="Add Custom SQL Column"
|
|
124
|
+
modalLabel="Custom Column"
|
|
125
|
+
primaryButtonText="Add Column"
|
|
126
|
+
secondaryButtonText="Cancel"
|
|
127
|
+
size="lg"
|
|
128
|
+
preventCloseOnClickOutside
|
|
129
|
+
>
|
|
130
|
+
<Stack gap={5}>
|
|
131
|
+
<p>
|
|
132
|
+
Write a SQL expression that returns a single value for each patient. Use{' '}
|
|
133
|
+
<code>:{idColumnAlias}</code> as a bind parameter — it will be replaced with the
|
|
134
|
+
patient/client ID for each row in the report.
|
|
135
|
+
</p>
|
|
136
|
+
|
|
137
|
+
{/* Datasource Info */}
|
|
138
|
+
{primaryDatasourceName && (
|
|
139
|
+
<InlineNotification
|
|
140
|
+
kind="info"
|
|
141
|
+
title="About Data Sources"
|
|
142
|
+
subtitle={`This column will be associated with your primary datasource: "${primaryDatasourceName}". To use a different datasource, go to the Data Sources panel and set it as primary first.`}
|
|
143
|
+
lowContrast
|
|
144
|
+
/>
|
|
145
|
+
)}
|
|
146
|
+
{!primaryDatasourceName && (
|
|
147
|
+
<InlineNotification
|
|
148
|
+
kind="warning"
|
|
149
|
+
title="No Primary Data Source"
|
|
150
|
+
subtitle="Custom SQL columns need a primary datasource. Please select a datasource in the Data Sources panel before adding custom columns."
|
|
151
|
+
lowContrast
|
|
152
|
+
/>
|
|
153
|
+
)}
|
|
154
|
+
|
|
155
|
+
{error && (
|
|
156
|
+
<InlineNotification
|
|
157
|
+
kind="error"
|
|
158
|
+
title="Validation Error"
|
|
159
|
+
subtitle={error}
|
|
160
|
+
hideCloseButton
|
|
161
|
+
/>
|
|
162
|
+
)}
|
|
163
|
+
|
|
164
|
+
<TextInput
|
|
165
|
+
id="custom-column-name"
|
|
166
|
+
labelText="Column Name *"
|
|
167
|
+
placeholder="e.g., Last Visit Date"
|
|
168
|
+
value={name}
|
|
169
|
+
onChange={(e) => {
|
|
170
|
+
setName((e.target as HTMLInputElement).value);
|
|
171
|
+
setError(null);
|
|
172
|
+
}}
|
|
173
|
+
/>
|
|
174
|
+
|
|
175
|
+
<TextInput
|
|
176
|
+
id="custom-column-description"
|
|
177
|
+
labelText="Description (optional)"
|
|
178
|
+
placeholder="What this column represents"
|
|
179
|
+
value={description}
|
|
180
|
+
onChange={(e) => setDescription((e.target as HTMLInputElement).value)}
|
|
181
|
+
/>
|
|
182
|
+
|
|
183
|
+
<TextArea
|
|
184
|
+
id="custom-column-sql"
|
|
185
|
+
labelText="SQL Expression *"
|
|
186
|
+
placeholder={`SELECT ... FROM ... WHERE patient_id = :${idColumnAlias}`}
|
|
187
|
+
value={sql}
|
|
188
|
+
onChange={(e) => {
|
|
189
|
+
setSql((e.target as HTMLTextAreaElement).value);
|
|
190
|
+
setError(null);
|
|
191
|
+
}}
|
|
192
|
+
rows={6}
|
|
193
|
+
helperText={`The :${idColumnAlias} parameter is replaced with each patient's ID. The query must return a single value.`}
|
|
194
|
+
/>
|
|
195
|
+
|
|
196
|
+
<Toggle
|
|
197
|
+
id="custom-column-repeat"
|
|
198
|
+
labelText="May return multiple values (configure repeat resolution)"
|
|
199
|
+
labelA="No"
|
|
200
|
+
labelB="Yes"
|
|
201
|
+
toggled={useRepeatResolution}
|
|
202
|
+
onToggle={setUseRepeatResolution}
|
|
203
|
+
/>
|
|
204
|
+
|
|
205
|
+
{useRepeatResolution && (
|
|
206
|
+
<InlineNotification
|
|
207
|
+
kind="info"
|
|
208
|
+
title="Repeat Resolution"
|
|
209
|
+
subtitle="The most recent value (LATEST strategy) will be used by default. You can adjust this later in the column settings."
|
|
210
|
+
hideCloseButton
|
|
211
|
+
lowContrast
|
|
212
|
+
/>
|
|
213
|
+
)}
|
|
214
|
+
|
|
215
|
+
{/* Examples */}
|
|
216
|
+
<div>
|
|
217
|
+
<p style={{ fontWeight: 600, marginBottom: '0.5rem' }}>Examples (click to use):</p>
|
|
218
|
+
<Stack gap={2}>
|
|
219
|
+
{EXAMPLES.map((ex) => (
|
|
220
|
+
<Button
|
|
221
|
+
key={ex.label}
|
|
222
|
+
kind="ghost"
|
|
223
|
+
size="sm"
|
|
224
|
+
onClick={() => {
|
|
225
|
+
setSql(ex.sql);
|
|
226
|
+
if (!name) setName(ex.label);
|
|
227
|
+
setError(null);
|
|
228
|
+
}}
|
|
229
|
+
style={{ justifyContent: 'flex-start', textAlign: 'left' }}
|
|
230
|
+
>
|
|
231
|
+
{ex.label}
|
|
232
|
+
</Button>
|
|
233
|
+
))}
|
|
234
|
+
</Stack>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
{sql && (
|
|
238
|
+
<div>
|
|
239
|
+
<p style={{ fontWeight: 600, marginBottom: '0.25rem' }}>Your SQL:</p>
|
|
240
|
+
<CodeSnippet type="multi">{sql}</CodeSnippet>
|
|
241
|
+
</div>
|
|
242
|
+
)}
|
|
243
|
+
</Stack>
|
|
244
|
+
</Modal>
|
|
245
|
+
);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export default CustomSqlColumnModal;
|
package/src/components/linelist/definition/panels/encounter-diagnosis-column-modal.component.tsx
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encounter Diagnosis Column Modal Component
|
|
3
|
+
*
|
|
4
|
+
* Allows users to create encounter diagnosis-based columns using concept search
|
|
5
|
+
* Uses the same pattern as base indicator creation (Search + FilterableMultiSelect)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
9
|
+
import {
|
|
10
|
+
Modal,
|
|
11
|
+
TextInput,
|
|
12
|
+
Select,
|
|
13
|
+
SelectItem,
|
|
14
|
+
Toggle,
|
|
15
|
+
Stack,
|
|
16
|
+
FormGroup,
|
|
17
|
+
} from '@carbon/react';
|
|
18
|
+
import ConceptSelector from '../../../shared/concept-selector.component';
|
|
19
|
+
import type { ConceptSummary } from '../../../../resources/concepts/concept-types';
|
|
20
|
+
import type { LinelistColumnDraft } from '../../../../types/linelist-types';
|
|
21
|
+
import styles from './encounter-diagnosis-column-modal.scss';
|
|
22
|
+
|
|
23
|
+
type Props = {
|
|
24
|
+
/** Whether the modal is open */
|
|
25
|
+
open: boolean;
|
|
26
|
+
/** Callback when modal is closed */
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
/** Callback when a new column is created */
|
|
29
|
+
onAddColumn: (column: LinelistColumnDraft) => void;
|
|
30
|
+
/** Existing columns to check for duplicates */
|
|
31
|
+
existingColumns?: LinelistColumnDraft[];
|
|
32
|
+
/** Column to edit (if provided, modal is in edit mode) */
|
|
33
|
+
editingColumn?: LinelistColumnDraft | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type StrategyOption = 'ALL_VALUES' | 'LATEST' | 'FIRST_WITHIN_PERIOD' | 'LAST_WITHIN_PERIOD';
|
|
37
|
+
type RankOption = 'PRIMARY' | 'SECONDARY' | 'ANY';
|
|
38
|
+
|
|
39
|
+
const STRATEGY_OPTIONS: Array<{ value: StrategyOption; label: string; description: string }> = [
|
|
40
|
+
{ value: 'ALL_VALUES', label: 'All Values', description: 'Return all diagnoses as comma-separated list' },
|
|
41
|
+
{ value: 'LATEST', label: 'Latest', description: 'Most recent diagnosis' },
|
|
42
|
+
{ value: 'FIRST_WITHIN_PERIOD', label: 'First in Period', description: 'First diagnosis within reporting period' },
|
|
43
|
+
{ value: 'LAST_WITHIN_PERIOD', label: 'Last in Period', description: 'Last diagnosis within reporting period' },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const RANK_OPTIONS: Array<{ value: RankOption; label: string; description: string }> = [
|
|
47
|
+
{ value: 'PRIMARY', label: 'Primary Only', description: 'Only primary diagnoses' },
|
|
48
|
+
{ value: 'SECONDARY', label: 'Secondary Only', description: 'Only secondary diagnoses' },
|
|
49
|
+
{ value: 'ANY', label: 'Any', description: 'Both primary and secondary diagnoses' },
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const EncounterDiagnosisColumnModal: React.FC<Props> = ({
|
|
53
|
+
open,
|
|
54
|
+
onClose,
|
|
55
|
+
onAddColumn,
|
|
56
|
+
existingColumns = [],
|
|
57
|
+
editingColumn = null,
|
|
58
|
+
}) => {
|
|
59
|
+
const [conceptSelectorKey, setConceptSelectorKey] = useState(0);
|
|
60
|
+
const [selectedConcept, setSelectedConcept] = useState<ConceptSummary | undefined>();
|
|
61
|
+
const [columnName, setColumnName] = useState('');
|
|
62
|
+
const [strategy, setStrategy] = useState<StrategyOption>('LAST_WITHIN_PERIOD');
|
|
63
|
+
const [rank, setRank] = useState<RankOption>('ANY');
|
|
64
|
+
const [confirmedOnly, setConfirmedOnly] = useState(true);
|
|
65
|
+
const [returnDisplay, setReturnDisplay] = useState(true);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Reset form state
|
|
69
|
+
*/
|
|
70
|
+
const resetForm = useCallback(() => {
|
|
71
|
+
setSelectedConcept(undefined);
|
|
72
|
+
setColumnName('');
|
|
73
|
+
setStrategy('LAST_WITHIN_PERIOD');
|
|
74
|
+
setRank('ANY');
|
|
75
|
+
setConfirmedOnly(true);
|
|
76
|
+
setReturnDisplay(true);
|
|
77
|
+
}, []);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Reset form state when modal opens/closes
|
|
81
|
+
* Also populate form when editing existing column
|
|
82
|
+
*/
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (open) {
|
|
85
|
+
setConceptSelectorKey((k) => k + 1);
|
|
86
|
+
if (editingColumn) {
|
|
87
|
+
// Populate form with existing column data
|
|
88
|
+
const config = editingColumn.dataDefinitionConfig || {};
|
|
89
|
+
setSelectedConcept(editingColumn.source?.conceptUuid ? {
|
|
90
|
+
uuid: editingColumn.source.conceptUuid,
|
|
91
|
+
display: config.conceptName || editingColumn.name,
|
|
92
|
+
datatype: { name: editingColumn.source?.fieldType || 'TEXT' },
|
|
93
|
+
} as ConceptSummary : undefined);
|
|
94
|
+
setColumnName(editingColumn.name || '');
|
|
95
|
+
setStrategy(config.strategy || 'LAST_WITHIN_PERIOD');
|
|
96
|
+
setRank(config.rank || 'ANY');
|
|
97
|
+
setConfirmedOnly(config.confirmedOnly !== false);
|
|
98
|
+
setReturnDisplay(config.returnDisplay !== false);
|
|
99
|
+
} else {
|
|
100
|
+
// Reset for new column creation
|
|
101
|
+
resetForm();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, [open, editingColumn, resetForm]);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Handle modal close
|
|
108
|
+
*/
|
|
109
|
+
const handleClose = useCallback(() => {
|
|
110
|
+
resetForm();
|
|
111
|
+
onClose();
|
|
112
|
+
}, [resetForm, onClose]);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Handle concept selection
|
|
116
|
+
*/
|
|
117
|
+
const handleConceptSelect = useCallback((concept: ConceptSummary) => {
|
|
118
|
+
setSelectedConcept(concept);
|
|
119
|
+
// Auto-generate column name from concept name if not set
|
|
120
|
+
if (!columnName) {
|
|
121
|
+
setColumnName(concept.display);
|
|
122
|
+
}
|
|
123
|
+
}, [columnName]);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Handle form submission
|
|
127
|
+
*/
|
|
128
|
+
const handleSubmit = useCallback(() => {
|
|
129
|
+
// Allow empty concept selection to capture ALL diagnoses
|
|
130
|
+
const finalColumnName = columnName?.trim() || (selectedConcept?.display || 'Diagnoses');
|
|
131
|
+
|
|
132
|
+
// Check for duplicate column names (exclude current column when editing)
|
|
133
|
+
const duplicateName = existingColumns.some(col =>
|
|
134
|
+
col.id !== editingColumn?.id && col.name.toLowerCase() === finalColumnName.toLowerCase()
|
|
135
|
+
);
|
|
136
|
+
if (duplicateName) {
|
|
137
|
+
// TODO: Show error notification
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const now = new Date().toISOString();
|
|
142
|
+
|
|
143
|
+
const newColumn: LinelistColumnDraft = {
|
|
144
|
+
id: editingColumn?.id || `col-${now}-${selectedConcept?.uuid || 'all-diagnoses'}`,
|
|
145
|
+
name: finalColumnName,
|
|
146
|
+
description: editingColumn?.description || (selectedConcept ? `Diagnosis: ${selectedConcept.display}` : 'All encounter diagnoses'),
|
|
147
|
+
source: {
|
|
148
|
+
dataSourceUuid: 'encounter_diagnoses',
|
|
149
|
+
dataSourceName: 'Encounter Diagnoses',
|
|
150
|
+
table: 'encounter_diagnoses',
|
|
151
|
+
field: selectedConcept?.uuid || '*',
|
|
152
|
+
fieldType: 'TEXT',
|
|
153
|
+
conceptUuid: selectedConcept?.uuid,
|
|
154
|
+
},
|
|
155
|
+
dataDefinitionType: 'ENCOUNTER_DIAGNOSIS',
|
|
156
|
+
dataDefinitionConfig: {
|
|
157
|
+
conceptUuid: selectedConcept?.uuid,
|
|
158
|
+
conceptName: selectedConcept?.display,
|
|
159
|
+
rank,
|
|
160
|
+
confirmedOnly,
|
|
161
|
+
strategy,
|
|
162
|
+
returnDisplay,
|
|
163
|
+
},
|
|
164
|
+
additionInfo: {
|
|
165
|
+
addedVia: editingColumn?.additionInfo?.addedVia || 'VISUAL_SELECTOR',
|
|
166
|
+
addedAt: editingColumn?.additionInfo?.addedAt || now,
|
|
167
|
+
orderAdded: editingColumn?.additionInfo?.orderAdded || existingColumns.length,
|
|
168
|
+
},
|
|
169
|
+
display: editingColumn?.display || {
|
|
170
|
+
width: 150,
|
|
171
|
+
align: 'left',
|
|
172
|
+
sortable: true,
|
|
173
|
+
filterable: true,
|
|
174
|
+
format: 'coded',
|
|
175
|
+
},
|
|
176
|
+
sortOrder: editingColumn?.sortOrder ?? existingColumns.length,
|
|
177
|
+
repeatResolution: {
|
|
178
|
+
strategy: strategy === 'ALL_VALUES' ? 'NONE' : 'LATEST',
|
|
179
|
+
orderBy: 'encounter_date',
|
|
180
|
+
restrictToPeriod: true,
|
|
181
|
+
ignoreVoided: true,
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
onAddColumn(newColumn);
|
|
186
|
+
handleClose();
|
|
187
|
+
}, [selectedConcept, columnName, strategy, rank, confirmedOnly, returnDisplay, existingColumns, onAddColumn, handleClose, editingColumn]);
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Check if form is valid
|
|
191
|
+
*/
|
|
192
|
+
const isFormValid = columnName?.trim();
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<Modal
|
|
196
|
+
open={open}
|
|
197
|
+
onRequestClose={handleClose}
|
|
198
|
+
modalHeading={editingColumn ? "Edit Diagnosis Column" : "Add Diagnosis Column"}
|
|
199
|
+
modalLabel="Data Catalogue"
|
|
200
|
+
size="md"
|
|
201
|
+
preventCloseOnClickOutside
|
|
202
|
+
primaryButtonText={editingColumn ? "Save Changes" : "Add Column"}
|
|
203
|
+
primaryButtonDisabled={!isFormValid}
|
|
204
|
+
onRequestSubmit={handleSubmit}
|
|
205
|
+
secondaryButtonText="Cancel"
|
|
206
|
+
onSecondarySubmit={handleClose}
|
|
207
|
+
>
|
|
208
|
+
<div className={styles.content}>
|
|
209
|
+
<Stack gap={6}>
|
|
210
|
+
{/* Concept Selector - Optional for filtering by specific diagnosis */}
|
|
211
|
+
<div className={styles.conceptSection}>
|
|
212
|
+
<div className={styles.conceptSectionHeader}>
|
|
213
|
+
<p className={styles.helperText}>
|
|
214
|
+
Leave empty to capture ALL encounter diagnoses, or search for a specific diagnosis condition (e.g., "Malaria", "HIV", "TB").
|
|
215
|
+
</p>
|
|
216
|
+
</div>
|
|
217
|
+
<ConceptSelector
|
|
218
|
+
key={conceptSelectorKey}
|
|
219
|
+
openKey={conceptSelectorKey}
|
|
220
|
+
selectedConcept={selectedConcept}
|
|
221
|
+
onSelect={handleConceptSelect}
|
|
222
|
+
onClear={() => setSelectedConcept(undefined)}
|
|
223
|
+
label="Search for Diagnosis Concept"
|
|
224
|
+
placeholder="Type to search for diagnosis concepts..."
|
|
225
|
+
showAdvanced={false}
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
{/* Column Configuration */}
|
|
230
|
+
<FormGroup legendText="Column Configuration">
|
|
231
|
+
<Stack gap={4}>
|
|
232
|
+
{/* Column Name */}
|
|
233
|
+
<TextInput
|
|
234
|
+
id="diagnosis-column-name"
|
|
235
|
+
labelText="Column Name *"
|
|
236
|
+
placeholder="Enter display name for this column"
|
|
237
|
+
value={columnName}
|
|
238
|
+
onChange={(e) => setColumnName(e.target.value)}
|
|
239
|
+
/>
|
|
240
|
+
|
|
241
|
+
{/* Rank */}
|
|
242
|
+
<Select
|
|
243
|
+
id="diagnosis-rank"
|
|
244
|
+
labelText="Diagnosis Rank"
|
|
245
|
+
value={rank}
|
|
246
|
+
onChange={(e) => setRank(e.target.value as RankOption)}
|
|
247
|
+
>
|
|
248
|
+
{RANK_OPTIONS.map(opt => (
|
|
249
|
+
<SelectItem
|
|
250
|
+
key={opt.value}
|
|
251
|
+
value={opt.value}
|
|
252
|
+
text={opt.label}
|
|
253
|
+
title={opt.description}
|
|
254
|
+
/>
|
|
255
|
+
))}
|
|
256
|
+
</Select>
|
|
257
|
+
|
|
258
|
+
{/* Strategy */}
|
|
259
|
+
<Select
|
|
260
|
+
id="diagnosis-strategy"
|
|
261
|
+
labelText="Strategy for Multiple Diagnoses"
|
|
262
|
+
value={strategy}
|
|
263
|
+
onChange={(e) => setStrategy(e.target.value as StrategyOption)}
|
|
264
|
+
>
|
|
265
|
+
{STRATEGY_OPTIONS.map(opt => (
|
|
266
|
+
<SelectItem
|
|
267
|
+
key={opt.value}
|
|
268
|
+
value={opt.value}
|
|
269
|
+
text={opt.label}
|
|
270
|
+
title={opt.description}
|
|
271
|
+
/>
|
|
272
|
+
))}
|
|
273
|
+
</Select>
|
|
274
|
+
|
|
275
|
+
{/* Confirmed Only Toggle */}
|
|
276
|
+
<Toggle
|
|
277
|
+
id="diagnosis-confirmed-only"
|
|
278
|
+
labelText="Only include confirmed diagnoses"
|
|
279
|
+
toggled={confirmedOnly}
|
|
280
|
+
onToggle={(checked) => setConfirmedOnly(checked)}
|
|
281
|
+
size="sm"
|
|
282
|
+
/>
|
|
283
|
+
|
|
284
|
+
{/* Return Display Toggle */}
|
|
285
|
+
<Toggle
|
|
286
|
+
id="diagnosis-return-display"
|
|
287
|
+
labelText="Return concept display name instead of UUID"
|
|
288
|
+
toggled={returnDisplay}
|
|
289
|
+
onToggle={(checked) => setReturnDisplay(checked)}
|
|
290
|
+
size="sm"
|
|
291
|
+
/>
|
|
292
|
+
</Stack>
|
|
293
|
+
</FormGroup>
|
|
294
|
+
</Stack>
|
|
295
|
+
</div>
|
|
296
|
+
</Modal>
|
|
297
|
+
);
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export default EncounterDiagnosisColumnModal;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encounter Diagnosis Column Modal Component Styles
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.content {
|
|
6
|
+
padding: 1rem 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.conceptSection {
|
|
10
|
+
margin-bottom: 1rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.conceptSectionHeader {
|
|
14
|
+
margin-bottom: 1rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.helperText {
|
|
18
|
+
font-size: 0.75rem;
|
|
19
|
+
color: #6f6f6f;
|
|
20
|
+
margin: 0.25rem 0 0 0;
|
|
21
|
+
}
|