Medicalsyncapi schema fixes

Local change from MIT server. Depends on #1051 (doesn't actually, but this simplifies merge conflicts).