************** ## Exercise ************** In this exercise you will run some advanced search requests. You may either use a REST client like Postman to run your requests or paste them directly in your browser. Start by reading the case description. Here below are a couple of links that you may find useful during this exercise: * Vonk server public endpoint: http://vonk.fire.ly * FHIR search framework: https://www.hl7.org/fhir/search.html * FHIR search parameter list: https://www.hl7.org/fhir/searchparameter-registry.html * Link to download Postman: https://www.getpostman.com/ ### Steps to follow Either try out these searches yourself or follow the steps below to get to formulate the right search request. In this exercise we assume you use the public Vonk server, but you may use any FHIR server you want. Note however that not all search functionalities may be implemented in all FHIR servers. #### 1. Retrieve the entire health record for a specific Patient 1. There are two ways to do this. Try them now if you don't need any hints. 2. Remember the chapter about compartment searches? Let's try this. 3. There's also an operation available which you could use. Check out if it returns the same results as the previous step. #### 2. Retrieve all observations from patients suffering from a specific condition, e.g. a malignant lung tumor 1. The easiest way to produce this request is to split it into smaller, simpler requests first. You can either try this out for yourself first or continue with the steps given below. 2. First try to retrieve all conditions with SNOMED code 21119008 (in real-life more codes might be needed, but for this exercise you can assume that this is the only code used for a malignant lung tumor). 3. Next try to retrieve all patients suffering from these conditions. Hint: you will need to use reverse chaining. 4. Now comes the hardest step. You will need to combine chaining and reversed chaining in one request. Search for all observations and add a chained search parameter to filter on patients meeting the search criteria. 5. Stop reading if you don't want to see the answer. 6. Still having trouble? Try out the following request: GET http://fire.ly/Observation?patient._has:Condition:patient:code=http://snomed.info/sct|21119008 #### 3. Retrieve all appointments of patients from a specific general practitioner 1. Like the previous assignment, let's start with a simple request. Quit reading if you don't need any help. 2. First, filter all patients on a specific general practitioner based on the ID. 3. Next, try to retrieve all encounters on patients meeting the search criteria. 4. Just one more hint: you will need to do some chaining again. 5. Stop reading if you don't want to see the answer. 6. The following request should work: GET http://fire.ly/Encounter?patient.general-practitioner=1 (try out a different ID or add data to the server if you don't get any results). #### 4. Retrieve all observations that are either final or recently measured 1. Define the search parameters that are required for this search request. 2. To retrieve recent observations use a recent datetime, let's say two weeks ago. 3. Use the correct prefix to filter on datetimes equal or above the given datetime. 4. Write out the search request and try it out. 5. Check if it gives the expected results and/or read further to check the answer. 6. Based on a filter, the request should be something like: GET http://fire.ly/Observation?_filter=status eq final or (date=ge2018-01-01T00:00.000+02:00) #### 5. Retrieve all observations after a specific date with a specific code 1. Find out which composite search parameters you need for this search request. 2. Pick any code, e.g. 150456 and date, e.g. 2010-01-01 3. Run the search request. 4. The search request should be something like: http://fire.ly/Observation?code-value-date=code$150456,date$ge2010-01-01T00:00.000+02:00 5. Try out different values for code and date if the search request doesn't return any values.