Skip to content

Commit 42a298a

Browse files
Merge remote-tracking branch 'beda/calculated-test' into age-group-test
2 parents 701e713 + b7c0004 commit 42a298a

45 files changed

Lines changed: 688 additions & 332 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_test_lint.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,6 @@ jobs:
7676
path: packages/smart-forms-app/coverage
7777
retention-days: 30
7878

79-
vitest-smart-forms-app-715-tests:
80-
name: Vitest Questionnaire Behaviour Tests - Smart Forms App
81-
runs-on: ubuntu-latest
82-
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
83-
steps:
84-
- uses: actions/checkout@v4
85-
- name: Use Node.js 20.x
86-
uses: actions/setup-node@v4
87-
with:
88-
node-version: 20
89-
cache: npm
90-
- name: Install dependencies
91-
run: npm ci
92-
93-
- name: Build workspace packages (monorepo dependencies)
94-
run: |
95-
npm run build -w packages/sdc-assemble
96-
npm run build -w packages/sdc-populate
97-
npm run build -w packages/sdc-template-extract
98-
npm run build -w packages/smart-forms-renderer
99-
100-
- name: Run vitest tests
101-
run: npm run test-715 -w apps/smart-forms-app
102-
- uses: codecov/codecov-action@v4
103-
10479
jest-renderer-tests:
10580
name: Jest Tests - Renderer
10681
runs-on: ubuntu-latest

.github/workflows/vitest_715.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Vitest Questionnaire 715 Behaviour Tests
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
vitest-smart-forms-app-715-tests:
7+
name: Vitest Questionnaire Behaviour Tests - Smart Forms App
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Use Node.js 20.x
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
cache: npm
16+
- name: Install dependencies
17+
run: npm ci
18+
19+
- name: Build workspace packages (monorepo dependencies)
20+
run: |
21+
npm run build -w packages/sdc-assemble
22+
npm run build -w packages/sdc-populate
23+
npm run build -w packages/sdc-template-extract
24+
npm run build -w packages/smart-forms-renderer
25+
26+
- name: Run vitest tests
27+
run: npm run test-715 -w apps/smart-forms-app
28+
- uses: codecov/codecov-action@v4

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ For changelogs of other libraries, please refer to their respective repositories
1010

1111
Changelog only includes changes from version 0.36.0 onwards.
1212

