Skip to content

Commit

Permalink
add anesthesia adminitration type
Browse files Browse the repository at this point in the history
  • Loading branch information
david-roper committed Feb 14, 2025
1 parent 713bc51 commit cb1df93
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"Immunofluorescence",
"Immunohistochemistry",
"Intracerebral",
"Intraperitoneal",
"isoflurane",
"rotarod",
"wirehang"
Expand Down
29 changes: 27 additions & 2 deletions lib/forms/CoBrALab-Mouse-Surgery-Form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,31 @@ export default defineInstrument({
label: "Anesthesia used"
}, (type) => type === "Surgery" || type === "Re-stitching" || type === "Intracerebral injection"),

anesthesiaAdministrationType: {
kind: "dynamic",
deps: ["anesthesiaUsed"],
render(data) {
if(data.anesthesiaUsed){
return {
kind: "string",
variant: "select",
label: "Anesthesia administration type",
options: {
"Inhalation": "Inhalation",
"Intraperitoneal":"Intraperitoneal",
"Intravenous": "Intravenous"
}
}
}
return null
}
},

anesthesiaVolume: {
kind: "dynamic",
deps: ["anesthesiaUsed"],
deps: ["anesthesiaUsed","anesthesiaAdministrationType"],
render(data) {
if(data.anesthesiaUsed){
if(data.anesthesiaUsed && data.anesthesiaAdministrationType !== "Inhalation"){
return {
kind: "number",
variant: "input",
Expand Down Expand Up @@ -352,6 +372,10 @@ export default defineInstrument({
kind: "const",
ref: "anesthesiaType"
},
anesthesiaAdministrationType:{
kind: "const",
ref: "anesthesiaAdministrationType"
},
anesthesiaVolume: {
kind: "const",
ref: "anesthesiaVolume"
Expand Down Expand Up @@ -436,6 +460,7 @@ export default defineInstrument({
analgesiaVolume: z.number().min(0).optional(),
anesthesiaUsed: z.boolean().optional(),
anesthesiaType: z.string().optional(),
anesthesiaAdministrationType: z.enum(["Inhalation", "Intraperitoneal", "Intravenous"]),
anesthesiaVolume: z.number().min(0).optional(),
anesthesiaRecoveryTime: z.number().min(0).int().optional(),
hydrationProvided: z.boolean().optional(),
Expand Down

0 comments on commit cb1df93

Please sign in to comment.