Skip to content
Snippets Groups Projects
Commit 2fdc83fa authored by Tadeusz Miesiąc's avatar Tadeusz Miesiąc
Browse files

feat(drug schema): added drug schema to models

parent 18e5b773
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!20Resolve MIN-57 "Feature/ connect drug search query"
import { z } from 'zod';
import { referenceSchema } from './referenceSchema';
import { targetSchema } from './targetSchema';
export const drugSchema = z.object({
/** identifier of the chemical */
id: z.string(),
name: z.string(),
description: z.string(),
/** list of synonyms */
synonyms: z.array(z.string()),
brandNames: z.array(z.string()),
/** does drug cross blood brain barrier */
bloodBrainBarrier: z.string(),
/** list of references */
references: z.array(referenceSchema),
/** list of targets */
targets: z.array(targetSchema),
});
import { z } from 'zod';
export const referenceSchema = z.object({
link: z.string(),
article: z.object({
title: z.string(),
authors: z.array(z.string()),
journal: z.string(),
year: z.number(),
link: z.string(),
pubmedId: z.string(),
citationCount: z.number(),
}),
type: z.string(),
resource: z.string(),
id: z.number(),
annotatorClassName: z.string(),
});
import { z } from 'zod';
export const targetElementSchema = z.object({
id: z.number(),
modelId: z.number(),
type: z.string(),
});
import { z } from 'zod';
export const targetParticipantSchema = z.object({
link: z.string(),
type: z.string(),
resource: z.string(),
id: z.number(),
annotatorClassName: z.string(),
});
import { z } from 'zod';
import { referenceSchema } from './referenceSchema';
import { targetElementSchema } from './targetElementSchema';
import { targetParticipantSchema } from './targetParticipantSchema';
export const targetSchema = z.object({
/** target name */
name: z.string(),
/** list of target references */
references: z.array(referenceSchema),
/** list of elements on the map associated with this target */
targetElements: z.array(targetElementSchema),
/** list of identifiers associated with this target */
targetParticipants: z.array(targetParticipantSchema),
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment