Step 4: Generate Production Code
This is where Wave’s mapping-rooted approach shines. We’ll turn your precise field mappings into production-ready code. This takes about 3-4 minutes.
What You’ll Do
- Generate Python ETL code from your mapping
- Review the production-ready implementation
- Test your transformation logic
- Export your work
Generate ETL Code
Wave will transform your mapping into real code that your team can use.
-
Ask Wave to generate code:
Generate Python code to transform FHIR Patient resources to OMOP PERSON records using our mapping
-
Wave creates production-ready code including:
- Python transformation functions
- Data validation logic
- Error handling and logging
- Unit tests for edge cases
Review Your Generated Code
Here’s what Wave generated from your mapping (simplified example):
def transform_fhir_patient_to_omop_person(fhir_patient: dict) -> dict:
"""
Transform FHIR Patient resource to OMOP PERSON record
Generated by Wave based on your mapping
"""
omop_person = {}
# Map patient ID (rooted in your mapping)
omop_person['person_id'] = int(fhir_patient['id'])
# Map gender with concept transformation (from your mapping)
gender_mapping = {
'male': 8507,
'female': 8532,
'other': 8521,
'unknown': 0
}
omop_person['gender_concept_id'] = gender_mapping.get(
fhir_patient.get('gender'), 0
)
# Map birth date (transformation defined in mapping)
if 'birthDate' in fhir_patient:
omop_person['birth_datetime'] = datetime.strptime(
fhir_patient['birthDate'], '%Y-%m-%d'
)
return omop_person
Notice how every transformation is rooted in your mapping—not AI guesswork!
Test Your Integration
Wave generated test cases based on your mapping logic:
- Review the generated tests to validate your transformation logic
- Ask Wave to generate additional test scenarios:
Create test cases for edge cases like missing birthDate and invalid gender values
- Run tests to ensure your mapping handles real-world data correctly
Why this works: Because the code is generated from structured mappings, Wave can create comprehensive test cases that cover all transformation paths.
Export Your Work
Your integration is ready! Here’s what you can export:
- Download mapping as Excel for documentation and team review
- Copy generated code for your production pipeline
- Export integration plan as PDF for stakeholders (coming soon)
What You’ve Accomplished
🎉 Congratulations! You’ve built a complete healthcare data integration using Wave’s mapping-rooted approach:
- ✅ Structured mappings - Not just field connections, but intelligent transformations
- ✅ Production-ready code - Generated directly from your mapping specifications
- ✅ Comprehensive tests - Based on your mapping logic, not generic scenarios
- ✅ Team documentation - Excel exports for clinical SMEs and stakeholders
The key difference: Your code isn’t generated from vague prompts—it’s rooted in precise healthcare mappings that Wave created and you refined.
Ready for Real Projects?
You now understand Wave’s complete workflow. Ready to tackle your actual integration challenges?