Skip to content

Instantly share code, notes, and snippets.

@zindel
Created February 11, 2016 14:54
Show Gist options
  • Save zindel/79515fbd9b0b2748c2a5 to your computer and use it in GitHub Desktop.
Save zindel/79515fbd9b0b2748c2a5 to your computer and use it in GitHub Desktop.
save-data:
title: Saving Data
type: form
value: |
top(individual){
code,
sex,
identity{fullname, birthdate}
}
fields:
- value_key: individual.code
type: string
label: Code
read_only: true
- value_key: individual.identity.fullname
type: string
label: Name
- value_key: individual.sex
label: Sex
type: enum
options:
- value: male
label: Male
- value: female
label: Female
- value: not-known
label: Not Known
- value: not-applicable
label: Not Applicable
- value_key: individual.identity.birthdate
type: date
label: Birth Date
query: |
with($individual, do(
$_individual := update(individual[$code]{id(), sex := $sex}),
with($identity,
update(identity[$_individual]{id(),
fullname := $fullname,
birthdate := $birthdate,
})
),
{id := $_individual}
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment