Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PDF config properties in QuestionnaireConfig #3498

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

FikriMilano
Copy link
Collaborator

@FikriMilano FikriMilano commented Sep 13, 2024

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Migration guide from QuestionnaireConfig to PdfConfig for PDF generation purpose.
From:

{
  "trigger": "ON_CLICK",
  "workflow": "LAUNCH_QUESTIONNAIRE",
  "questionnaire": {
    "id": "q1,
    "title": "Form Title at the top,
    "type": "EDIT",
    "saveButtonText": "Save",
    "taskId": "t123",
    "resourceType": "Patient",
    "resourceIdentifier": "p1234",
    "htmlBinaryId": "Binary/b1234"
    "htmlBinaryTitle": "Depression Report"
  }
}

To:

{
  "trigger": "ON_CLICK",
  "workflow": "LAUNCH_PDF_GENERATION",
  "pdfConfig": {
    "pdfTitle": "Depression Report",
    "pdfTitleSuffix": "James",
    "pdfStructureReference": "Binary/b1234",
    "subjectReference": "Patient/p1234",
    "questionnaireReferences": [
      "Questionnaire/q1",
      "Questionnaire/q2",
      "Questionnaire/q3",
      "Questionnaire/q4"
    ]
  }
}

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

@FikriMilano FikriMilano self-assigned this Sep 13, 2024
Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 47.94521% with 38 lines in your changes missing coverage. Please review.

Project coverage is 27.2%. Comparing base (2f8055b) to head (27fe6b7).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ister/fhircore/quest/ui/pdf/PdfLauncherFragment.kt 0.0% 18 Missing ⚠️
...egister/fhircore/engine/configuration/PdfConfig.kt 0.0% 14 Missing ⚠️
...fhircore/quest/util/extensions/ConfigExtensions.kt 0.0% 3 Missing ⚠️
...smartregister/fhircore/engine/pdf/HtmlPopulator.kt 94.4% 0 Missing and 2 partials ⚠️
...ster/fhircore/quest/ui/pdf/PdfLauncherViewModel.kt 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              main   #3498   +/-   ##
=======================================
  Coverage     27.2%   27.2%           
- Complexity     749     753    +4     
=======================================
  Files          275     276    +1     
  Lines        13940   13996   +56     
  Branches      2532    2542   +10     
=======================================
+ Hits          3794    3815   +21     
- Misses        9622    9657   +35     
  Partials       524     524           
Flag Coverage Δ
engine 64.3% <68.6%> (-0.1%) ⬇️
geowidget 11.5% <ø> (-1.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ircore/engine/configuration/QuestionnaireConfig.kt 79.1% <ø> (+1.1%) ⬆️
...ister/fhircore/engine/domain/model/ActionConfig.kt 79.5% <100.0%> (+0.4%) ⬆️
...ster/fhircore/quest/ui/pdf/PdfLauncherViewModel.kt 0.0% <0.0%> (ø)
...smartregister/fhircore/engine/pdf/HtmlPopulator.kt 87.8% <94.4%> (+1.2%) ⬆️
...fhircore/quest/util/extensions/ConfigExtensions.kt 0.0% <0.0%> (ø)
...egister/fhircore/engine/configuration/PdfConfig.kt 0.0% <0.0%> (ø)
...ister/fhircore/quest/ui/pdf/PdfLauncherFragment.kt 3.1% <0.0%> (-0.3%) ⬇️

... and 1 file with indirect coverage changes

@ellykits
Copy link
Collaborator

@FikriMilano Can you share a sample content for the pdfStructureReference Binary resource? Remember to update the docs with these new code changes.

@FikriMilano FikriMilano force-pushed the 3489-and-3490-and-refactor-pdf-config branch from f454707 to c5aab3a Compare September 17, 2024 10:20
@FikriMilano
Copy link
Collaborator Author

@ellykits see this file docs/engineering/app/configuring/pdf-generation.mdx

@FikriMilano
Copy link
Collaborator Author

@ellykits ellykits changed the title 3489 and 3490 and refactor pdf config Refactor PDF config properties in QuestionnaireConfig Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants