Order population expressions for HTML output #260
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is similar to Lauren's PR here where we sorted the statements into population statements, non-functions, and then function statements; however, now we also order the population statements in the following order:
...and then non-functions and function statements.
New behavior
Population expression statements are now sorted in the above order. This order is based on the following "egg":
Code changes
HTMLBuilder.ts
- I just added the sorting logic for the population expressions directly to thesortStatements
function. Rather than using thepopulationSet
, we now usepopulationIdentifiers
because it includes thecode
(which is always the same) and the criteria expression (which can be different) for each population. That way we can sort statements because on what code their statement name links to.HTMLBuilder.test.ts
- two new unit tests forsortStatements()
- one for a proportion boolean measure (checks ordering of ipp, denom, numer) and one for a cv boolean measure (checks for ordering of ipp, measure population, measure population exclusion, measure observation function).Testing guidance
npm run check
--debug
flag and inspected the html output in thedebug/html
directory.