Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.3.6
ruby 3.3.6
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
arm64-darwin-25

DEPENDENCIES
github-pages (~> 228)
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ a RESTful API to enable third-party integration.

{% include figure.html
file="inferno-deployment.png"
alt="Diagram of Inferno Deployment
alt="Diagram of Inferno Deployment"
caption="A deployment combines Inferno Core and Test Kits into a running instance."
description="Default services in a deployment include nginx, redis, validator services, web and command line interfaces, and database interfaces."
maxwidth="100%"
Expand Down
49 changes: 41 additions & 8 deletions docs/writing-tests/test-inputs-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ The `input` method defines an input. `input` can take several arguments, but
only the identifier is required:
- `identifier` - (**required**) a name for this input. The input value is
available in the run block using this name.
- `title:` - a title which is displayed in the UI.
- `title:` - a title which is displayed in the UI.
- `description:` - a description which is displayed in the UI.
- `type:` - controls the type of HTML input element used in the UI. Currently
there are 5 possible values:
there are 6 possible values:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the count was off before

Suggested change
there are 6 possible values:
there are 7 possible values:

- `'text'` - (**default**) a regular input field.
- `'textarea'` - for a text area input field.
- `'radio'` - for a radio button singular selection field.
- `'checkbox` - for a checkbox field. In tests, a checkbox input is
- `'checkbox'` - for a checkbox field. In tests, a checkbox input is
represented as an array of the selected values.
- `'select'` - for a select input field.
- `'oauth_credentials'` - a complex type for storing OAuth2 credentials. When
used by a FHIR client, the access token will automatically refresh if
possible.
Expand All @@ -47,6 +48,7 @@ only the identifier is required:
Locking an input can force it to use a value from a previous test's output, or
the default value.
- `hidden:` - (**default: false**) hide the input from the UI. Must be used with either `optional: true` or `locked: true`.
- `enable_when` - (**optional**) adds conditional visibility for inputs. It's a hash with `input_name` and `value`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `enable_when` - (**optional**) adds conditional visibility for inputs. It's a hash with `input_name` and `value`.
- `enable_when` - (**optional**) adds conditional UI visibility for the input, causing it to be displayed only when the indicated input has the specified value. The value is a hash with keys `input_name` and `value`.


Here is a simple example:
```ruby
Expand Down Expand Up @@ -221,6 +223,37 @@ group do
end
```

### Conditional visibility for inputs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Conditional visibility for inputs
### Conditional UI visibility for inputs

Inputs can be shown or hidden based on the value of another input using an `enable_when` condition. We recommend implementing conditional visibility based on **Radio** or **Select** inputs.
Comment thread
projkov marked this conversation as resolved.
Outdated

```ruby
group do
id 'conditional_group'
title 'Conditional Inputs Group'
optional

test 'Conditional, optional, empty input test' do
input :get_type, title: 'How to get Bundle', type: 'radio', options: {
list_options: [
{ value: 'copy_paste', label: 'Paste JSON' },
{ value: 'url', label: 'URL to FHIR Bundle' },
{ value: 'summary_op', label: '$summary Operation' }
]
}, default: 'copy_paste'
input :bundle_copy_paste, title: 'Paste JSON', type: 'textarea', optional: true,
enable_when: { input_name: 'get_type', value: 'copy_paste' }
input :bundle_url, title: 'URL to FHIR Bundle', type: 'text', optional: true,
enable_when: { input_name: 'get_type', value: 'url' }
input :fhir_server_url, title: 'FHIR Server URL', type: 'text', optional: true,
enable_when: { input_name: 'get_type', value: 'summary_op' }
input :patient_id, title: 'Patient ID', type: 'text', optional: true,
enable_when: { input_name: 'get_type', value: 'summary_op' }

run { pass }
end
end
```

## Outputs

### Defining Outputs
Expand Down Expand Up @@ -311,7 +344,7 @@ input :backend_services_auth_info,
}
]
}

# Limit the auth types to those in SMART App Launch v1
input :smart_v1_auth_info,
options: {
Expand All @@ -325,7 +358,7 @@ input :smart_v1_auth_info,
}
]
}

input :smart_auth_info,
options: {
components: [
Expand Down Expand Up @@ -366,7 +399,7 @@ input :auth_info1,
options: {
mode: 'auth'
}

# Use this to make authorized requests
input :auth_info2,
options: {
Expand All @@ -380,9 +413,9 @@ input :auth_info2,
Inputs and outputs work as a single key-value store scoped to a test session.
The main differences between them are:
- An input's value can not be changed
during a test
during a test
- Inputs support additional metadata for display in the UI
(title, description, etc.)
(title, description, etc.)

Since inputs and outputs form a single key-value
store, a value will be overwritten if multiple tests write to the same output.
Expand Down