This Python script converts Excel files into JSON format for OpenMRS 3 forms.
- Python 3.x
- pandas
- openpyxl
- uuid
- json
Clone this repository and navigate into the project directory:
# Clone the script
git clone https://github.com/michaelbontyes/xlsx-to-O3-form-converter
cd xlsx-to-O3-form-converter
# Run the script to generate the json file - specify the Xlsx and Json output in the script directly
py xlsx-to-O3-forms.py
-
Root Level
- name
- description
- version
- published
- retired
- encounter
- processor
- referencedForms
- uuid
- pages (List)
-
Pages
- Each page contains:
- label
- sections (List)
- Each page contains:
-
Sections
- Each section contains:
- label
- isExpanded
- questions (List)
- Each section contains:
-
Questions
- Each question contains:
- label
- type
- required
- id
- questionOptions
- validators
- hide (Optional)
- Each question contains:
-
Question Options
- Each question option contains:
- rendering
- concept
- conceptMappings
- answers (List)
- Each question option contains:
-
Answers
- Each answer contains:
- concept
- label
- Each answer contains: