Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse end of life form #18

Merged
merged 42 commits into from
Jan 21, 2025
Merged
Changes from 4 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c35016f
create mouse eol form file
david-roper Jul 4, 2024
b7ca4f3
added base form
david-roper Jul 4, 2024
5b2afef
add name and title
david-roper Jul 5, 2024
941986d
added desc and tags
david-roper Jul 22, 2024
cfbf2f1
add termination kind question
david-roper Jul 22, 2024
2821991
added body extraction section
david-roper Jul 22, 2024
236d457
add body part storage questions
david-roper Jul 22, 2024
e9717d8
fix captilization
david-roper Jul 22, 2024
3b14c80
refactor body extraction questions to record-array
david-roper Jul 23, 2024
d972c0a
added deep freeze as storage option
david-roper Jul 24, 2024
1798e31
fix quotations and make extraction questions dependent
david-roper Jul 24, 2024
d262f5e
added liver to extraction option
david-roper Jul 24, 2024
459d81e
Added dependent extraction motive questions
david-roper Jul 24, 2024
bef9744
converting createdependentfield to use termination type
david-roper Jul 25, 2024
87bf23c
add perfusion dose question
david-roper Jul 26, 2024
119beb5
make perfusion dose dependent on perfusion type
david-roper Jul 26, 2024
76c0180
add questions for cervical dislocation
david-roper Jul 26, 2024
31294d4
fix gestational date question
david-roper Jul 26, 2024
a284916
added non record array measures
david-roper Jul 26, 2024
85c0152
start computed measurement for record-array question
david-roper Jul 26, 2024
5d1a31d
computed measure for body extraction info
david-roper Jul 29, 2024
80e8171
add pfa batch and expiration to brain extraction
david-roper Jul 30, 2024
a191dac
add tail option to body part extraction
david-roper Jul 30, 2024
7c628cf
ex-vivo mri and histology options to brain extraction
david-roper Jul 30, 2024
c1e5ad1
remove unneeded fridge storage id
david-roper Jul 30, 2024
83c2057
add perfusion flushing questions
david-roper Jul 30, 2024
3087a71
added cervical dislocation questions
david-roper Jul 30, 2024
c2de8f7
make sure perfusion dose and blood collected are number inputs
david-roper Jul 31, 2024
00bb696
made blood collected just for cardiac puncture
david-roper Aug 12, 2024
6d4a184
made termination type dynamic, added surgery death cause
david-roper Aug 15, 2024
3fb4c0e
removed float workaround
david-roper Aug 16, 2024
729ce4e
fixing defineInstrument import
david-roper Aug 19, 2024
d660082
update zod import
david-roper Aug 23, 2024
263d7cf
fix createdependentfield warnings
david-roper Aug 27, 2024
fc0a566
remove embryoPresent question
david-roper Aug 27, 2024
3c20412
better names for perfusion anethetic
david-roper Aug 27, 2024
07e16bc
make perfusion solution always show when perfusion option selected
david-roper Aug 27, 2024
063d48b
remove gestational day
david-roper Oct 11, 2024
c1ed569
add license
david-roper Oct 11, 2024
ef554c2
create terminationtype for createdependentField and terminationtype enum
david-roper Oct 15, 2024
b69fb78
change all string select fields to enum fields
david-roper Oct 15, 2024
61b9087
add client details to form
david-roper Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 23 additions & 57 deletions lib/forms/CoBrALab-Mouse-End-Of-Life-Form/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable perfectionist/sort-objects */

const { defineInstrument } = await import('/runtime/v1/@opendatacapture/runtime-core/index.js');
const { z } = await import('/runtime/v1/zod@3.23.x/index.js');
import { defineInstrument } from '/runtime/v1/@opendatacapture/runtime-core'
import { z } from '/runtime/v1/zod@3.23.x'

function createDependentField<T>(field: T, fn: (terminationType: string) => boolean) {
function createDependentField<const T>(field: T, fn: (terminationType: string) => boolean) {
return {
kind: 'dynamic' as const,
deps: ['terminationType'] as const,
Expand Down Expand Up @@ -100,33 +100,26 @@ export default defineInstrument({
},
(type) => type === 'Cardiac puncture'
),
embryoPresent: createDependentField({
kind: 'boolean',
variant: "radio",
label: "Embryo present"
},
(type) => type === 'Cervical dislocation'
),
gestationalDay: createDependentField({
kind: 'date',
label: "Gestational day"
},
(type) => type === 'Cervical dislocation'
),
perfusionType: createDependentField({
perfusionAnestheticType: createDependentField({
kind: "string",
variant: "select",
label: "Type of perfusion",
label: "Type of anesthetic used for perfusion",
options: {
"Ip Injection":"Ip Injection (Ketamine)",
"Gas": "Gas (Isoflurane)"
}
}, (type) => type === "Perfusion" ),
perfusionDose: {
ipAnestheticDose: {
kind: 'dynamic',
deps: ["perfusionType"],
deps: ["perfusionAnestheticType"],
render(data){
if(data.perfusionType === 'Ip Injection'){
if(data.perfusionAnestheticType === 'Ip Injection'){
return {
kind: 'number',
variant: "input",
Expand All @@ -136,32 +129,17 @@ export default defineInstrument({
return null
}
},
perfusionFlushingDone: createDependentField({
kind: "boolean",
variant: "radio",
label: "Flushing done"
},
(type) => type === "Perfusion"),

perfusionFlushingSolution: {
kind: "dynamic",
deps: ["perfusionFlushingDone"],
render(data){
if(data.perfusionFlushingDone){
return {
kind: "string",
variant: "radio",
label: "Perfusion flushing solution",
options: {
"PBS+Heparin":"PBS and Heparin",
"4% Isoflurane": "4% Isoflurane"
}
}
}
return null
}
perfusionFlushingSolution: createDependentField({
kind: "string",
variant: "radio",
label: "Perfusion flushing solution",
options: {
"PBS+Heparin":"PBS and Heparin",
"4% Isoflurane": "4% Isoflurane"
}
}, (type) => type === 'Perfusion'),

},
anesthesiaUsed: {
kind: 'boolean',
variant: 'radio',
Expand Down Expand Up @@ -320,30 +298,20 @@ export default defineInstrument({
label: "Blood collected (ml)",
ref: "bloodCollected"
},
embryoPresent: {
kind: "const",
label: "Embryo present",
ref: "embryoPresent"
},
gestationalDay: {
kind: "const",
label: "Gestational day",
ref: "gestationalDay"
},
perfusionType: {
perfusionAnestheticType: {
kind: "const",
label: "Type of perfusion",
ref: "perfusionType"
ref: "perfusionAnestheticType"
},
perfusionDose: {
ipAnestheticDose: {
kind: "const",
label: "Injection dose (ml)",
ref: "perfusionDose"
},
perfusionFlushingDone: {
kind: "const",
label: "Flushing done",
ref: "perfusionFlushingDone"
ref: "ipAnestheticDose"
},
perfusionFlushingSolution: {
kind: "const",
Expand Down Expand Up @@ -384,11 +352,9 @@ export default defineInstrument({
terminationType: z.string().optional(),
surgeryDeathCause: z.string().optional(),
bloodCollected: z.number().optional(),
embryoPresent: z.boolean().optional(),
gestationalDay: z.date().optional(),
david-roper marked this conversation as resolved.
Show resolved Hide resolved
perfusionType: z.string().optional(),
perfusionDose: z.number().optional(),
perfusionFlushingDone: z.boolean().optional(),
perfusionAnestheticType: z.string().optional(),
ipAnestheticDose: z.number().optional(),
perfusionFlushingSolution: z.string().optional(),
anesthesiaUsed: z.boolean(),
bodyExtractionDone: z.boolean(),
Expand Down