Skip to content

Commit

Permalink
Merge pull request #903 from aehrc/main
Browse files Browse the repository at this point in the history
Merging main into acdc-pilot
  • Loading branch information
fongsean authored Jul 5, 2024
2 parents a3a0cf6 + e5f8ba1 commit 5dfdc4d
Show file tree
Hide file tree
Showing 92 changed files with 38,286 additions and 469 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Smart Forms Workflow
name: Smart Forms Build-Test-Lint Workflow

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Smart Forms App S3 Deployment Workflow
name: Smart Forms App Deployment Workflow

on:
push:
Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@ name: Smart Forms Docs Deployment Workflow

on:
push:
branches: ['main']

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy-docusaurus:
name: Deploy Docusaurus to GitHub Pages
environment:
name: github-pages
url: ${{ steps.build-publish.outputs.page_url }}

deploy-docusaurus-s3:
name: Deploy Docusaurus to S3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,20 +21,20 @@ jobs:
node-version: 18
cache: npm

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::209248795938:role/SmartFormsReactAppDeployment
aws-region: ap-southeast-2

- name: Install dependencies
run: npm ci

- name: Build documentation website
run: npm run build -w documentation

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: documentation/build

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Upload static Docusaurus site to S3
run: aws s3 sync documentation/build s3://smart-forms-docs/docs

deploy-storybook:
name: Deploy Storybook to S3
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<h4>
Powered by SMART on FHIR and Structured Data Capture, Smart Forms allow you to easily integrate forms into your existing healthcare system.
</h4>

[![NPM](https://badge.fury.io/js/@aehrc%2Fsmart-forms-renderer.svg)](https://www.npmjs.com/package/@aehrc/smart-forms-renderer)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/aehrc/smart-forms?tab=Apache-2.0-1-ov-file#readme)

<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>
Expand Down
52 changes: 27 additions & 25 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.

2 changes: 1 addition & 1 deletion apps/demo-renderer-app/src/utils/populateInputParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function createCanonicalParam(canonicalUrl: string): ParametersParameter {
}

// setting local parameter as false as we are calling $populate with an NPM package, not a server
// package doesn't contain any fhir resources to "know" the context from
// the package doesn't contain any fhir resources to "know" the context from
function createLocalParam(): ParametersParameter {
return {
name: 'local',
Expand Down
12 changes: 6 additions & 6 deletions apps/smart-forms-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
},
"homepage": "https://github.com/aehrc/smart-forms#readme",
"dependencies": {
"@aehrc/sdc-assemble": "^1.2.0",
"@aehrc/sdc-populate": "^2.2.3",
"@aehrc/smart-forms-renderer": "^0.35.8",
"@aehrc/sdc-assemble": "^1.3.1",
"@aehrc/sdc-populate": "^2.2.7",
"@aehrc/smart-forms-renderer": "^0.35.9",
"@emotion/react": "^11.11.4",
"@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",
"@monaco-editor/react": "^4.6.0",
"@mui/icons-material": "^5.15.13",
"@mui/icons-material": "^5.15.20",
"@mui/lab": "^5.0.0-alpha.151",
"@mui/material": "^5.15.15",
"@mui/material": "^5.15.20",
"@mui/x-date-pickers": "^6.10.1",
"@sentry/react": "^7.73.0",
"@sentry/tracing": "^7.101.0",
Expand All @@ -53,7 +53,7 @@
"lodash.debounce": "^4.0.8",
"lodash.filter": "^4.6.0",
"lodash.isequal": "^4.5.0",
"material-ui-popup-state": "^5.0.10",
"material-ui-popup-state": "^5.1.2",
"moment": "^2.30.1",
"monaco-editor": "^0.47.0",
"nanoid": "^5.0.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import type { Patient, Practitioner, Questionnaire } from 'fhir/r4';
import PlaygroundHeader from './PlaygroundHeader.tsx';
import { HEADERS } from '../../../api/headers.ts';
import { fetchTargetStructureMap } from '../api/extract.ts';
import { useExtractOperationStore } from '../stores/smartConfigStore.ts';
import { useExtractOperationStore } from '../stores/extractOperationStore.ts';

const defaultFhirServerUrl = 'https://hapi.fhir.org/baseR4';
const defaultExtractEndpoint = 'https://proxy.smartforms.io/fhir';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Box, Typography } from '@mui/material';
import useLaunchContextNames from '../hooks/useLaunchContextNames.ts';
import { TERMINOLOGY_SERVER_URL } from '../../../globals.ts';
import ExtractButtonForPlayground from './ExtractButtonForPlayground.tsx';
import { useExtractOperationStore } from '../stores/smartConfigStore.ts';
import { useExtractOperationStore } from '../stores/extractOperationStore.ts';

interface PlaygroundRendererProps {
endpointUrl: string | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { useExtractOperationStore } from '../stores/smartConfigStore.ts';
import { useExtractOperationStore } from '../stores/extractOperationStore.ts';

function useShowExtractedOperationStoreProperty(selectedProperty: string) {
const extractedResource = useExtractOperationStore.use.extractedResource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import { createStore } from 'zustand/vanilla';
import type { StructureMap } from 'fhir/r4';
import { createSelectors } from './selector';
import { createSelectors } from '../../../stores/selector.ts';

export interface ExtractOperationStoreType {
targetStructureMap: StructureMap | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ import type { SpeedDialActionProps } from '@mui/material';
import { SpeedDialAction, Tooltip } from '@mui/material';
import type { RendererSpinner } from '../../types/rendererSpinner.ts';
import useSmartClient from '../../../../hooks/useSmartClient.ts';
import type { ItemToRepopulate } from '@aehrc/smart-forms-renderer';
import { generateItemsToRepopulate, useQuestionnaireStore } from '@aehrc/smart-forms-renderer';
import RepopulateDialog from '../../../repopulate/components/RepopulateDialog.tsx';
import { useState } from 'react';
import type { Encounter, Patient, Practitioner } from 'fhir/r4';
import { useMutation } from '@tanstack/react-query';
import { readCommonLaunchContexts } from '../../../smartAppLaunch/utils/launch.ts';
import { useRepopulationStore } from '../../../repopulate/stores/RepopulationStore.ts';

interface RepopulateActionProps extends SpeedDialActionProps {
spinner: RendererSpinner;
Expand All @@ -43,7 +42,7 @@ function RepopulateAction(props: RepopulateActionProps) {

const { smartClient, patient, user } = useSmartClient();

const [itemsToRepopulate, setItemsToRepopulate] = useState<Record<string, ItemToRepopulate>>({});
const setItemsToRepopulate = useRepopulationStore.use.setItemsToRepopulate();

const sourceQuestionnaire = useQuestionnaireStore.use.sourceQuestionnaire();
const fhirPathContext = useQuestionnaireStore.use.fhirPathContext();
Expand Down Expand Up @@ -175,7 +174,6 @@ function RepopulateAction(props: RepopulateActionProps) {

<RepopulateDialog
repopulateFetchingEnded={repopulateFetchEnded}
itemsToRepopulate={itemsToRepopulate}
onCloseDialog={() => onSpinnerChange({ isSpinning: false, status: null, message: '' })}
onSpinnerChange={onSpinnerChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@
* limitations under the License.
*/

import type { ItemToRepopulate } from '@aehrc/smart-forms-renderer';
import RepopulateEmptyDialog from './RepopulateEmptyDialog.tsx';
import RepopulateSelectDialog from './RepopulateSelectDialog.tsx';
import type { RendererSpinner } from '../../renderer/types/rendererSpinner.ts';
import { useRepopulationStore } from '../stores/RepopulationStore.ts';

interface RepopulateDialogProps {
repopulateFetchingEnded: boolean;
itemsToRepopulate: Record<string, ItemToRepopulate>;
onCloseDialog: () => void;
onSpinnerChange: (newSpinner: RendererSpinner) => void;
}

function RepopulateDialog(props: RepopulateDialogProps) {
const { repopulateFetchingEnded, itemsToRepopulate, onCloseDialog, onSpinnerChange } = props;
const { repopulateFetchingEnded, onCloseDialog, onSpinnerChange } = props;

const itemsToRepopulate = useRepopulationStore.use.itemsToRepopulate();

if (!repopulateFetchingEnded) {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2024 Commonwealth Scientific and Industrial Research
* Organisation (CSIRO) ABN 41 687 119 230.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { createStore } from 'zustand/vanilla';
import { createSelectors } from '../../../stores/selector.ts';
import type { ItemToRepopulate } from '@aehrc/smart-forms-renderer';

export interface RepopulationStoreType {
itemsToRepopulate: Record<string, ItemToRepopulate>;
setItemsToRepopulate: (itemsToRepopulate: Record<string, ItemToRepopulate>) => void;
}

export const RepopulationStore = createStore<RepopulationStoreType>()((set) => ({
itemsToRepopulate: {},
setItemsToRepopulate: (itemsToRepopulate: Record<string, ItemToRepopulate>) =>
set(() => ({ itemsToRepopulate: itemsToRepopulate }))
}));

export const useRepopulationStore = createSelectors(RepopulationStore);
File renamed without changes.
Loading

0 comments on commit 5dfdc4d

Please sign in to comment.