diff --git a/lib/forms/CoBraLab-Mouse-Origin-Form/index.ts b/lib/forms/CoBraLab-Mouse-Origin-Form/index.ts index a3ac64c6..5a0377d0 100644 --- a/lib/forms/CoBraLab-Mouse-Origin-Form/index.ts +++ b/lib/forms/CoBraLab-Mouse-Origin-Form/index.ts @@ -8,7 +8,7 @@ export default defineInstrument({ language: 'en', tags: ['Birth', 'Mouse','Origin'], internal: { - edition: 1, + edition: 2, name: 'MOUSE_ORIGIN_FORM' }, content: { @@ -33,12 +33,10 @@ export default defineInstrument({ mouseStrain: { kind: "string", variant: "select", - label: "Mouse strain", + label: "Mouse Strain", options: { - "M86-hemi": "M86-hemi", - "M83-homo": "M83-homo", + "M83": "M83", "C57BL/6J": "C57BL/6J", - "Wild type": "Wild type", "5XFAD": "5XFAD", "3xTG-AD": "3xTG-AD", "Other":"Other" @@ -57,6 +55,34 @@ export default defineInstrument({ } return null } + }, + mouseGenotype: { + kind: "string", + variant: "select", + label: "Mouse Genotype", + options: { + "Hemizygous": "Hemizygous", + "Homozygous": "Homozygous", + "Heterozygous": "Heterozygous", + "Wild-type": "Wild-type", + "Other": "Other" + } + }, + mouseGenotypeOther: { + kind: "dynamic", + deps: ["mouseGenotype"], + render(data) { + if(data.mouseGenotype === "Other"){ + return { + kind : "string", + variant: "input", + label: "Other Genotype" + } + } + return null + } + + }, boxMouse: { kind: 'boolean', @@ -112,11 +138,39 @@ export default defineInstrument({ return null } }, - motherMouse: { + breedingCageId: { kind: 'dynamic', deps: ['boxMouse'], render(data) { if(data.boxMouse === false){ + return { + kind: 'string', + variant: 'input', + label: "Breeding Cage ID" + } + } + return null + } + }, + motherKnown: { + kind: 'dynamic', + deps: ['boxMouse'], + render(data) { + if(data.boxMouse === false){ + return { + kind: 'boolean', + variant: 'radio', + label: "Is the mother known?" + } + } + return null + } + }, + motherMouse: { + kind: 'dynamic', + deps: ['boxMouse','motherKnown'], + render(data) { + if(data.boxMouse === false && data.motherKnown){ return { kind: "string", variant: "input", @@ -139,11 +193,10 @@ export default defineInstrument({ } return null } - }, fatherMouse: { kind: 'dynamic', - deps: ['fatherKnown'], + deps: ['boxMouse','fatherKnown'], render(data) { if(data.boxMouse === false && data.fatherKnown){ return { @@ -196,6 +249,16 @@ export default defineInstrument({ label: 'Other Strain', ref: 'otherStrain' }, + mouseGenotype: { + kind: 'const', + label: 'Mouse Genotype', + ref: 'mouseGenotype' + }, + mouseGenotypeOther: { + kind: 'const', + label: 'Other Genotype', + ref: 'mouseGenotypeOther' + }, boxMouse: { kind: 'const', label: 'Imported mouse', @@ -216,6 +279,16 @@ export default defineInstrument({ label: 'Other Breeder', ref: 'otherBreederOrigin' }, + breedingCageId: { + kind: "const", + label: 'Breeding cage ID', + ref: 'breedingCageId' + }, + motherKnown: { + kind: 'const', + label: 'Mother known', + ref: 'motherKnown' + }, motherMouse: { kind: 'const', label: 'Mother of mouse', @@ -243,16 +316,24 @@ export default defineInstrument({ cohortId: z.string().optional(), boxMouse: z.boolean(), mouseStrain: z.enum([ - 'M86-hemi', - 'M83-homo', + 'M83', 'C57BL/6J', - 'Wild type', '5XFAD', '3xTG-AD', 'Other' ]), otherStrain: z.string().optional(), + mouseGenotype: z.enum([ + 'Homozygous', + 'Hemizygous', + 'Heterozygous', + 'Wild-type', + 'Other' + ]), + mouseGenotypeOther: z.string().optional(), orderId: z.string().optional(), + breedingCageId: z.string().optional(), + motherKnown: z.boolean().optional(), motherMouse: z.string().optional(), fatherKnown: z.boolean().optional(), fatherMouse: z.string().optional(),