Skip to content

Commit a0d6f15

Browse files
authored
Merge branch 'main' into subject-id-fix
2 parents 5ac88b1 + c26feeb commit a0d6f15

File tree

8 files changed

+16
-9
lines changed

8 files changed

+16
-9
lines changed

apps/api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ COPY --from=installer /app/apps/api/dist/runtime/ /runtime/
3131
RUN echo '{ "type": "module", "imports": { "#runtime/v1/*": "./dist/runtime/v1/*" } }' > package.json
3232
RUN echo '{ "type": "module" }' > /runtime/package.json
3333
USER node
34-
CMD [ "node", "./dist/app.js" ]
34+
CMD [ "node", "--enable-source-maps", "./dist/app.js" ]

apps/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@douglasneuroinformatics/libcrypto": "catalog:",
1919
"@douglasneuroinformatics/libjs": "catalog:",
20-
"@douglasneuroinformatics/libnest": "^5.3.0",
20+
"@douglasneuroinformatics/libnest": "^5.3.1",
2121
"@douglasneuroinformatics/libpasswd": "catalog:",
2222
"@douglasneuroinformatics/libstats": "catalog:",
2323
"@faker-js/faker": "^9.4.0",

apps/api/src/instrument-records/instrument-records.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Model } from '@douglasneuroinformatics/libnest';
44
import { linearRegression } from '@douglasneuroinformatics/libstats';
55
import { Injectable, UnprocessableEntityException } from '@nestjs/common';
66
import type { ScalarInstrument } from '@opendatacapture/runtime-core';
7+
import { DEFAULT_GROUP_NAME } from '@opendatacapture/schemas/core';
78
import type {
89
CreateInstrumentRecordData,
910
InstrumentRecord,
@@ -158,6 +159,8 @@ export class InstrumentRecordsService {
158159
sessionId: record.session.id,
159160
sessionType: record.session.type,
160161
subjectAge: record.subject.dateOfBirth ? yearsPassed(record.subject.dateOfBirth) : null,
162+
// eslint-disable-next-line perfectionist/sort-objects
163+
groupId: record.subject.groupIds[0] ?? DEFAULT_GROUP_NAME,
161164
subjectId: record.subject.id,
162165
subjectSex: record.subject.sex,
163166
timestamp: record.date.toISOString(),

apps/web/src/features/session/components/StartSessionForm/StartSessionForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { Form } from '@douglasneuroinformatics/libui/components';
44
import { useTranslation } from '@douglasneuroinformatics/libui/hooks';
55
import type { FormTypes } from '@opendatacapture/runtime-core';
6+
import { DEFAULT_GROUP_NAME } from '@opendatacapture/schemas/core';
67
import type { Group } from '@opendatacapture/schemas/group';
78
import { $SessionType } from '@opendatacapture/schemas/session';
89
import type { CreateSessionData } from '@opendatacapture/schemas/session';
@@ -253,7 +254,7 @@ export const StartSessionForm = ({ currentGroup, initialValues, readOnly, onSubm
253254
});
254255
} else {
255256
subjectId = encodeScopedSubjectId(subjectId, {
256-
groupName: currentGroup?.name ?? 'root'
257+
groupName: currentGroup?.name ?? DEFAULT_GROUP_NAME
257258
});
258259
}
259260
await onSubmit({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "opendatacapture",
33
"type": "module",
4-
"version": "1.10.1",
4+
"version": "1.10.2",
55
"private": true,
66
"packageManager": "[email protected]",
77
"license": "Apache-2.0",

packages/schemas/src/core/core.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import type { Json, JsonLiteral, Language } from '@opendatacapture/runtime-core'
66
import type { Simplify } from 'type-fest';
77
import { z } from 'zod';
88

9+
export const DEFAULT_GROUP_NAME = 'root';
10+
911
export type AppAction = z.infer<typeof $AppAction>;
1012
export const $AppAction = z.enum(['create', 'delete', 'manage', 'read', 'update']);
1113

packages/schemas/src/instrument-records/instrument-records.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const $InstrumentRecord = $BaseModel.extend({
4545
export type InstrumentRecord = z.infer<typeof $InstrumentRecord>;
4646

4747
export type InstrumentRecordsExport = {
48+
groupId: string;
4849
instrumentEdition: number;
4950
instrumentName: string;
5051
measure: string;

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)