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
Review the Sunwave API response for affected patients
Look for the treatment program field in the response
Verify if the response contains a nickname instead of the legacy ID
Step 2: Identify the Nickname in Sunwave
Log into the Sunwave EMR system
Navigate to the treatment program configuration
Locate the nickname field for the affected treatment program
Note the exact nickname value (including any punctuation like commas)
Step 3: Update Treatment Program Mapping
Access the EMR treatment program mapping in your CRM system
For the affected treatment program, add or update the nickname field
Ensure the nickname exactly matches what appears in the Sunwave API response
Save the mapping configuration
Step 4: Modify Patient Matching Code
Update the patient matching logic to check for nickname-based matching
Ensure the code can handle both legacy ID and nickname matching for backward compatibility
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