Skip to content

Commit

Permalink
Merge pull request #868 from aehrc/main
Browse files Browse the repository at this point in the history
Merging main into acdc-pilot
  • Loading branch information
fongsean authored Jun 14, 2024
2 parents c02cb67 + e224880 commit 789ad65
Show file tree
Hide file tree
Showing 26 changed files with 2,414 additions and 4,054 deletions.
12 changes: 12 additions & 0 deletions apps/smart-forms-app/e2e/prepop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,16 @@ test('pre-pop to test terminology resolving logic', async ({ page }) => {
.getByTestId('q-item-choice-select-answer-value-set-box')
.locator(`#${genderAvsContainedValueLinkId}`)
).toHaveValue('Female');

const medicalHistoryConditionValueLinkId = 'medical-history-condition';

const elements = await page.locator(`#${medicalHistoryConditionValueLinkId}`).all();
for (const element of elements) {
const inputValue = await element.inputValue();

// Test if the input values contains at least one alphabetic character
// If it's fully numeric, it means the valueCoding.code is pre-populated instead of valueCoding.display
// the logic in sdc-populate, automatically $lookup and assigns display to codings that lack them, which means that part is failing in this case
expect(/^\d+$/.test(inputValue)).toBeFalsy();
}
});
5 changes: 2 additions & 3 deletions apps/smart-forms-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"homepage": "https://github.com/aehrc/smart-forms#readme",
"dependencies": {
"@aehrc/sdc-assemble": "^1.2.0",
"@aehrc/sdc-populate": "^2.2.1",
"@aehrc/smart-forms-renderer": "^0.35.5",
"@aehrc/sdc-populate": "^2.2.2",
"@aehrc/smart-forms-renderer": "^0.35.6",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fontsource/material-icons": "^5.0.16",
Expand All @@ -47,7 +47,6 @@
"allotment": "^1.20.2",
"dayjs": "^1.11.10",
"fhirclient": "^2.5.2",
"fhirpath": "^3.7.1",
"he": "^1.2.0",
"html-react-parser": "4.2.10",
"lodash.clonedeep": "^4.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import cloneDeep from 'lodash.clonedeep';

interface RepopulateGridGroupProps {
qItem: QuestionnaireItem;
newQRItem: QuestionnaireResponseItem;
newQRItem?: QuestionnaireResponseItem;
oldQRItem?: QuestionnaireResponseItem;
}

Expand All @@ -34,7 +34,8 @@ function RepopulateGridGroup(props: RepopulateGridGroupProps) {
oldQRItem ??
cloneDeep({
...newQRItem,
item: newQRItem.item?.map((item) => ({
linkId: newQRItem?.linkId ?? '',
item: newQRItem?.item?.map((item) => ({
...item,
item: item.item?.map((subItem) => ({
...subItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { GroupTable } from '@aehrc/smart-forms-renderer';

interface RepopulateRepeatGroupProps {
qItem: QuestionnaireItem;
newQRItems: QuestionnaireResponseItem[];
newQRItems?: QuestionnaireResponseItem[];
oldQRItems?: QuestionnaireResponseItem[];
}

Expand Down Expand Up @@ -49,7 +49,7 @@ function RepopulateGroupTable(props: RepopulateRepeatGroupProps) {
</Typography>
<GroupTable
qItem={qItem}
qrItems={newQRItems}
qrItems={newQRItems ?? []}
groupCardElevation={1}
showMinimalView={true}
parentIsReadOnly={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import RepopulateGridGroup from './RepopulateGridGroup.tsx';

interface RepopulateItemSwitcherProps {
qItem: QuestionnaireItem;
newQRItem: QuestionnaireResponseItem;
newQRItem?: QuestionnaireResponseItem;
oldQRItem?: QuestionnaireResponseItem;
newQRItems: QuestionnaireResponseItem[];
newQRItems?: QuestionnaireResponseItem[];
oldQRItems?: QuestionnaireResponseItem[];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import RepopulateItemSwitcher from './RepopulateItemSwitcher.tsx';
interface RepopulateListItemProps {
checkedIds: string[];
qItem: QuestionnaireItem;
newQRItem: QuestionnaireResponseItem;
newQRItem?: QuestionnaireResponseItem;
oldQRItem?: QuestionnaireResponseItem;
newQRItems: QuestionnaireResponseItem[];
newQRItems?: QuestionnaireResponseItem[];
oldQRItems?: QuestionnaireResponseItem[];
onCheckItem: () => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { RepeatGroup } from '@aehrc/smart-forms-renderer';

interface RepopulateRepeatGroupProps {
qItem: QuestionnaireItem;
newQRItems: QuestionnaireResponseItem[];
newQRItems?: QuestionnaireResponseItem[];
oldQRItems?: QuestionnaireResponseItem[];
}

Expand Down Expand Up @@ -49,7 +49,7 @@ function RepopulateRepeatGroup(props: RepopulateRepeatGroupProps) {
</Typography>
<RepeatGroup
qItem={qItem}
qrItems={newQRItems}
qrItems={newQRItems ?? []}
groupCardElevation={1}
showMinimalView={true}
parentIsReadOnly={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { RepeatItem } from '@aehrc/smart-forms-renderer';
interface RepopulateRepeatItemProps {
qItem: QuestionnaireItem;
oldQRItem?: QuestionnaireResponseItem;
newQRItem: QuestionnaireResponseItem;
newQRItem?: QuestionnaireResponseItem;
}

function RepopulateRepeatItem(props: RepopulateRepeatItemProps) {
Expand Down Expand Up @@ -53,7 +53,7 @@ function RepopulateRepeatItem(props: RepopulateRepeatItemProps) {
</Typography>
<RepeatItem
qItem={qItem}
qrItem={newQRItem}
qrItem={newQRItem ?? null}
groupCardElevation={1}
showMinimalView={true}
onQrItemChange={() => void 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
interface RepopulateSingleItemProps {
qItem: QuestionnaireItem;
oldQRItem?: QuestionnaireResponseItem;
newQRItem: QuestionnaireResponseItem;
newQRItem?: QuestionnaireResponseItem;
}

function RepopulateSingleItem(props: RepopulateSingleItemProps) {
Expand Down Expand Up @@ -58,7 +58,7 @@ function RepopulateSingleItem(props: RepopulateSingleItemProps) {
</Typography>
<SingleItem
qItem={qItem}
qrItem={newQRItem}
qrItem={newQRItem ?? null}
isRepeated={true}
isTabled={false}
groupCardElevation={1}
Expand Down
Loading

0 comments on commit 789ad65

Please sign in to comment.