Skip to content

Commit

Permalink
Merge pull request #831 from aehrc/main
Browse files Browse the repository at this point in the history
Merging main into acdc-pilot
  • Loading branch information
fongsean authored May 31, 2024
2 parents 3182b8d + be43cf4 commit 4c0be86
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 21 deletions.
4 changes: 2 additions & 2 deletions apps/smart-forms-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"homepage": "https://github.com/aehrc/smart-forms#readme",
"dependencies": {
"@aehrc/sdc-assemble": "^1.2.0",
"@aehrc/sdc-populate": "^2.1.0",
"@aehrc/smart-forms-renderer": "^0.33.0",
"@aehrc/sdc-populate": "^2.2.0",
"@aehrc/smart-forms-renderer": "^0.33.1",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fontsource/material-icons": "^5.0.16",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ 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';

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

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

navigate('/renderer');
setIsLoading(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import OpenInNewIcon from '@mui/icons-material/OpenInNew';
import { buildForm } from '@aehrc/smart-forms-renderer';
import useSmartClient from '../../../../../../hooks/useSmartClient.ts';
import CloseSnackbar from '../../../../../../components/Snackbar/CloseSnackbar.tsx';
import { TERMINOLOGY_SERVER_URL } from '../../../../../../globals.ts';

interface Props {
selectedResponse: QuestionnaireResponse | null;
Expand Down Expand Up @@ -112,7 +113,7 @@ function OpenResponseButton(props: Props) {
postQuestionnaireToSMARTHealthIT(smartClient, referencedQuestionnaire);
}

await buildForm(referencedQuestionnaire, selectedResponse);
await buildForm(referencedQuestionnaire, selectedResponse, undefined, TERMINOLOGY_SERVER_URL);

navigate('/viewer');
setIsLoading(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { useLocalStorage } from 'usehooks-ts';
import { buildForm, destroyForm } from '@aehrc/smart-forms-renderer';
import RendererDebugFooter from '../../renderer/components/RendererDebugFooter/RendererDebugFooter.tsx';
import CloseSnackbar from '../../../components/Snackbar/CloseSnackbar.tsx';
import { TERMINOLOGY_SERVER_URL } from '../../../globals.ts';

function Playground() {
const [jsonString, setJsonString] = useLocalStorage('playgroundJsonString', '');
Expand All @@ -52,7 +53,7 @@ function Playground() {
try {
const parsedQuestionnaire = JSON.parse(jsonString);
if (isQuestionnaire(parsedQuestionnaire)) {
await buildForm(parsedQuestionnaire);
await buildForm(parsedQuestionnaire, undefined, undefined, TERMINOLOGY_SERVER_URL);
setBuildingState('built');
} else {
enqueueSnackbar('JSON string does not represent a questionnaire', {
Expand Down Expand Up @@ -92,7 +93,7 @@ function Playground() {
const jsonString = event.target?.result;
if (typeof jsonString === 'string') {
setJsonString(jsonString);
await buildForm(JSON.parse(jsonString));
await buildForm(JSON.parse(jsonString), undefined, undefined, TERMINOLOGY_SERVER_URL);
setBuildingState('built');
} else {
enqueueSnackbar('There was an issue with the attached JSON file.', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { useQuestionnaireStore } from '@aehrc/smart-forms-renderer';
import useAuthRedirectHook from '../hooks/useAuthRedirectHook.ts';
import useSmartClient from '../../../hooks/useSmartClient.ts';
import CloseSnackbar from '../../../components/Snackbar/CloseSnackbar.tsx';
import { TERMINOLOGY_SERVER_URL } from '../../../globals.ts';

function authReducer(state: AuthState, action: AuthActions): AuthState {
switch (action.type) {
Expand Down Expand Up @@ -130,7 +131,12 @@ function Authorisation() {
postQuestionnaireToSMARTHealthIT(client, questionnaire);
}

await buildSourceQuestionnaire(questionnaire);
await buildSourceQuestionnaire(
questionnaire,
undefined,
undefined,
TERMINOLOGY_SERVER_URL
);
setQuestionnaireLaunchContext(questionnaire);
dispatch({ type: 'UPDATE_HAS_QUESTIONNAIRE', payload: true });
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type { ReactNode } from 'react';
import { useEffect, useState } from 'react';
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
import { buildForm } from '@aehrc/smart-forms-renderer';
import { TERMINOLOGY_SERVER_URL } from '../../globals.ts';

interface BaseRendererWrapperProps {
children: ReactNode;
Expand All @@ -33,7 +34,7 @@ function BaseRendererWrapper(props: BaseRendererWrapperProps) {

useEffect(() => {
setLoading(true);
buildForm(questionnaire, questionnaireResponse).then(() => {
buildForm(questionnaire, questionnaireResponse, undefined, TERMINOLOGY_SERVER_URL).then(() => {
setLoading(false);
});
}, [questionnaire, questionnaireResponse]);
Expand Down
2 changes: 1 addition & 1 deletion documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"typecheck": "tsc"
},
"dependencies": {
"@aehrc/smart-forms-renderer": "^0.33.0",
"@aehrc/smart-forms-renderer": "^0.33.1",
"@docusaurus/core": "3.3.2",
"@docusaurus/preset-classic": "3.3.2",
"@docusaurus/theme-live-codeblock": "^3.3.2",
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/sdc-populate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aehrc/sdc-populate",
"version": "2.1.0",
"version": "2.2.0",
"description": "Performs the $populate operation from the HL7 FHIR SDC (Structured Data Capture) specification: http://hl7.org/fhir/uv/sdc",
"main": "lib/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ function constructResponseItemRecursive(
populationExpressions,
valueSetPromises,
answerOptions,
containedValueSets
containedValueSets,
terminologyCallback,
terminologyRequestConfig
);
}

Expand Down Expand Up @@ -240,7 +242,9 @@ function constructResponseItemRecursive(
populationExpressions,
valueSetPromises,
answerOptions,
containedValueSets
containedValueSets,
terminologyCallback,
terminologyRequestConfig
});
}

Expand Down Expand Up @@ -329,7 +333,7 @@ interface ConstructSingleItemParams {
valueSetPromises: Record<string, ValueSetPromise>;
answerOptions: Record<string, QuestionnaireItemAnswerOption[]>;
containedValueSets: Record<string, ValueSet>;
terminologyCallback?: FetchResourceCallback;
terminologyCallback?: FetchResourceCallback | undefined;
terminologyRequestConfig?: any;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/smart-forms-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aehrc/smart-forms-renderer",
"version": "0.33.0",
"version": "0.33.1",
"description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
"main": "lib/index.js",
"scripts": {
Expand All @@ -27,7 +27,7 @@
},
"homepage": "https://github.com/aehrc/smart-forms#readme",
"dependencies": {
"@aehrc/sdc-populate": "^2.1.0",
"@aehrc/sdc-populate": "^2.2.0",
"@iconify/react": "^4.1.1",
"dayjs": "^1.11.10",
"deep-diff": "^1.0.2",
Expand Down

0 comments on commit 4c0be86

Please sign in to comment.