Skip to main content

How and when to use FHIR Terminology Service APIs training exercise

Training exercises for software developers who want to use FHIR terminology APIs. 

You might find it useful to use these tools to help you with these exercises.  

  • FHIR Server/s: URLs to be supplied on the day
  • Postman (for sending requests)
  • Shrimp Browser (for SNOMED CT and other FHIR CodeSystems)

The following exercises are somewhat progressive; some steps build on the previous steps, so you should try them out in sequence:


1. Build your own custom code system

Define a code system for a local hospital or clinic with codes to identify buildings, floors within each building, wards and other areas on each floor. You should:

  • try to use a hierarchy
  • define display terms and synonyms for the concepts
  • define some different properties for the concepts, for example room purpose or security level

2. Define ValueSets using your code system

Create some ValueSets based on your code system. You should:

  • use a hierarchy filter to define a ValueSet for all locations in a given building
  • use a property filter to define a ValueSet for all locations of a given type
  • use a property filter to exclude rooms with a certain security level 
  • create a ValueSet for locations that are closed for maintenance, listing them individually, and use this ValueSet in one of your other ValueSets to exclude these locations from appearing

3. Create or modify a data entry widget to use each of your ValueSets

Use http://plnkr.co or similar to create a data entry widget that allows a user to search for and select a code from each of your ValueSets. Alternatively, you may want to modify an existing widget.

Modify your widget to conditionally use a picklist paradigm (radio buttons or dropdown) for ValueSets that have a small expansion (for example administrative gender or marital status).

Modify your widget to do a $lookup on the selected concept and display the details in a tab.


4. Create a ConceptMap

Create a map from locations in your one or more of your ValueSets to concepts in the HL7 v3 ServiceDeliveryLocationRoleType ValueSet

Investigate the different relationship kinds that might be appropriate in your map.

Think about how you might use unmapped clauses to deal with edge cases in your map.


5. Create or modify a data validation widget for entering data into a table and checking its validity

Make a table with a column for the user to enter codes.

Make a $validate-code call to check whether the codes are valid with respect to one of your ValueSets. 

Add a column for the user to enter display text, and update your check to also check the validity of the display text. 

Add a column for the equivalent HL7 v3 code, and if the code is valid, show the equivalent HL7 v3 code in the third column using a $translate call (and a $lookup call, if you would like to show the HL7 v3 code’s display text). 


6. Use terminology to search other resource

Use hierarchy to search a FHIR Server for all Location resources whose type is ICU or one of its descendants (/Location?type:below=ICU)

Create a simple ValueSet based on the HL7 v3 ServiceDeliveryLocationRoleType ValueSet  For example, all of the ICU Locations (concept is-a ICU) as well as ER Locations (concept is-a ER)

Use this to search a FHIR Server for all Location resources whose type is in this ValueSet /Location?type:in=http://uri.of/your/valueSet

Last edited: 12 June 2023 10:43 am