Exercise - Use the canvas app

Completed

In this exercise, you explore and use the functionality in the canvas app that you created. You search for the patient by name and review how the system returns the data from FHIRlink and displays it in your canvas app for the Patient and related Appointment records.

Use the new canvas app functionality

In the following sections, you use the new canvas app functionality to search for patients by name and view existing appointments for the patient.

Search for patients by name

To search for patients by name, follow these steps:

  1. Go to Power Apps.

  2. Open the saved canvas app for editing.

  3. Preview the application and then run the query to check the formula update.

  4. Press the F5 key to preview the app.

  5. In the TextInputSearch box, enter a name, such as FHIRlink.

  6. Select the IconSearch control.

  7. View the updated list in the PatientListGallery.

    Screenshot of the updated list in the Patient List Gallery.

  8. Select a patient from the list in PatientListGallery.

    The system updates the display to the right of PatientListGallery with more details from the selected patient.

    Screenshot of a patient selected showing the extra updated details.

The canvas app should now display individual fields from the patient JSON and child array data.

View existing appointments for the patient

To view existing appointments for the patient, follow these steps:

  1. Select a different patient from the list. The system updates the related controls with that patient's details.

  2. You can view the full patient record for each selected patient along with the name and identifier child arrays. The application populates the related list of appointments.

    Screenshot of a patient record with child arrays.

    The application updates the related controls with the full patient record and the list of related appointment records.

The preceding tests validate that you successfully retrieved data from FHIRlink for both lists of data by using FHIRlink.ListResources and a single record by using FHIRlink.GetResource. You also explored how you can use the same connector for multiple calls for different FHIR resources.

Create a new appointment

When you selected a patient, you can view the list of appointments. Now, you can test how to create a new appointment for the selected patient.

Post a new appointment to your FHIR service

To post a new appointment to your FHIR service, follow these steps:

  1. Go to Power Apps.

  2. Open the saved canvas app for editing.

  3. Preview the application and then run the query to check the formula update.

  4. Press the F5 key to preview the application.

  5. In the TextInputSearch box, enter a name, such as FHIRlink.

  6. Select the IconSearch control.

  7. Select a patient from the list, such as FHIRlink1.

  8. In the Subject text box, update the text to read Follow-up appointment.

  9. Add a new Comment, such as This is a new follow-up appointment.

  10. Select CHECKUP as the Type.

  11. Set the Duration as 60.

  12. Optionally, select a new Date/Time value. The default value is the current date and time.

    Screenshot of the application preview with the fields filled in.

  13. Select Send.

  14. When the progress bar completes, select the IconSearch control and then select patient FHIRlink1 again.

  15. In the Appointments gallery, scroll down to the newly created appointment in the list.

    Screenshot of the Appointments gallery showing the newly created appointments.

This last task demonstrates how you can post data to the FHIR service with FHIRlink through FHIRlink.CreateResource by using a Power Automate flow. This task also uses the same saved FHIRlink connection that the canvas app uses to complete its work.

Next steps

Now that you're familiar with FHIRlink and know its uses in canvas apps and Power Automate, you can update the app in multiple ways, including:

  • Work with FHIRlink operations:

    • Filter on FHIR elements other than name.

    • Display and capture more appointment fields.

    • Test updating a record by using FHIRlink.UpdateResource.

  • Use other Power Apps connectors:

    • Create a Microsoft Outlook appointment.

    • Post to a Microsoft Teams channel.

  • Use advanced Power Fx:

    • Add error handling to the canvas app controls and methods.

    • Have the system automatically reload appointments when you create them.