GSoC 2022 with OpenMRS: Week 12
The Week 12 of Google Summer of Code started on 29th of August. In my previous blog post I talked about the progress of the interactive builder. If you haven’t read my previous post here is a link for that post. My main goal for this week was to start working on the Form viewer component. I requested a week extension because I was running behind schedule, and the mentors granted an extension.
At the beginning of this week I was able to send the Pull request on the interactive builder and start working on the form viewer component. The form viewer component renders a preview using the form schema. After creating a form with the schema editor or the interactive builder, the user can preview it by clicking the render button.
OpenMRS is currently using the Ampath form engine to render forms in Micro front-ends such as the forms app. The Ampath form engine is an Angular module, but because we’re using single-spa, we can use modules from other frameworks. However, in order to use the engine, the form viewer component must be built using Angular, where I can use the functions in the Ampath form engine to render the form. I spent days working out this aspect by trying various things. Then I had a look at how it was done in the patient chart app.
The patient chart renders the form using an extension named form-widget
. What is an extension? Here’s a short video that explains the concept of extensions. The form-widget
extension is an angular module that was developed to generate forms using the JSON schema and a few other properties like formUuid
, patientUuid
, and visitUuid
. This extension is used to generate forms in other micro front-ends.
The problem with this extension is that it requires properties like patientUuid
and visitUuid
, which are not available when generating forms in the form builder. After attempting these, I contacted my mentor and scheduled a call in the beginning of the following week to discuss this issue. I’m hoping to find a solution to this issue soon.
Meanwhile, the interactive builder PR has been reviewed, and there are a few requested changes to work on. Thank you for reading, Stay tuned and check back next week for the thirteenth week’s blog post. Peace ✌️