13+
## [1.2.14] - 2026-03-05
14+
### Changed
15+
- Reduced vertical padding and margins to limit excessive whitespace in the renderer.
16+
- Changed standalone autocomplete fields to be multiline so that value is not truncated.
17+
### Fixed
18+
- Fixed regression causing some calculatedExpressions to not be displayed.
19+
20+
## [1.2.13] - 2026-02-12
21+
### Fixed
22+
- Fixed an issue where existing QuestionnaireResponse repeat group items were being overwritten by blank data when applying calculatedExpression values, causing issue [#1811](https://github.com/aehrc/smart-forms/issues/1811)
23+
1324
## [1.2.12] - 2026-01-13
1425
### Added
1526
- Added support for text styling on answerOption.valueString.

Dockerfile

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1+
# Dockerfile
2+
# Runtime Configuration: This Docker image supports runtime configuration via config.json.
3+
# Mount your custom config.json at /usr/share/nginx/html/config.json to override defaults.
4+
# See config.docker.json for an example and the README for Kubernetes ConfigMap documentation.
15

2-
FROM node:20 AS build
3-
6+
# Step 1: Use a Node.js image to build the app
7+
FROM --platform=$BUILDPLATFORM node:20 AS builder
48

9+
# Set working directory inside the container
10+
WORKDIR /app
511

12+
# Copy package files for dependency installation
13+
COPY package*.json ./
14+
COPY apps/smart-forms-app/package*.json ./apps/smart-forms-app/
615

7-
ARG VITE_ONTOSERVER_URL
8-
ARG VITE_FORMS_SERVER_URL
9-
ARG VITE_LAUNCH_SCOPE
10-
ARG VITE_LAUNCH_CLIENT_ID
11-
ARG VITE_IN_APP_POPULATE
12-
ARG VITE_PRESERVE_SYM_LINKS
16+
# Install dependencies
17+
RUN npm install
1318

14-
ENV VITE_ONTOSERVER_URL $VITE_ONTOSERVER_URL
15-
ENV VITE_FORMS_SERVER_URL $VITE_FORMS_SERVER_URL
16-
ENV VITE_LAUNCH_SCOPE $VITE_LAUNCH_SCOPE
17-
ENV VITE_LAUNCH_CLIENT_ID $VITE_LAUNCH_CLIENT_ID
18-
ENV VITE_IN_APP_POPULATE $VITE_IN_APP_POPULATE
19-
ENV VITE_PRESERVE_SYM_LINKS $VITE_PRESERVE_SYM_LINKS
19+
# Copy the rest of the app's source code
20+
COPY . .
2021

21-
RUN mkdir /app
22-
COPY . /app
23-
RUN ls /app
24-
WORKDIR /app
25-
RUN npm install
22+
# Build the app
2623
WORKDIR /app/apps/smart-forms-app
24+
RUN npm run build
25+
26+
# Step 2: Use an Nginx image to serve the static files
27+
FROM nginx:alpine
28+
29+
# Copy the build files from the builder stage to the Nginx web directory
30+
COPY --from=builder /app/apps/smart-forms-app/dist /usr/share/nginx/html
31+
32+
# Copy your Nginx configuration file into the container
33+
COPY apps/smart-forms-app/default.conf /etc/nginx/conf.d/
34+
35+
# Expose port 80
36+
EXPOSE 80
37+
38+
# Start Nginx server
39+
CMD ["nginx", "-g", "daemon off;"]

LOCAL_DEVELOPMENT.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -498,29 +498,8 @@ P.S. We had `alpha` as a pre-release branch before the recent v1.0.0 release. Th
498498
9. Merge `main` into your branch to ensure you have the latest changes.
499499
10. Update TypeDoc documentation by running `npm run build` in `/documentation`.
500500
11. Request for a code review from a team member (or review it yourself). Once approved, you can proceed to the next steps.
501-
12. If you are working on a package (i.e. any package in `/packages`), follow the steps below to publish a new version. Otherwise, merge your branch into `main`.
502-
13. Depending on which package/app you are working on, bump the version number in `package.json` following [semantic versioning](https://semver.org/) principles.
503-
14. Update dependencies in other packages/apps if necessary.
504-
- `@aehrc/smart-forms-renderer`'s Storybook depends on `@aehrc/sdc-populate` and `@aehrc/sdc-template-extract`. If you update `@aehrc/sdc-populate` or `@aehrc/sdc-template-extract`, make sure to bump their versions and the `@aehrc/smart-forms-renderer` version.
505-
- For example, if you are making changes to `@aehrc/sdc-populate`, ensure that:
506-
- Both the Renderer's and Smart Forms app's dependency on `@aehrc/sdc-populate` is updated to the new version.
507-
- `@aehrc/smart-forms-renderer`'s version is also bumped to reflect the dependency change.
508-
- Bump `@aehrc/smart-forms-renderer`'s dependency version in Smart Forms app's `package.json`.
509-
15. Run `npm install` to update package-lock.json with the new version.
510-
16. Run `npm run build` in the respective package directory to ensure you get the latest build output.
511-
- If updating multiple packages, make sure to run the build command in each of the respective folders.
512-
17. Run `npm publish` in the respective package directory to publish new versions to NPM.
513-
- If updating multiple packages, make sure to run the publish command in each of the respective folders.
514-
- You might need to go through NPM 2FA when publishing new versions. Ensure you are logged into NPM with the correct account that has publishing rights on the aehrc organisation.
515-
18. Create a new entry in the `CHANGELOG.md` file in the respective package/app directory summarising your changes.
516-
- @aehrc/smart-forms-renderer - https://github.com/aehrc/smart-forms/blob/main/CHANGELOG.md
517-
- @aehrc/sdc-populate - https://github.com/aehrc/smart-forms/blob/main/packages/sdc-populate/CHANGELOG.md
518-
- @aehrc/sdc-assemble - https://github.com/aehrc/smart-forms/blob/main/packages/sdc-assemble/CHANGELOG.md
519-
- @aehrc/sdc-template-extract - https://github.com/aehrc/smart-forms/blob/main/packages/sdc-template-extract/CHANGELOG.md
520-
19. Push a new commit with the version bumps and changelog updates.
521-
20. Ensure that all CI checks pass (build, tests, linting, etc.).
522-
21. Merge your branch into `main`.
523-
22. Ensure the CI passes on `main` after the merge. If you added any Storybook stories or if story layout in Chromatic changes, those have to be reviewed and approved in Chromatic.
501+
12. Merge your branch into `main`.
502+
13. Ensure the CI passes on `main` after the merge. If you added any Storybook stories or if story layout in Chromatic changes, those have to be reviewed and approved in Chromatic.
524503

525504
> Remember to merge main into your branch regularly throughout the development process.
526505

@@ -540,7 +519,31 @@ P.S. We had `alpha` as a pre-release branch before the recent v1.0.0 release. Th
540519
13. For the reviewing internal team member:
541520
- Review the code changes.
542521
- Once approved, merge the pull request into `aehrc/main`.
543-
- If there are package version bumps, create a new PR referencing the issue and follow the steps from step 13 onwards in [Contributing workflow - internal contributors](#contributing-workflow---internal-contributors) to publish new package versions.
522+
- If there are package version bumps, create a new PR referencing the issue and follow the steps in [Release process](#release-process) to publish new package versions.
523+
524+
## Release process
525+
1. Create a release branch from main (e.g. `release/<date>`).
526+
2. Update the `CHANGELOG.md` file in the respective package/app directory summarising changes since the last release.
527+
- @aehrc/smart-forms-renderer - https://github.com/aehrc/smart-forms/blob/main/CHANGELOG.md
528+
- @aehrc/sdc-populate - https://github.com/aehrc/smart-forms/blob/main/packages/sdc-populate/CHANGELOG.md
529+
- @aehrc/sdc-assemble - https://github.com/aehrc/smart-forms/blob/main/packages/sdc-assemble/CHANGELOG.md
530+
- @aehrc/sdc-template-extract - https://github.com/aehrc/smart-forms/blob/main/packages/sdc-template-extract/CHANGELOG.md
531+
3. Depending on which package/app you are working on, bump the version number in `package.json` following [semantic versioning](https://semver.org/) principles.
532+
4. Update dependencies in other packages/apps if necessary.
533+
- `@aehrc/smart-forms-renderer`'s Storybook depends on `@aehrc/sdc-populate` and `@aehrc/sdc-template-extract`. If you update `@aehrc/sdc-populate` or `@aehrc/sdc-template-extract`, make sure to bump their versions and the `@aehrc/smart-forms-renderer` version.
534+
- For example, if you are making changes to `@aehrc/sdc-populate`, ensure that:
535+
- Both the Renderer's and Smart Forms app's dependency on `@aehrc/sdc-populate` is updated to the new version.
536+
- `@aehrc/smart-forms-renderer`'s version is also bumped to reflect the dependency change.
537+
- Bump `@aehrc/smart-forms-renderer`'s dependency version in Smart Forms app's `package.json`.
538+
5. Run `npm install` to update package-lock.json with the new version.
539+
6. Push a new commit with the version bumps and changelog updates.
540+
7. Open and merge a PR from the release branch into main.
541+
8. Ensure that all CI checks pass (build, tests, linting, etc.).
542+
9. Run `npm run build` in the respective package directory to ensure you get the latest build output.
543+
- If updating multiple packages, make sure to run the build command in each of the respective folders.
544+
10. Publish to NPM from main after merge by running `npm publish` in the respective package directory.
545+
- If updating multiple packages, make sure to run the publish command in each of the respective folders.
546+
- You might need to go through NPM 2FA when publishing new versions. Ensure you are logged into NPM with the correct account that has publishing rights on the aehrc organisation.
544547

545548
## Dependency notes
546549
- `date-fns` with version "^4.1.0" in `apps/smart-forms-app/package.json` is not used in the source code. It is used to prevent CommonJS issues when building the Smart Forms app in docker.

apps/smart-forms-app/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const config: Config = {
2323
preset: 'ts-jest',
2424
testEnvironment: 'jsdom',
2525
testPathIgnorePatterns: [
26-
'src/test/aboriginalForm*.test.tsx' // Exclude this specific test file (it uses Vitest)
26+
'src/test/aboriginalForm.*\\.test\\.tsx' // Exclude these test files (regex) (it uses Vitest)
2727
],
2828
setupFilesAfterEnv: ['./src/setup-jest.ts'],
2929
transform: {

apps/smart-forms-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@aehrc/sdc-assemble": "^2.0.2",
3030
"@aehrc/sdc-populate": "^4.6.2",
3131
"@aehrc/sdc-template-extract": "^1.0.15",
32-
"@aehrc/smart-forms-renderer": "^1.2.12",
32+
"@aehrc/smart-forms-renderer": "^1.2.14",
3333
"@dnd-kit/core": "^6.3.1",
3434
"@emotion/react": "^11.14.0",
3535
"@emotion/styled": "^11.14.1",

apps/smart-forms-app/public/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"formsServerUrl": "https://smartforms.csiro.au/api/fhir",
44
"defaultClientId": "a57d90e3-5f69-4b92-aa2e-2992180863c1",
55
"launchScopes": "launch openid fhirUser online_access patient/AllergyIntolerance.cs patient/Condition.cs patient/Encounter.r patient/Immunization.cs patient/Medication.r patient/MedicationStatement.cs patient/Observation.cs patient/Patient.r patient/QuestionnaireResponse.crus user/Practitioner.r launch/questionnaire?role=http://ns.electronichealth.net.au/smart/role/new",
6-
"registeredClientIdsUrl": "https://smartforms.csiro.au/smart-config/config.json"
6+
"registeredClientIdsUrl": "https://smartforms.csiro.au/smart-config/config.json",
7+
"showDeveloperMessages": true
78
}

apps/smart-forms-app/src/api/saveQr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function saveProgress(
5252
user: Practitioner,
5353
questionnaire: Questionnaire,
5454
questionnaireResponse: QuestionnaireResponse,
55-
saveStatus: 'in-progress' | 'completed'
55+
saveStatus: 'in-progress' | 'completed' | 'amended'
5656
) {
5757
const responseToSave = removeEmptyAnswersFromResponse(
5858
questionnaire,

apps/smart-forms-app/src/data/resources/Questionnaire/Questionnaire-AboriginalTorresStraitIslanderHealthCheckAssembled-0.4.0.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,7 @@
270270
"resourceType": "ValueSet",
271271
"id": "administrative-gender",
272272
"meta": {
273-
"profile": [
274-
"http://hl7.org/fhir/StructureDefinition/shareablevalueset"
275-
]
273+
"profile": ["http://hl7.org/fhir/StructureDefinition/shareablevalueset"]
276274
},
277275
"extension": [
278276
{
@@ -3489,9 +3487,7 @@
34893487
"title": "NEW!!! Aboriginal and Torres Strait Islander Health Check",
34903488
"status": "draft",
34913489
"experimental": false,
3492-
"subjectType": [
3493-
"Patient"
3494-
],
3490+
"subjectType": ["Patient"],
34953491
"date": "2025-03-14",
34963492
"publisher": "AEHRC CSIRO",
34973493
"contact": [
@@ -22514,4 +22510,4 @@
2251422510
]
2251522511
}
2251622512
]
22517-
}
22513+
}

0 commit comments

Comments
 (0)