Skip to content

Commit

Permalink
GITBOOK-3737: No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAnf authored and gitbook-bot committed Dec 10, 2024
1 parent 596ce23 commit fc4c9f2
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 91 deletions.
22 changes: 11 additions & 11 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,17 +616,17 @@
* [Aidbox project](reference/configuration/aidbox-project.md)
* [aidbox.config/config](reference/configuration/aidbox-project/aidbox.config-config.md)
* [Aidbox Forms reference](reference/aidbox-forms.md)
* [Layout DSL](reference/aidbox-forms/layout-dsl.md)
* [Document DSL](reference/aidbox-forms/document-dsl.md)
* [Launch DSL](reference/aidbox-forms/launch-dsl.md)
* [Lisp](reference/aidbox-forms/lisp.md)
* [FinalizeConstraints DSL](reference/aidbox-forms/finalizeconstraints-dsl.md)
* [Finalize DSL](reference/aidbox-forms/finalize-dsl.md)
* [Form DSL](reference/aidbox-forms/form-dsl.md)
* [Lisp API](reference/aidbox-forms/lisp-api.md)
* [Form API](reference/aidbox-forms/api-reference.md)
* [Workflow API](reference/aidbox-forms/workflow-api.md)
* [Addendum API](reference/aidbox-forms/addendum-api.md)
* [Layout DSL (deprecated)](reference/aidbox-forms/layout-dsl.md)
* [Document DSL (deprecated)](reference/aidbox-forms/document-dsl.md)
* [Launch DSL (deprecated)](reference/aidbox-forms/launch-dsl.md)
* [Lisp (deprecated)](reference/aidbox-forms/lisp.md)
* [FinalizeConstraints DSL (deprecated)](reference/aidbox-forms/finalizeconstraints-dsl.md)
* [Finalize DSL (deprecated)](reference/aidbox-forms/finalize-dsl.md)
* [Form DSL (deprecated)](reference/aidbox-forms/form-dsl.md)
* [Lisp API (deprecated)](reference/aidbox-forms/lisp-api.md)
* [Form API (deprecated)](reference/aidbox-forms/api-reference.md)
* [Workflow API (deprecated)](reference/aidbox-forms/workflow-api.md)
* [Addendum API (deprecated)](reference/aidbox-forms/addendum-api.md)
* [FHIR SDC API](reference/aidbox-forms/fhir-sdc-api.md)
* [Aidbox SDC API](reference/aidbox-forms/aidbox-sdc-api.md)
* [Aidbox SQL functions](reference/aidbox-sql-functions.md)
3 changes: 2 additions & 1 deletion modules/aidbox-forms/aidbox-code-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
description: >-
This article outlines the basic steps to start designing form in Aidbox Code
Editor in browser
hidden: true
---

# Aidbox Code Editor
# Aidbox Code Editor (deprecated)

## Overview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
description: >-
This article outlines the basic steps to start designing form locally in any
familiar editor
hidden: true
---

# Any familiar form editor
# Any familiar form editor (deprecated)

{% hint style="warning" %}
We strongly recommend using our UI Form Builder based on FHIR SDC (Structured Data Capture), which we are continuously developing. The current solution will remain supported but will not receive further development at this time.
Expand Down
6 changes: 5 additions & 1 deletion reference/aidbox-forms/addendum-api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Addendum API
---
hidden: true
---

# Addendum API (deprecated)

* [create-addendum](addendum-api.md#create-addendum-wip)
* [add-note](addendum-api.md#add-note)
Expand Down
6 changes: 5 additions & 1 deletion reference/aidbox-forms/api-reference.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Form API
---
hidden: true
---

# Form API (deprecated)

## Form API

Expand Down
6 changes: 5 additions & 1 deletion reference/aidbox-forms/document-dsl.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Document DSL
---
hidden: true
---

# Document DSL (deprecated)

* Document is schema for Questionnaire with questions and answers and types of values.
* Document is used as source of meta-information by [FormLayout](layout-dsl.md)
Expand Down
32 changes: 30 additions & 2 deletions reference/aidbox-forms/fhir-sdc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ parameter:
{% endhint %}

| Parameter | Cardinality | Type |
|----------------------------------------------------------|-------------|----------------------------------------------------------|
| -------------------------------------------------------- | ----------- | -------------------------------------------------------- |
| [allow-amend](fhir-sdc-api.md#allow-amend) | 0..1 | [Boolean](http://hl7.org/fhir/R4/datatypes.html#boolean) |
| [allow-repopulate](fhir-sdc-api.md#allow-repopulate) | 0..1 | [Boolean](http://hl7.org/fhir/R4/datatypes.html#boolean) |
| [redirect-on-submit](fhir-sdc-api.md#redirect-on-submit) | 0..1 | [String](http://hl7.org/fhir/R4/datatypes.html#string) |
Expand All @@ -372,7 +372,7 @@ value:

#### allow-repopulate

Whether the generated link will allow re-populating the form.
Whether the generated link will allow re-populating the form.

NOTE: Repopulate will be working only with forms that contain populate behavior

Expand Down Expand Up @@ -526,6 +526,34 @@ The [extract](http://hl7.org/fhir/uv/sdc/OperationDefinition/QuestionnaireRespon

Aidbox supports only the [Observation based](https://hl7.org/fhir/uv/sdc/extraction.html#observation-based-extraction) and [Definition based](https://hl7.org/fhir/uv/sdc/extraction.html#definition-based-extraction) extraction methods.



{% hint style="info" %}
Current Logic for **Observation-based** extraction:

* A new Observation is created for each Questionnaire Response instance at the time of data extraction.
* If a QR is amended (modified after submission), the existing Observations linked to that QR are updated accordingly.

In the future, Aidbox Forms will align with the implementation described in the [FHIR Structured Data Capture (SDC) specification](https://build.fhir.org/ig/HL7/sdc/extraction.html#observation-based-extraction).
{% endhint %}



{% hint style="info" %}


Current Logic for **Definition-based extraction**:

* Two Options for Resource Extraction:
* **New Resource**: If "new resource" is selected, a new resource is always created during extraction.
* **Existing Resource:** If "existing resource" is selected, the system includes the `questionnaire-itemExtractionContext` extension. This extension can be added either at the root of the Questionnaire or at any item level. It identifies the resource that serves as the context for extraction.

Using `itemExtractionContext`:

* Empty `itemExtractionContext`: When the `itemExtractionContext` is empty, the Questionnaire is used to create a new resource.
* Populated `itemExtractionContext`: If the `itemExtractionContext` contains a resource (or set of resources), the Questionnaire updates the existing resource.
{% endhint %}

### URLs

```http
Expand Down
15 changes: 9 additions & 6 deletions reference/aidbox-forms/finalize-dsl.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Finalize DSL
---
hidden: true
---

# Finalize DSL (deprecated)

Finalize definition describes document validation and postprocessing logic that invoked on sign:

Expand Down Expand Up @@ -71,8 +75,7 @@ Example of `Finalize` document:

[LISP sub-language](lisp.md) is used to specify expressions which transform data of the document into FHIR resources (e.g. Observations).

Inside of `:create` structure, LISP's `get-in` function is used to access data in the document. Other LISP functions are used to transform the data correspondingly and create a FHIR resource object (see an example above)
Also in `:create` structure you can use lisp templates to avoid repetitions for extracting common resources (e.g. Observations)
Inside of `:create` structure, LISP's `get-in` function is used to access data in the document. Other LISP functions are used to transform the data correspondingly and create a FHIR resource object (see an example above) Also in `:create` structure you can use lisp templates to avoid repetitions for extracting common resources (e.g. Observations)

```
....
Expand All @@ -97,10 +100,10 @@ Also in `:create` structure you can use lisp templates to avoid repetitions for

This code will create 3 Observations resources with given patient.

We have only 2 lisp templates
We have only 2 lisp templates

- `aidbox.sdc/gen-observation-template` - generate observations resource
- `aidbox.sdc/gen-repeated-observations-template` - generated observations for repeated values
* `aidbox.sdc/gen-observation-template` - generate observations resource
* `aidbox.sdc/gen-repeated-observations-template` - generated observations for repeated values

> lisp templates can be manually created by user.
Expand Down
16 changes: 8 additions & 8 deletions reference/aidbox-forms/finalizeconstraints-dsl.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# FinalizeConstraints DSL
---
hidden: true
---

FinalizeConstraints is just like a document schema, but presumably more strict one.
Internally, on Sign operation both (document and FinalizeConstraints) schemas will be used simultaneously to validate the data.
# FinalizeConstraints DSL (deprecated)

Easiest approach for making a `FinalizeConstraints` schema is to copy original document schema and remove unnecessary keys or use `aidbox.sdc/generate-form-constraints` RPC for that.
FinalizeConstraints is just like a document schema, but presumably more strict one. Internally, on Sign operation both (document and FinalizeConstraints) schemas will be used simultaneously to validate the data.

Easiest approach for making a `FinalizeConstraints` schema is to copy original document schema and remove unnecessary keys or use `aidbox.sdc/generate-form-constraints` RPC for that.

Proficient Zen user might specify only an additional subset of constraints (e.g. `require`/`minItems`) that are needed for Sign, besides of constraints already existing in Document schema.

In case `:profile` parameter will be omitted only a document schema will be used to validate data on Sign.
Object example:

In case `:profile` parameter will be omitted only a document schema will be used to validate data on Sign. Object example:

```
VitalsFinalizeConstraints
Expand Down Expand Up @@ -77,4 +77,4 @@ Object example:
:datetime {:type zen/datetime}}}}}}
```

### ``
### \`\`
51 changes: 23 additions & 28 deletions reference/aidbox-forms/form-dsl.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Form DSL
---
hidden: true
---

# Form DSL (deprecated)

Form DSL used just to bind all DSLs to one item.

| Property | Description | Type/Struct | required? |
|------------|------------------------------------------------------------------|-------------|-----------|
| ---------- | ---------------------------------------------------------------- | ----------- | --------- |
| title | Title of the form | string | no |
| properties | Form metadata. Usable for several scenarious (search/convestion) | map | no |
| version | Form version (managed automatically by aidbox-forms) | string | no |
Expand All @@ -12,13 +16,11 @@ Form DSL used just to bind all DSLs to one item.
| launch | Symbolic reference to Launch | symbol | no |
| finalize | Symbolic reference to Finalize | symbol | no |

- Only `document` layer is required.
- Other layers you add only if you need special logic there.
- `properties` can be used for
- forms search with `include/exclude` filter via [`aidbox.sdc/get-forms`](api-reference.md#get-forms)
- form conversion to Questionnaire via [`aidbox.sdc/convert-form`](api-reference.md#convert-form) and [`aidbox.sdc/convert-forms`](api-reference.md#convert-forms)


* Only `document` layer is required.
* Other layers you add only if you need special logic there.
* `properties` can be used for
* forms search with `include/exclude` filter via [`aidbox.sdc/get-forms`](api-reference.md#get-forms)
* form conversion to Questionnaire via [`aidbox.sdc/convert-form`](api-reference.md#convert-form) and [`aidbox.sdc/convert-forms`](api-reference.md#convert-forms)

Form DSL example:

Expand All @@ -35,30 +37,23 @@ Form DSL example:

## Properties for Conversion


You can convert Form to Questionnaire, and for that you are able to add some metadata for for your form.

There are some predifined properties for that:



| Property | Description | Type/Struct |
|-------------------------|----------------------------------------------------|------------------------------------------------|
| `:fhir/id` | Questionnaire resource id used to store to DB | `string` |
| `:fhir/publisher` | Name of the publisher (organization or individual) | `string` |
| `:fhir/status` | Questionnaire status | `draft/active/retired/unknown` |
| `:fhir/contact` | Contact details for the publisher | `[{name: string, telecom: [{system, value}]}]` |
| `:fhir/purpose` | Why this questionnaire is defined | `string` |
| `:fhir/copyright` | Use and/or publishing restrictions | `string` |
| `:fhir/approvalDate` | When the questionnaire was approved by publisher | `date` |
| `:fhir/lastReviewDate` | When the questionnaire was last reviewed | `date` |
| `:fhir/effectivePeriod` | When the questionnaire is expected to be used | `{start: date, end: date}` |
|-------------------------|----------------------------------------------------|------------------------------------------------|

| Property | Description | Type/Struct |
| ------------------------- | ---------------------------------------------------- | ------------------------------------------------ |
| `:fhir/id` | Questionnaire resource id used to store to DB | `string` |
| `:fhir/publisher` | Name of the publisher (organization or individual) | `string` |
| `:fhir/status` | Questionnaire status | `draft/active/retired/unknown` |
| `:fhir/contact` | Contact details for the publisher | `[{name: string, telecom: [{system, value}]}]` |
| `:fhir/purpose` | Why this questionnaire is defined | `string` |
| `:fhir/copyright` | Use and/or publishing restrictions | `string` |
| `:fhir/approvalDate` | When the questionnaire was approved by publisher | `date` |
| `:fhir/lastReviewDate` | When the questionnaire was last reviewed | `date` |
| `:fhir/effectivePeriod` | When the questionnaire is expected to be used | `{start: date, end: date}` |
| ------------------------- | ---------------------------------------------------- | ------------------------------------------------ |

> All these properties correspodents FHIR Questionnaire's root level fields
All properties are optional - but, if you want to save converted Questionnaire to it's resource table you should specify `:fhir/id` property



14 changes: 8 additions & 6 deletions reference/aidbox-forms/launch-dsl.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Launch DSL
---
hidden: true
---

# Launch DSL (deprecated)

**Form Launch** binds to [`Document`](document-dsl.md) and `Form`. And optionally can specify fields populate logic via `populate-engine`

Expand All @@ -12,15 +16,14 @@ For populate you can specify what fields should be populated.
* [lisp expressions](lisp.md)
* you need to follow [Document](document-dsl.md) fields structure.

> For lisp `get` `get-in` functions the context is a map
> For lisp `get` `get-in` functions the context is a map
```clojure
{:ctx {:user {:id "user-id" :resourceType "User" ...}} ;; <--- injected logged-in user
:params {...}} ;; <--- parameters to launch rpc
```

```

Example:
Example:

```
VitalsLaunch
Expand All @@ -43,4 +46,3 @@ Example:
:from :Encounter
:where [:= :id (get-in [:params :encounter-id])]})}}
```

12 changes: 7 additions & 5 deletions reference/aidbox-forms/layout-dsl.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Layout DSL
---
hidden: true
---

# Layout DSL (deprecated)

{% hint style="danger" %}
Layout DSL is still under development and unstable
Expand Down Expand Up @@ -27,10 +31,9 @@ Typical description of node:

* children - an array of child elements


## File input

Allows user to attach a file to the document. Must be binded to a key with [`aidbox.sdc/attachment`](./document-dsl.md#attachment-field-type) type in document.
Allows user to attach a file to the document. Must be binded to a key with [`aidbox.sdc/attachment`](document-dsl.md#attachment-field-type) type in document.

```clojure
{:type aidbox.sdc/file-input
Expand All @@ -52,7 +55,6 @@ Currently supported content types:
* video
* PDF


### Show static media content

```clojure
Expand All @@ -63,12 +65,12 @@ Currently supported content types:
```

### Show attachments from the document

```clojure
{:type aidbox.sdc/media-viewer
:bind [:pulse-image]}
```


## Label node

To show some text or field from document as static text, use `aidbox.sdc/label` node
Expand Down
11 changes: 7 additions & 4 deletions reference/aidbox-forms/lisp-api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Lisp API
---
hidden: true
---

# Lisp API (deprecated)

* [lisp/get-specification](lisp-api.md#lisp-get-specification) - get the specification which is distributed in form of a test suite
* [lisp/eval-lisp](lisp-api.md#lisp-eval-lisp) - evaluate lisp expression within the provided execution context (`data` or `resource`).
Expand Down Expand Up @@ -123,7 +127,6 @@ Response:
result: Hello Mr. Morgan
```

Server responds with `HTTP 422 Unprocessable Entity` if wrong params provided
or with `HTTP 500 Internal Server Error` if wrong `resourceType` provided.
Server responds with `HTTP 422 Unprocessable Entity` if wrong params provided or with `HTTP 500 Internal Server Error` if wrong `resourceType` provided.

\
\\
Loading

0 comments on commit fc4c9f2

Please sign in to comment.