EHR Migration Example
Scenario: Regional health network needs to connect two health systems with completely different data sources—one health system only provides a PDF specification document on an SFTP server, while the other has a REST API with Swagger documentation.
The Challenge
- Source System A: 60-page PDF specification document with custom field definitions, accessible only via SFTP
- Source System B: REST API with Swagger docs, but non-standard field naming and nested data structures
- No common data standards between systems
- Need bidirectional data synchronization
- Patient safety requires 100% data accuracy
Wave Solution
1. Data Profiles Generated:
- System A Profile: Wave analyzed the 60-page PDF and extracted:
- Custom patient identifier schemes (
PatientUniqueId
,FacilityMRN
) - Non-standard date formats (
MM-DD-YYYY vs YYYYMMDD
) - Proprietary medication coding system
- Custom patient identifier schemes (
- System B Profile: Wave parsed the Swagger docs and identified:
- RESTful endpoint structures (
/api/v2/patients/{id}/demographics
) - Nested JSON response schemas
- Custom authentication headers
- RESTful endpoint structures (
2. Intelligent Mappings:
System A (PDF Spec) | System B (API) | Wave’s Transformation Logic |
---|---|---|
PatientUniqueId | patientData.identifiers.primary | Extract numeric portion, validate checksum |
DOB_MMDDYYYY | demographics.birth_date | Convert date format, handle invalid dates |
MedCode_Internal | prescriptions[].medication.code | Lookup proprietary codes in generated mapping table |
ProviderNPI_Custom | careTeam.provider.npi | Validate NPI format, standardize to 10 digits |
3. Generated Integration Code:
def sync_system_a_to_system_b(pdf_patient_data: dict) -> dict:
"""
Transform PDF-spec patient data to System B API format
Generated by Wave from PDF spec analysis and Swagger docs
"""
# Handle custom patient identifier
patient_id = pdf_patient_data.get('PatientUniqueId', '')
numeric_id = extract_numeric_id(patient_id)
validate_checksum(patient_id)
# Convert proprietary date format
dob_str = pdf_patient_data.get('DOB_MMDDYYYY', '')
birth_date = convert_date_format(dob_str, 'MM-DD-YYYY', 'YYYY-MM-DD')
# Map medication codes using generated lookup table
internal_med_code = pdf_patient_data.get('MedCode_Internal', '')
standard_med_code = MEDICATION_CODE_MAPPING.get(internal_med_code)
# Build System B API payload
api_payload = {
'patientData': {
'identifiers': {'primary': numeric_id},
'demographics': {'birth_date': birth_date}
},
'prescriptions': [{
'medication': {'code': standard_med_code}
}]
}
return api_payload
Results
- ✅ Wave extracted 47 distinct data fields from the PDF automatically
- ✅ Generated mapping handled 12 different date formats found in the spec
- ✅ API integration worked on first attempt with generated authentication code
- ✅ Reduced 3-month integration timeline to 2 weeks
Key Takeaways
PDF Processing Power
Wave’s AI can analyze complex specification documents and extract structured data definitions, eliminating manual data entry and reducing errors.
API Integration Automation
Swagger and OpenAPI specifications become instant data profiles with all endpoints, request/response schemas, and authentication requirements automatically mapped.
Bidirectional Sync
Wave generates transformation code for both directions, ensuring data consistency across integrated systems.