SearchForResource (Advanced Query) Example

The Advanced Search process illustrates a method of using an advanced search query to find a Patient FHIR resource and move it to another FHIR server.

For more information about searching for a FHIR resource, see Search for Resource.

Advanced Search Process

The Advanced Search process is illustrated here:

Process Definition

The process performs the following operations:
  1. The Timer activity starts the process.
  2. The AddExamplePatient creates a sample FHIR Patient resource for this example. Typically, the Patient resource already exists in an external FHIR server. However, in order to ensure a patient can be found in this example, a sample Patient resource has been added.
  3. The SearchforPatient resource uses an advanced query to retrieve the Patient resource that is created in step 2.
  4. The SearchLog activity captures the results of the SearchforPatient activity. Two of the elements from the retrieved Patient resource are included in the log. The name of the patient in our example is John Jones (see below).
    14:08:36.263 INFO  [bwEngThread:In-Memory Process Worker-1] 
    com.tibco.bw.palette.generalactivities.Log.AdvancedSearch.SearchLog - Given: John Family: Jones
  5. The CreatePatient activity uses data from the Patient retrieved in step 4 to populate a new FHIR Patient resource and the Patient resource is created on a FHIR server. If the FHIR server responds with Patient ID, a summary of the create operation is included in the log.
  6. The GetPatient activity uses a unique ID to retrieve the Patient resource that was created in step 5. The ID is assigned to the Patient resource after it is created in step 5. It is returned to the CreatePatient activity and is used as input to this activity. The patient's name in the resource is included in the log. It matches the name in the original Patient resource, confirming that the transfer is completed successfully.
    14:08:36.999 INFO  [bwEngThread:In-Memory Process Worker-1] 
    com.tibco.bw.palette.generalactivities.Log.AdvancedSearch.GetLog - Given: John Family: Jones
  7. After the process executes successfully, a Success message is written to the Console. Select Window > Show Console in TIBCO Business Studio to view the log messages.

Process Output

Select the desired activity and click the Output tab.

  • The AddExamplePatient activity adds a sample record of a patient to the Patient resource.
  • The SearchforPatient activity searches for the records of a patient by using a query builder for advanced search options.
  • The SearchLog activity stores the results of the search.
  • The CreatePatient activity creates a new record in the Patient resource on a FHIR server and adds it to the CreateLog activity.
  • The GetPatient activity retrieves the newly created record from the Patient resource and adds it to the GetLog activity.