Using AI to Convert Legacy Forms
Overview
You can use Large Language Models (LLMs) like Claude, ChatGPT, or GitHub Copilot to assist with the conversion of Legacy Task forms to Task Manager protocol format. This approach has been tested on a few forms and has worked reasonably well, potentially reducing conversion time from 2-4 hours to approximately 10-15 minutes per form.
Experimental Approach
This LLM-assisted conversion process is a suggested approach, not a guaranteed method. It may not work for all forms, particularly those with complex conditional logic or unusual structures. Always thoroughly review and test the converted output before using in production.
Prerequisites
Before starting a conversion, gather these required files:
Technical Specification Documents
These documents define the conversion rules and output format:
- Form Conversion Specification:
legacy-to-task-manager-form-conversion.md - Form Schema Reference:
user_protocol_form_technical.md - E-signature Reference (optional):
user_protocol_esignature_technical.md
Legacy Form File
The source form in Legacy OHIF JSON format that you want to convert (for example, form-retinopathy-grading-v2.json). It is the same example used in the Legacy Form Conversion Example.
Recommended LLM Platform
Claude (Anthropic) is recommended for form conversion because:
- Large context window (200K tokens) handles multiple documents easily
- Excellent at following complex technical specifications
- Capable of processing multiple files simultaneously
Use Claude Sonnet 4.5 or newer via Claude.ai or API.
Alternative platforms: ChatGPT (GPT-4 Turbo or newer) or GitHub Copilot can also work but may require more careful context management.
Conversion Steps
Step 1: Upload Documents to the LLM
Provide these files to your chosen LLM platform:
Required:
legacy-to-task-manager-form-conversion.md(conversion specification)user_protocol_form_technical.md(form schema reference)- Your legacy form JSON file (for example,
form-retinopathy-grading-v2.json)
Optional:
user_protocol_esignature_technical.md(if form requires e-signatures)
Step 2: Request the Conversion
Use this prompt template:
Replace [legacy-form-file] and [form-name] with your actual file names.
Step 3: Review the Output
The LLM should create two files:
-
Protocol JSON File (
[form-name]-protocol.json)- Contains the converted form in Task Manager format
- Has only two top-level keys:
formandesignature_config
-
Conversion Notes (
[form-name]-conversion-notes.md)- Documents all changes made during conversion
- Provides field-by-field conversion summary
- Includes testing checklist
Quick Verification Checklist
After receiving the LLM output, verify these essential aspects:
Protocol Structure
Verify the JSON file has the correct top-level structure:
Check:
- [ ] Only two top-level keys:
formandesignature_config - [ ] No
label,group_id,task_type, etc. (those are provided when uploading via API, not in the file)
Key Property Conversions
Spot-check a few fields to verify these conversions were applied:
- [ ]
components[]changed tofields[] - [ ]
values[]changed tooptions[] - [ ]
validate.requiredchanged torequiredWhenVisible - [ ]
type: "selectboxes"changed totype: "checkbox" - [ ]
type: "textfield"changed totype: "text" - [ ]
type: "textarea"changed totype: "text-area"
JsonLogic Operators
If your form uses conditional visibility, verify:
- [ ] All
==operators changed to===(strict equality) - [ ] No legacy operator formats remain
Next Steps
After completing the conversion:
- Save the output files - Download both the protocol JSON file and conversion notes
- Review conversion notes - Read the documentation to understand what changed
- Upload to Task Manager - Use the protocol JSON file when creating your protocol
- Test in development - Verify the form works correctly before using in production
Common Issues
Issue: Extra Top-Level Keys in JSON
If the output includes keys like label, group_id, or task_type at the top level, ask the LLM to correct this:
Issue: Test Placeholder Content
If e-signature reasons contain placeholders like "Test Reason 1", request production-appropriate reasons:
Related Documentation
- Legacy to Task Manager Form Conversion Specification - Complete technical conversion rules
- Legacy Form Conversion Example - Detailed walkthrough of a diabetic retinopathy form conversion
- Task Manager Form Technical Reference - Complete form schema documentation
- E-signature Configuration Reference - E-signature configuration options