Skip to content

Instantly share code, notes, and snippets.

@zindel
Created June 29, 2016 14:55
Show Gist options
  • Save zindel/d0ca8604bd0de98b92c64aca8544cd36 to your computer and use it in GitHub Desktop.
Save zindel/d0ca8604bd0de98b92c64aca8544cd36 to your computer and use it in GitHub Desktop.
/do(
$_id := update(top(study_enrollment.filter(id()=$study_enrollment)){
id(),
enrollment_date := $enrollment_date,
enrollment_status := $enrollment_status
}),
with($visit_todo, do(
for($v := $visit, with($v, update(top(visit.filter(id()=$id)){
id(),
status := $status
}))),
for($t := $todo, with($t, update(top(todo.filter(id()=$id)){
id(),
status := $status
}))),
)),
for($v := /visit.filter(study_enrollment.id()=$study_enrollment &
status='scheduled').id(),
create_todo($v)),
{id := $_id}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment