Skip to content

Instantly share code, notes, and snippets.

@zindel
Created April 8, 2016 12:26
Show Gist options
  • Save zindel/02268fd43a81f9775a9f952fa5efb022 to your computer and use it in GitHub Desktop.
Save zindel/02268fd43a81f9775a9f952fa5efb022 to your computer and use it in GitHub Desktop.
fulfill-sample:
type: form
title: Fulfill Sample
entity: todo
input:
- todo: todo[sample-not-started]
submit_button: Add Sample
value: |
{sample := { sample_type := null() }}
fields:
- value_key: sample
type: fieldset
fields:
- value_key: sample_type
label: Sample Type
type: entity
using: radio-group
required: true
data:
entity: sample_type
title: title
mask: exists(sample_type_x_todo?todo=$todo)
- value_key: date_collected
label: Date Collected
type: date
- value_key: collected_by
label: Collected By
type: entity
data:
entity: user
title: __title__
- value_key: tube
label: Tubes
type: list
required: true
fields:
- value_key: volume_amount
label: Volume
type: number
- value_key: volume_unit
label: Unit
type: enum
options:
- label: ml
value: ml
- label: ul
value: ul
- value_key: concentration_amount
label: Concentration
type: number
- value_key: concentration_unit
label: Concentration Unit
type: enum
options:
- label: ng-ul
value: ng-ul
query: |
/do(
create_sample_todo_fulfillment($todo, $sample),
{id := $todo}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment