Uploaded image for project: 'Reporting Module'
  1. Reporting Module
  2. REPORT-761

Automatically load definitions at startup

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.1
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Undetermined

      Description

      Background

      I'd like a way to write reporting definitions (especially cohort definitions, and data set definitions) that can be version controlled in an "implementation config" repository.

      My personal driver for this is to do a proof of concept of a simple "late visits" report in Bahmni, based on the reporting module.

      For this POC I only care about having "component" definitions available, and accessible synchronously by REST. I don't care about defining full reports, or the asynchronous ReportRequest approach. (And thus I don't care about persisting definitions to the DB.)

      Proposal

      I propose that at reporting module startup, we should look in:

      • $APPDATA/configuration/reporting/definitionlibraries/cohort
      • $APPDATA/configuration/reporting/definitionlibraries/dataset
      • ...

      Each of these folders would lead to a single DefinitionLibrary being instantiated. For the `cohort` folder, getDefinitionType() would return `CohortDefinition.class`, with definition prefix "impldefined.library.cohort", etc.

      This folder could hold a bunch of xml files (or eventually json, etc). Each file would be one definition within the library. The filename would give you the definition name, similar to @DocumentedDefinition(value="upToAgeOnDate"). The content of the file would be loaded using ReportingSerializer.

      Further Thoughts

      Related to this, I'd be interested in being able to define more complex calculations, e.g. by loading groovy files at startup. (For example "month of culture conversion" in a TB system.)

        Attachments

          Activity

            People

            Assignee:
            darius Darius Jazayeri
            Reporter:
            darius Darius Jazayeri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: