Skip to main content

How to Handle Sunwave EMR API Response Changes for Patient Matching (CRM)

Overview

This guide explains how to resolve patient matching issues when Sunwave EMR API responses return nicknames instead of legacy IDs, requiring code modifications to support nickname-based patient matching.

Before You Begin

  • Verify you have access to the EMR treatment program mapping configuration

  • Confirm the specific Sunwave API endpoint being used

  • Ensure you can view API response logs for debugging

Identifying the Issue

You may notice this problem when:

  • Patients are successfully sent to Sunwave but updates are not received back

  • Discharge updates are not processing properly

  • The system shows unmapped treatment programs in API responses

Steps to Resolve

Step 1: Check Current API Response

  1. Review the Sunwave API response for affected patients

  2. Look for the treatment program field in the response

  3. Verify if the response contains a nickname instead of the legacy ID

Step 2: Identify the Nickname in Sunwave

  1. Log into the Sunwave EMR system

  2. Navigate to the treatment program configuration

  3. Locate the nickname field for the affected treatment program

  4. Note the exact nickname value (including any punctuation like commas)

Step 3: Update Treatment Program Mapping

  1. Access the EMR treatment program mapping in your CRM system

  2. For the affected treatment program, add or update the nickname field

  3. Ensure the nickname exactly matches what appears in the Sunwave API response

  4. Save the mapping configuration

Step 4: Modify Patient Matching Code

  1. Update the patient matching logic to check for nickname-based matching

  2. Ensure the code can handle both legacy ID and nickname matching for backward compatibility

  3. Test the modified code with sample API responses

Expected Result

After implementing these changes:

  • Patient updates from Sunwave should process correctly

  • Discharge updates should sync properly

  • The system should successfully match patients using nickname-based identification

Troubleshooting

Issue: Patient matching still fails after adding nickname

  • Double-check that the nickname exactly matches the API response (including spaces and punctuation)

  • Verify that multiple EMR locations aren't causing conflicts

  • Ensure all unmapped locations have been properly configured

Issue: Some patients work while others don't

  • Check if different treatment programs are using different identification methods

  • Verify that the code handles both legacy ID and nickname matching scenarios

Related Resources

  • EMR Integration Configuration Guide

  • Patient Matching Logic Documentation

  • Sunwave API Documentation

Did this answer your question?