projecttacoma / fqm-execution

fqm-execution is a library that allows users to calculate FHIR-based electronic Clinical Quality Measures (eCQMs) and retrieve the results in a variety of formats
https://projecttacoma.github.io/fqm-execution/
Apache License 2.0
18 stars 6 forks source link

Add statement-level HTML generation #268

Closed sarahmcdougall closed 1 year ago

sarahmcdougall commented 1 year ago

Which fqm-execution feature is this request related to? HTML statement generation (used for logic highlighting and clause coverage)

Describe the solution you'd like A new boolean calculation option buildStatementLevelHTML will be added, that is false by default.

When true, the statement results returned from measure calculation will have a new populated field statementLevelHTML on each statement result. The statement-level HTML will be accessible via the statementResults array that exists on the detailedResults that are returned upon successful measure calculation. Note that the statement-level HTML will only exist for statements with relevance not equal to “NA.”

The structure of each statementResult will be as follows:

{
   "libraryName": "library name",
   "statementName": "statement name",
   ...
   "statementLevelHTML": "statement-level HTML"
}

When false, the statement results returned from measure calculation will not have a populated field for statement-level HTML. If the calculateHTML calculation option is set to true, then the detailedResults for a single population group will still contain the HTML markup across all the CQL statements for the given measure. In other words, when false, the functionality is the same as the current functionality on the master branch.

For backwards compatibility, the html field that currently exists on the detailedResults will not be affected, and the debug option will still generate the debug HTML with the entire HTML output.

Additional context This new feature will allow the user to build their HTML alongside the “pretty” formatted statements without having to do so on the entire HTML output. This gives additional flexibility, as the user will not need to parse through the HTML and inject content at each statement result.

sarahmcdougall commented 1 year ago

Added in v1.3.0