Skip to content

Instantly share code, notes, and snippets.

@zindel
Created April 7, 2016 16:55
Show Gist options
  • Save zindel/fe454407c0cc7edb5ad9f4b5564e2a9f to your computer and use it in GitHub Desktop.
Save zindel/fe454407c0cc7edb5ad9f4b5564e2a9f to your computer and use it in GitHub Desktop.
/do(
$_s_e := top(visit.filter(id()=$visit)).study_enrollment.id(),
$_a_c := top(acquire_channel.filter(id()=$acquire_channel)).id(),
$_title := if_null($title, '---'),
$id := insert(todo := {
individual := $individual,
study_enrollment := $_s_e,
expected_completion_date := $ecd,
title := if_null($title, '---'),
asset_type := 'measure',
num_required_entries := $nre,
acquire_channel := $_a_c
}),
for($_mtr := $mtr, with($_mtr,
insert(measure_type_revision_x_todo := {
todo := $id,
measure_type_revision := $measure_type_revision
})
)),
update(
todo[$id].filter(title='---') {id(),
title := top(measure_type_revision_x_todo).measure_type_revision
.measure_type.title
}),
{id := $id}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment