Skip to content

Instantly share code, notes, and snippets.

@zindel
Created April 8, 2016 13:11
Show Gist options
  • Save zindel/2a9047c97dad8bd5310868e47a59f29e to your computer and use it in GitHub Desktop.
Save zindel/2a9047c97dad8bd5310868e47a59f29e to your computer and use it in GitHub Desktop.
/do(
$date_collected := today(),
$collected_by := null(),
$volume_amount := null(),
$volume_unit := null(),
$concentration_amount := null(),
$concentration_unit := null(),
$individual := top(todo?id()=$todo).individual,
with($sample_data, do(
$id := insert(sample := {
individual := $individual,
sample_type := $sample_type,
date_collected := $date_collected,
collected_by := $collected_by,
}),
for($_tube := $tube, with($_tube, insert(tube := {
sample := $id,
volume_amount := $volume_amount,
volume_unit := $volume_unit,
concentration_amount := $concentration_amount,
concentration_unit := $concentration_unit
}))),
insert(sample_todo_fulfillment := {
sample := $id,
todo := $todo
})
)),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment