Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Merging main into health-checks-pilot #992

Merged
merged 101 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
ba9fbbb
Update README.md
fongsean Jul 21, 2024
13212d5
Add custom populatedContext property to in app population
fongsean Jul 22, 2024
05acc56
Merge pull request #929 from aehrc/fix/populate
fongsean Jul 22, 2024
f5f48e8
Fix broken storybook links in docs
fongsean Jul 22, 2024
517a689
Fix flaky code bits - c159d6bd93a1ec4237a6eec8a00370e771f34ed7
fongsean Jul 22, 2024
566c939
- Set/reset targetStructureMap on build/destroy form
fongsean Jul 22, 2024
bce45be
Add capability in Smart Forms app to save, extract and write back in …
fongsean Jul 22, 2024
b1494cb
Fix Playwright issues
fongsean Jul 22, 2024
30a27a2
Run typedoc
fongsean Jul 22, 2024
7b46238
Merge pull request #931 from aehrc/feature/write-back
fongsean Jul 22, 2024
1df759a
Update sdc-populate to v2.3.0 and smart forms renderer to v0.36.0
fongsean Jul 23, 2024
3d2ee71
Update package-lock.json
fongsean Jul 23, 2024
45d662b
Merge pull request #934 from aehrc/fix/update-sdc-populate
fongsean Jul 23, 2024
ca2a855
chore: Add changelog_guide.md to .gitignore
fongsean Jul 23, 2024
d3fd1a8
Fix initial calculatedExpression pre-fill
fongsean Jul 23, 2024
8ccdd2d
Add support for Coding object in calculatedExpressions for choice and…
fongsean Jul 23, 2024
c80e4cd
Update package versions
fongsean Jul 23, 2024
3ffbd9d
Merge pull request #935 from aehrc/fix/calculated-expression
fongsean Jul 23, 2024
2c9fca9
Add AU Core AllergyIntolerance, Condition, Encounter, Immunization an…
fongsean Jul 24, 2024
9621c35
Bump @storybook/react from 8.0.10 to 8.2.6
dependabot[bot] Jul 24, 2024
f006102
Add page component (#1)
ryuuzake Jul 27, 2024
5fb8e3e
Bump fast-xml-parser from 4.3.2 to 4.4.1 in /apps/demo-renderer-app
dependabot[bot] Jul 29, 2024
cdf067a
Merge pull request #938 from aehrc/dependabot/npm_and_yarn/storybook/…
fongsean Jul 30, 2024
e6284f9
Add the remaining resource questionnaires for AU Core testing
fongsean Jul 30, 2024
94e5861
Changes color to string literal instead of custom palette
ryuuzake Jul 31, 2024
37216ff
Rename FormBodyPage to FormTopLevelPage for top level renderer
ryuuzake Jul 31, 2024
151f96c
Add Renderer Logic for Page Container
ryuuzake Jul 31, 2024
5fb8268
Add Renderer Logic for Page Container - Non Single Top Level
ryuuzake Aug 1, 2024
fdf6571
Changes Page Button design
ryuuzake Aug 1, 2024
b1f8f9f
Tweak page button colours to be consistent with tab buttons
fongsean Aug 5, 2024
3097d13
Update package versions
fongsean Aug 5, 2024
475c57e
Merge pull request #4 from aehrc/issue/940
ryuuzake Aug 5, 2024
69409fe
Merge branch 'main' of github.com:aehrc/smart-forms into issue/940
ryuuzake Aug 5, 2024
e432145
Merge pull request #947 from konsulin-id/issue/940
fongsean Aug 6, 2024
607c0cb
Merge branch 'refs/heads/main' into feature/au-core-testing
fongsean Aug 6, 2024
b10042b
Update vite config - mistakenly removed the preserveSymLinks: true op…
fongsean Aug 6, 2024
f147683
Merge pull request #949 from aehrc/feature/au-core-testing
fongsean Aug 6, 2024
ef52eab
Merge pull request #941 from aehrc/dependabot/npm_and_yarn/apps/demo-…
fongsean Aug 6, 2024
9a06c8e
Add Quantity Item Form Component
ryuuzake Jul 28, 2024
d08aadd
Update package version
ryuuzake Jul 28, 2024
bf2632f
Update packages version
ryuuzake Jul 28, 2024
9e5149c
Bump zustand from 4.5.2 to 4.5.4
dependabot[bot] Aug 6, 2024
9b38665
Bump eslint-plugin-react-hooks from 4.6.0 to 4.6.2
dependabot[bot] Aug 6, 2024
dcd040b
Bump @emotion/react from 11.11.4 to 11.13.0
dependabot[bot] Aug 6, 2024
f233e36
Bump @microlink/react-json-view from 1.23.0 to 1.23.1
dependabot[bot] Aug 6, 2024
b0bc8ff
Bump @mui/material from 5.15.20 to 5.16.6
dependabot[bot] Aug 6, 2024
b03d922
Merge pull request #955 from aehrc/dependabot/npm_and_yarn/mui/materi…
fongsean Aug 8, 2024
fec75f2
Merge pull request #951 from aehrc/dependabot/npm_and_yarn/zustand-4.5.4
fongsean Aug 8, 2024
dc8398e
Merge pull request #954 from aehrc/dependabot/npm_and_yarn/microlink/…
fongsean Aug 8, 2024
1299291
Merge pull request #953 from aehrc/dependabot/npm_and_yarn/emotion/re…
fongsean Aug 8, 2024
dbbf960
Merge pull request #952 from aehrc/dependabot/npm_and_yarn/eslint-plu…
fongsean Aug 8, 2024
93ef78d
Bump vite-plugin-svgr from 3.2.0 to 4.2.0
dependabot[bot] Aug 8, 2024
fd622f5
Bump eslint-plugin-prettier from 5.0.1 to 5.2.1
dependabot[bot] Aug 8, 2024
5c3229b
Add initialisation/pre-pop of Quantity items
fongsean Aug 12, 2024
36cbf1c
Add support for calculated expression in Quantity component
fongsean Aug 19, 2024
d1a5ac8
Merge remote-tracking branch 'refs/remotes/origin/main' into issue/639
fongsean Aug 19, 2024
4cecf14
Update package-lock.json
fongsean Aug 19, 2024
7bcf891
Fix isRecord imports in sdc-populate
fongsean Aug 19, 2024
c6c1e3a
Update packages
fongsean Aug 19, 2024
3a3edeb
Add demo-renderer-app CI build to test if package works outside the m…
fongsean Aug 19, 2024
9ae3feb
Fix build-demo-app CI
fongsean Aug 19, 2024
d91bd81
Fix build-demo-app CI attempt 2
fongsean Aug 19, 2024
71dd709
Merge pull request #964 from aehrc/fix/pop-import
fongsean Aug 19, 2024
058243f
Bump axios from 1.6.8 to 1.7.4
dependabot[bot] Aug 19, 2024
9251adf
Merge remote-tracking branch 'refs/remotes/origin/main' into issue/639
fongsean Aug 19, 2024
c7136c3
Add documentation on Quantity component
fongsean Aug 19, 2024
2686b54
Update renderer version to 0.38.2
fongsean Aug 20, 2024
12eeef2
Merge pull request #6 from aehrc/issue/639
ryuuzake Aug 20, 2024
4a7ff5b
Merge pull request #950 from konsulin-id/issue/639
fongsean Aug 21, 2024
f627d68
Fix package-lock.json
fongsean Aug 21, 2024
43fe9c1
Merge pull request #967 from aehrc/fix/workflow
fongsean Aug 21, 2024
1ee429b
Bump @types/node from 20.14.2 to 22.5.0
dependabot[bot] Aug 21, 2024
6be3916
Fix quantity docs
fongsean Aug 22, 2024
484620b
Merge pull request #969 from aehrc/fix/workflow
fongsean Aug 22, 2024
61f161a
Merge pull request #968 from aehrc/dependabot/npm_and_yarn/types/node…
fongsean Aug 23, 2024
e2eddc4
Merge pull request #965 from aehrc/dependabot/npm_and_yarn/axios-1.7.4
fongsean Aug 23, 2024
1165470
Merge pull request #960 from aehrc/dependabot/npm_and_yarn/eslint-plu…
fongsean Aug 23, 2024
9a77e7f
Merge pull request #958 from aehrc/dependabot/npm_and_yarn/vite-plugi…
fongsean Aug 23, 2024
82bb4bd
Add support for non-repeating group table
fongsean Aug 23, 2024
3752e7d
Add isRepeated attribute into repopulate group table
fongsean Aug 23, 2024
164cb82
Merge pull request #970 from aehrc/issue/963
fongsean Aug 23, 2024
2ae71c9
Add support for item.initial for repeating groups
fongsean Aug 29, 2024
2bf37e8
Update package.json
fongsean Aug 29, 2024
eb01245
Merge pull request #978 from aehrc/feature/item-initial
fongsean Aug 29, 2024
1d99fe6
Bump @sentry/cli from 2.32.1 to 2.34.1
dependabot[bot] Aug 29, 2024
7d07a59
Bump zustand from 4.5.4 to 4.5.5
dependabot[bot] Aug 29, 2024
f5d1124
Bump @mui/material from 5.16.6 to 5.16.7
dependabot[bot] Aug 29, 2024
c81c9ac
Bump micromatch from 4.0.5 to 4.0.8
dependabot[bot] Aug 29, 2024
9ab1011
Add CHANGELOG.md
fongsean Aug 29, 2024
483b728
Merge pull request #983 from aehrc/feature/add-changelog
fongsean Aug 29, 2024
2d611c5
Merge pull request #975 from aehrc/dependabot/npm_and_yarn/zustand-4.5.5
fongsean Aug 29, 2024
a52d13e
Merge pull request #982 from aehrc/dependabot/npm_and_yarn/micromatch…
fongsean Aug 29, 2024
0dac7c2
Merge pull request #977 from aehrc/dependabot/npm_and_yarn/sentry/cli…
fongsean Aug 29, 2024
506cddf
Merge pull request #973 from aehrc/dependabot/npm_and_yarn/mui/materi…
fongsean Aug 29, 2024
089e5e7
Add clearTimeouts to all useEffects containing timeouts
fongsean Sep 2, 2024
e8c0a94
Update storybook
fongsean Sep 4, 2024
4da3275
Use QR item.id instead of useState to keep track of repeat item insta…
fongsean Sep 5, 2024
4ee3ca9
Fix linting
fongsean Sep 6, 2024
2909025
Merge pull request #989 from aehrc/refactor/performance
fongsean Sep 6, 2024
c1adc0c
Update package versions
fongsean Sep 6, 2024
af3fb8b
Merge pull request #990 from aehrc/refactor/performance
fongsean Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/build_test_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

jobs:
build:
build-smart-forms-app:
name: Build
runs-on: ubuntu-latest
steps:
Expand All @@ -19,6 +19,21 @@ jobs:
- name: Build application
run: npm run build -w apps/smart-forms-app

build-demo-app:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: Install dependencies
run: npm ci
- name: Build application
run: cd apps/demo-renderer-app && npm run build

jest-test:
name: Jest Tests
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
coverage
coverage
changelog_guide.md
2 changes: 1 addition & 1 deletion Conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ View the source here: http://hl7.org/fhir/uv/sdc/behavior.html
- [ ] minOccurs
- [ ] maxOccurs
- [ ] optionExclusive
- [ ] unitOption
- [x] unitOption
- [ ] unitValueSet
- [ ] unitOpen
- [ ] unitSupplementalSystem
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Powered by SMART on FHIR and Structured Data Capture, Smart Forms allow you to e
<h4><a href="https://smartforms.csiro.au">Show me the app ➡️</a></h4>

<h4><a href="https://smartforms.csiro.au/docs">Check out the documentation 📚</a></h4>
Update 11/07/2024: The documentation link isn't working. It is currently being fixed.

---
Smart Forms is a Typescript-based [React](https://reactjs.org/) forms web application currently ongoing development by [CSIRO's Australian e-Health Research Centre](https://aehrc.csiro.au/) as part of the Primary Care Data Quality project funded by the Australian Government Department of Health.
Expand Down
75 changes: 38 additions & 37 deletions apps/demo-renderer-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apps/demo-renderer-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"preview": "vite preview"
},
"dependencies": {
"@aehrc/sdc-populate": "^1.8.0",
"@aehrc/smart-forms-renderer": "file:../../packages/smart-forms-renderer",
"@aehrc/sdc-populate": "^2.3.1",
"@aehrc/smart-forms-renderer": "^0.39.0",
"@tanstack/react-query": "^4.36.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
6 changes: 0 additions & 6 deletions apps/demo-renderer-app/src/utils/populate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@
import { fetchResourceCallback } from './populateCallback';
import { createPopulateInputParameters } from './populateInputParams';

export const REQUEST_CONFIG: RequestConfig = {
clientEndpoint: 'https://gw.interop.community/AuConNov23/data',
authToken:
'eyJqa3UiOiJodHRwczpcL1wvaW9sMmF1dGguaW50ZXJvcC5jb21tdW5pdHlqd2siLCJraWQiOiJyc2ExIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJhdWQiOiJhN2RkNDJlZi05ZDdjLTRhOWItOTgyZi0xZjRmZjBlNDI5OGUiLCJpc3MiOiJodHRwczpcL1wvaW9sMmF1dGguaW50ZXJvcC5jb21tdW5pdHkiLCJleHAiOjE3MDA0NTAyNDcsImlhdCI6MTcwMDQ0NjY0NywianRpIjoiYTE0ZmM0MzktZGUzNC00MzQwLTlkNGYtYmIwZDY3Y2ZjM2NhIn0.PQ2T8GQCyQkwAI0UTXZ9AEJF1KcK8H0CGePLj7XLg-jqn381-9j8OyOR5cjEh2EpzhdfeDQX2KCjvq4wd3PkPmkQYfPXBj84odtNHSuubtHlA_TnDK2fyhoDOn_CwYOIPJrFNZ2frvDlkdFs5s--dlPGGoAQoy3Szbf09PzbiiThf3Y3YmRGcb1JR1n4RwhwW6d7lhMEhbaqEqzsfig75TFhFw2wmJGXqIZMz0L2TTel9iYT9zeEyBmmmZpdoCTwgD2raC2nPpxU-OjslA50r_OvjfDpVhIAC40E5-ol_xAL7QhFioudsUQaQXGXWgcDs2lTqrNA-HPoxxrj1ZD9GQ'
};

export interface PopulateResult {
populated: QuestionnaireResponse;
hasWarnings: boolean;
Expand All @@ -57,7 +51,7 @@
populateSuccess: boolean;
populateResult: PopulateResult | null;
}> {
const fhirPathContext: Record<string, any> = {};

Check warning on line 54 in apps/demo-renderer-app/src/utils/populate.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

// Get launch contexts, source queries and questionnaire-level variables
const launchContexts = getLaunchContexts(questionnaire);
Expand Down Expand Up @@ -194,7 +188,7 @@
}
}

async function addTimeoutToPromise(promise: Promise<any>, timeoutMs: number) {

Check warning on line 191 in apps/demo-renderer-app/src/utils/populate.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const timeoutPromise = new Promise((_, reject) => {
setTimeout(() => {
reject(new Error(`Promise timed out after ${timeoutMs} milliseconds`));
Expand Down
3 changes: 2 additions & 1 deletion apps/demo-renderer-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export default defineConfig({
commonjsOptions: {
include: [/node_modules/, '@aehrc/sdc-populate']
}
}
},
resolve: { preserveSymlinks: true }
});
2 changes: 2 additions & 0 deletions apps/smart-forms-app/e2e/dashboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ test.beforeEach(async ({ page }) => {
const fetchQRPromise = page.waitForResponse(
new RegExp(/^https:\/\/proxy\.smartforms\.io\/v\/r4\/fhir\/QuestionnaireResponse\?.+$/)
);
await page.getByTestId('dashboard-table-pagination').locator('div').getByRole('combobox').click();
await page.getByRole('option', { name: '50' }).click();
await page.getByTestId('questionnaire-list-row').getByText(questionnaireTitle).first().click();
const fetchQRResponse = await fetchQRPromise;
expect(fetchQRResponse.status()).toBe(200);
Expand Down
26 changes: 13 additions & 13 deletions apps/smart-forms-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aehrc/smart-forms-app",
"private": true,
"version": "0.2.0",
"version": "1.0.0",
"type": "module",
"description": "Typescript-based React web application implementing FHIR Structured Data Captured (SDC) specification",
"scripts": {
Expand All @@ -27,23 +27,23 @@
"homepage": "https://github.com/aehrc/smart-forms#readme",
"dependencies": {
"@aehrc/sdc-assemble": "^1.3.1",
"@aehrc/sdc-populate": "^2.2.7",
"@aehrc/smart-forms-renderer": "^0.35.9",
"@emotion/react": "^11.11.4",
"@aehrc/sdc-populate": "^2.3.1",
"@aehrc/smart-forms-renderer": "^0.39.0",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.11.5",
"@fontsource/material-icons": "^5.0.18",
"@fontsource/roboto": "^5.0.12",
"@iconify/react": "^4.1.1",
"@microlink/react-json-view": "^1.23.0",
"@microlink/react-json-view": "^1.23.1",
"@monaco-editor/react": "^4.6.0",
"@mui/icons-material": "^5.15.20",
"@mui/lab": "^5.0.0-alpha.151",
"@mui/material": "^5.15.20",
"@mui/material": "^5.16.7",
"@mui/x-date-pickers": "^6.10.1",
"@sentry/react": "^7.73.0",
"@sentry/tracing": "^7.101.0",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-table": "^8.10.7",
"@tanstack/react-table": "^8.19.3",
"allotment": "^1.20.2",
"dayjs": "^1.11.10",
"fhirclient": "^2.5.2",
Expand Down Expand Up @@ -73,19 +73,19 @@
"react-to-print": "^2.14.15",
"simplebar-react": "^3.2.4",
"usehooks-ts": "^2.9.1",
"zustand": "^4.5.2"
"zustand": "^4.5.5"
},
"devDependencies": {
"@jest/globals": "^29.5.0",
"@playwright/test": "^1.44.1",
"@sentry/cli": "^2.32.1",
"@sentry/cli": "^2.34.1",
"@storybook/addon-essentials": "^8.0.6",
"@storybook/addon-interactions": "^7.4.6",
"@storybook/addon-links": "^8.0.3",
"@storybook/addon-onboarding": "^8.0.0",
"@storybook/addon-styling": "^1.3.7",
"@storybook/blocks": "^7.5.2",
"@storybook/react": "^8.0.9",
"@storybook/react": "^8.2.6",
"@storybook/react-vite": "^7.4.5",
"@storybook/testing-library": "^0.2.1",
"@tanstack/react-query-devtools": "^4.35.3",
Expand All @@ -96,7 +96,7 @@
"@types/lodash.debounce": "^4.0.7",
"@types/lodash.filter": "^4.6.7",
"@types/lodash.isequal": "^4.5.8",
"@types/node": "^20.14.2",
"@types/node": "^22.5.0",
"@types/randomcolor": "^0.5.9",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.22",
Expand All @@ -106,7 +106,7 @@
"@vitejs/plugin-react": "^4.0.4",
"eslint": "^8.52.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"eslint-plugin-storybook": "^0.8.0",
"jest": "^29.7.0",
Expand All @@ -115,7 +115,7 @@
"ts-jest": "^29.1.1",
"typescript": "^5.2.2",
"vite": "^4.5.3",
"vite-plugin-svgr": "^3.2.0",
"vite-plugin-svgr": "^4.2.0",
"yui-lint": "^0.2.0"
},
"eslintConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function DashboardTablePagination<T>(props: DashboardTablePaginationProps<T>) {
const { table, children } = props;

const { pageSize, pageIndex } = table.getState().pagination;
const totalNumberOfItems = table.getRowModel().rows.length;
const totalNumberOfItems = table.getRowCount();

return (
<Box display="flex" justifyContent="space-between" alignItems="center">
Expand All @@ -39,9 +39,10 @@ function DashboardTablePagination<T>(props: DashboardTablePaginationProps<T>) {
count={table.getFilteredRowModel().rows.length}
rowsPerPage={pageSize}
page={pageIndex}
data-test="dashboard-table-pagination"
onPageChange={(_, page) => table.setPageIndex(page)}
onRowsPerPageChange={(event) => {
const size = event.target.value ? Number(event.target.value) : 10;
const size = parseInt(event.target.value, 10);
table.setPageSize(size);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import { useNavigate } from 'react-router-dom';
import { postQuestionnaireToSMARTHealthIT } from '../../../../../../api/saveQr.ts';
import { CircularProgress, IconButton, Stack, Typography } from '@mui/material';
import EditNoteIcon from '@mui/icons-material/EditNote';
import { buildForm } from '@aehrc/smart-forms-renderer';
import useSmartClient from '../../../../../../hooks/useSmartClient.ts';
import useSelectedQuestionnaire from '../../../../hooks/useSelectedQuestionnaire.ts';
import { TERMINOLOGY_SERVER_URL } from '../../../../../../globals.ts';
import { buildFormWrapper } from '../../../../../../utils/manageForm.ts';

function CreateNewResponseButton() {
const { smartClient, launchQuestionnaire } = useSmartClient();
Expand All @@ -46,7 +46,7 @@ function CreateNewResponseButton() {
postQuestionnaireToSMARTHealthIT(smartClient, questionnaire);
}

await buildForm(questionnaire, undefined, undefined, TERMINOLOGY_SERVER_URL);
await buildFormWrapper(questionnaire, undefined, undefined, TERMINOLOGY_SERVER_URL);

navigate('/renderer');
setIsLoading(false);
Expand Down
Loading
Loading