Sync mental health social history to Rest endpoint

Recipe ToolsDeveloper ToolAPI Integration

What it does

When a function call arrives, this automation searches for the encounter and checks if social history exists. The validated data syncs to a Rest endpoint, and someone receives confirmation or an error alert.

Who it's for

Data and analytics teams who need to validate and route mental health social history data in real time.

How teams use this

Validate and sync social history on intake

When a mental health intake form is submitted, the function call triggers a search for the encounter and syncs social history to the Rest endpoint only if both social history and effective date are present.

Route incomplete records to a queue

If the encounter is not found or social history is missing, filter the record and send an alert to a monitoring channel so staff can investigate the gap before syncing. This keeps bad data out of the system.

Sync to a different endpoint for compliance

Point the Rest call to a separate compliant endpoint instead of the main one, and keep all validation logic the same. Only the destination changes.

How it works

  1. Receive the function call. A function call arrives with patient and encounter details, including social history and effective date information.
  2. Search for the encounter. Call Encounter Search via Rest to find the matching encounter record using the patient identifier from the function call.
  3. Validate social history and date. Check the Lookup Table to confirm social history is marked true and an effective date is present in the incoming data before syncing.
  4. Sync the record to Rest. Send the validated social history data to the Rest endpoint so the mental health record is updated with the encounter and effective date.
  5. Return the outcome. Reply with the encounter object and sync status so the caller knows the social history was processed or if an error occurred.