Skip to content

[Example] Encounter Follow-Up Email bot and subscription #8

@MarcioDeAquino

Description

@MarcioDeAquino

Description

The bot will be triggered by a Subscription when an Encounter resource changes its status to "finished".
It should retrieve the patient's email, construct a personalized subject and body, and send the email with relevant links for follow-up care.


Requirements

Subscription

  • Create a Subscription that invokes the Bot when an Encounter resource changes status to "finished".

Bot

  • Retrieve the patient's email from Encounter.subject.
  • Construct the email subject line in the following format:
Your appointment <insert_provider_name> - <date_of_appointment>
  • Email body content:
Hello _patient_name_,
Following up from you appointment with <insert_provider_name> today. 

//make this a hyperlink if you can

[View your visit summary]( example.com/Appointment/<appointment_id>)
// appointment_id can be found on Encounter.appointment 

Remember to [schedule a follow up](example.com/get-care)

Deliverable

  • Open a PR in examples/medplum-demo-bots with:

  • Bot code

  • Subscription

  • README

  • Test the implementation with the Provider app.

  • Ensure that when the Encounter status is flipped to "finished", the Bot executes and sends the email as specified.

source: https://vintaclients.slack.com/archives/C079AUSU0LA/p1758755715621519?thread_ts=1758658612.521269&cid=C079AUSU0LA

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions