Saving Queries

FHIR search queries can be long, complicated and difficult to write. For these reasons Vanya has a tree structure where you can save a query or a set of queries and run or reference them later. The structure is similar to a hierarchical folder/file system that most of us are familiar with.

Inside this tree structure you can create folders and add any number of queries to each folder. Queries can be moved around using drag and drop, renamed, deleted, and copied — either individually or in bulk by selecting a parent folder.

What does each saved query contain?

- A name
- A FHIR server to run the query on
- The query string itself

A query can be created by clicking the “Add Query” button at the bottom of the page or by opening the context menu for any folder or query. Once you have given the query a name, focus moves to the input box where you can begin typing your query. The current active server will be assigned by default to your new query unless you decide to change it by selecting a different server from the drop down list. As soon as you click the “Send” button the saved query is updated and the query runs.

Clicking on a saved query in the tree will open that query so that it can be run. If the query you’ve just opened is pointing to a server that is not the active server, the active FHIR server will change as soon as the “Send” button is clicked.

Vanya saved queries

1. Query list and search box
Any number of folders and queries can exist in your queries tree. As the number grows it can be difficult to find the query you’re looking for. If you give your queries meaningful names, the search box at the top of the query tree is a quick way to find an individual query or queries.

2. Breadcrumbs
Quickly identify which saved query is currently open. In the example, it’s “BP with Patient” in the “Sample Observations” folder.

3. Context menu
Each folder and query in the tree has a context menu that can be opened by clicking in the three dots next to the tree node. There are 5 options on the context menu.

- Create a new folder inside the selected node.
- Create a new query as a child of the selected node.
- Duplicate the selected node and all of its children. This creates a copy of the parent with the work “Copy” appended to its name.
- Rename the current node.
- Remove the current node and any children it contains.

4. Add folder and add query buttons
Adds a new folder or a new query to the root of the queries tree.