Skip to content

Commit 73957b7

Browse files
Add ClinicalTrialLocation
1 parent 8dae5e0 commit 73957b7

4 files changed

Lines changed: 40 additions & 4 deletions

File tree

src/definitions/ontology.ts

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as util from '../util';
2-
import { EXPOSE_READ, PERMISSIONS } from '../constants';
2+
import { EXPOSE_NONE, EXPOSE_READ, PERMISSIONS } from '../constants';
33
import { BASE_PROPERTIES } from './util';
44
import { PartialSchemaDefn } from '../types';
55

@@ -125,6 +125,38 @@ const models: PartialSchemaDefn = {
125125
},
126126
],
127127
},
128+
ClinicalTrialLocation: {
129+
description: 'Location of a ClinicalTrial',
130+
routes: EXPOSE_NONE,
131+
embedded: true,
132+
properties: [
133+
{
134+
name: 'city',
135+
type: 'string',
136+
nullable: true,
137+
mandatory: false,
138+
},
139+
{
140+
name: 'state',
141+
type: 'string',
142+
nullable: true,
143+
mandatory: false,
144+
},
145+
{
146+
name: 'country',
147+
type: 'string',
148+
nullable: true,
149+
mandatory: false,
150+
},
151+
{
152+
name: 'comment',
153+
type: 'string',
154+
nullable: true,
155+
mandatory: false,
156+
},
157+
],
158+
isAbstract: true,
159+
},
128160
ClinicalTrial: {
129161
inherits: ['Evidence', 'Ontology'],
130162
properties: [
@@ -136,8 +168,9 @@ const models: PartialSchemaDefn = {
136168
{
137169
name: 'completionDate', type: 'string', format: 'date', pattern: '^\\d{4}(-\\d{2}(-\\d{2})?)?$',
138170
},
139-
{ name: 'country', type: 'string', description: 'The country the trial is held in' },
140-
{ name: 'city', type: 'string', description: 'The city the trial is held in' },
171+
{
172+
name: 'location', type: 'embeddedlist', linkedClass: 'ClinicalTrialLocation', description: 'The location the trial is held in',
173+
},
141174
{
142175
name: 'recruitmentStatus',
143176
type: 'string',

src/definitions/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import isEmail from 'validator/lib/isEmail';
22

33
import * as util from '../util';
44
import { ValidationError } from '../error';
5-
import { EXPOSE_NONE, PERMISSIONS } from '../constants';
5+
import { PERMISSIONS } from '../constants';
66
import { BASE_PROPERTIES, activeUUID } from './util';
77
import { PartialSchemaDefn } from '../types';
88

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export type VertexName = (
6767
export type EmbeddedVertexName = (
6868
'Position'
6969
| 'CdsPosition'
70+
| 'ClinicalTrialLocation'
7071
| 'CytobandPosition'
7172
| 'ExonicPosition'
7273
| 'GenomicPosition'

test/schema.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ test('splitClassLevels', () => {
251251
],
252252
[
253253
'Biomarker',
254+
'ClinicalTrialLocation',
254255
'Evidence',
255256
'LicenseAgreement',
256257
'Permissions',
@@ -458,6 +459,7 @@ test.each([
458459
['Permissions', { default: 0, readonly: 4 }],
459460
['Ontology', { default: 4, readonly: 4 }],
460461
['EvidenceLevel', { default: 15, readonly: 4 }],
462+
['ClinicalTrialLocation', { default: 0, readonly: 4 }],
461463
['ClinicalTrial', { default: 15, readonly: 4 }],
462464
['Abstract', { default: 15, readonly: 4 }],
463465
['Publication', { default: 15, readonly: 4 }],

0 commit comments

Comments
 (0)