Adding Structured data to a scenario

In this page we’ll add structured data to the resources in a scenario.

First, select the resource you want to add structured data to. Heres’s a screen shot with a Condition resource selected, and the code element selected from that resource. (Note that in the right panel the ‘Structure & Reference tab is selected).

To the right of the tree are the details of the selected element (Condition.code). You can see that the dataType is a CodeableConcept, and it is bound to the ValueSet Both of these are hyperlinks.

Clicking on the datatype link  (CodeableConcept in this case) will display a dialog that allows us to enter the value for this element. The format of the dialog is specific for each datatype. Here’s the one for a CodeableConcept:

There are a number of ways that we can enter the value for a CodeableConcept.

  • If you know the description of the code you want, you can enter some text into the ‘autocomplete’ box. The system will automatically look for matching concepts from that ValueSet and display them in a drop down for you to select. This happens after you have entered 3 or more characters. It pays to be patient as this is happening, as there can be a delay communicating with the Terminology server which is doing the work. There’s a ‘working’ icon that appears in the nav bar when this is in progress).
  • If you already know the code and system you can enter them directly into the appropriate boxes
  • If we don’t want to code the concept, we can enter a text value only
  • And finally, licking on the link to the upper right (which is the name of the ValueSet)  the ValueSet browser is displayed. This allows you to view the details of the ValueSet, and more importantly to examine the contents (a process termed ‘expansion’). In the screen shot below, we’ve displayed the ValueSet browser, selected the Expand tab, entered the work ‘asthma’ into the filter and clicked the Expand button.

All the concepts from this ValueSet are displayed in a table. If we want to, we can click the code, and that particular concept will be selected and added to the resource. Note that if you select a concept in this way, the value will be directly added to the resource. In the other ways, you need to click the ‘Save’ button.

Once you have entered the value, there are a couple of ways you can view the content of the resource. Selecting the ‘current resource views’ tab in the right pane shows a number of different views, of which 2 are the most useful:

  • The tree view shows the resource as a tree (remember this is similar to – but not the same as) the tree on the structure tab. This one is the resource instance that you are adding data to. The structure tree is the type (the ‘template’) for the resource.
  • The Json view of the resource. This is the most useful view, although you do need to learn how to read Json (but it’s not that hard)..

Here’s an example:

An alternate view – and one that is useful when you are updating multiple elements in the resource is found by clicking the ‘Toggle Input Mode’ link in the upper right of the Structure & Reference tab. This hides the left pane, and displays both the Structure tree and the resource Json on the same tab. It’s a bit compressed, but makes it easier to see what has been added to the resource. Here’s a screen dump:


Some notes on entering data:

  • If you use the ‘toggle input mode’ option, you can’t add new resources. Click it again to go back to the ‘normal’ mode
  • In the structure tree:
    • a red element is required, a start (*) at the end means there are multiple allowed, and an [x] on the end means that there is more than one datatype allowed for this element
  • To remove an element – select the Current resource views, then the tree view within that tab. Clicking a top level node displays a ‘delete’ button that allows it to be removed.
  • Clicking on the ValueSet link under binding will display the ValueSet browser, but you can’t (yet) select a concept when invoked that way (even though it looks like you should be able to)

Finally, if you want to know if your resource has had all required data added to it, display the List tab in the middle pane, then click the ‘?’ icon under the ‘Valid’ column for that resource. This will call the validation operation on the FHIR server, displaying any errors in a tab in the roght pane. Here’s an example of missing data in a Condition resource:

(Note that the error messages can be cryptic!)


%d bloggers like this: