opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
50 stars 39 forks source link

Configure PDF Generation #3235

Open FikriMilano opened 1 month ago

FikriMilano commented 1 month ago

Describe the feature request. Using configuration, connect the HTML structure to be used to generate PDF together with the questionnaire that intends to use that HTML structure.

Additional context N/A

Acceptance criteria A check list of all things to verify once the implementation by the engineer is complete

Area path A list of ordered steps in the app on usage of the feature to support anyone testing it e.g. Code reviewer, QA e.g.

  1. Go to a profile
  2. Tap the button that will trigger the PDF generation
  3. App shows a print manager dialog
  4. Tap save as PDF

Implementation plan (For Engineers) The plan for implementing the solution e.g. via a description or a check list for the various ordered tasks that will need to be completed.

  1. Safe the HTML as a Binary resource
  2. Create a rule in the profile, if the taskQuestionnaireId is X then return that Binary resource ID
  3. Pass that rule that contains the Binary resource ID to the questionnaireConfig's property, probably called pdfStructureId
  4. In the code, use that ID to get the HTML Binary resource
  5. Use the HTML
FikriMilano commented 1 month ago

@pld feel free to review this ticket

pld commented 1 month ago

looks great!