Skip to content

Fix VISIT_DETAIL missing from specification table of contents (#813) - #818

Open
DG47 wants to merge 1 commit into
OHDSI:mainfrom
DG47:fix/spec-toc-visit-detail
Open

DG47 wants to merge 1 commit into
OHDSI:mainfrom
DG47:fix/spec-toc-visit-detail

Conversation

@DG47

@DG47 DG47 commented Oct 12, 2026

Copy link
Copy Markdown

Fixes #813

VISIT_DETAIL is rendered on the v5.5 specification page but is missing from the left-hand "On this page" menu between VISIT_OCCURRENCE and CONDITION_OCCURRENCE. The same happens on the v5.3 and v5.4 pages.

Cause

render_spec_doc() in site/R/specDocRenderer.R prints each field table with print(table_html), which does not end with a newline, so in the knitted markdown the next heading follows </table> on the same line:

</table>###  VISIT_DETAIL {.tabset .tabset-pills}

This is usually harmless, but the visit_occurrence.visit_end_date ETL conventions contain a markdown list. After that table the VISIT_DETAIL heading is not parsed as its own section: it is emitted as a bare <h3 id="visit_detail"> inside the VISIT_OCCURRENCE section, so Quarto leaves it out of the TOC.

Change

  • site/R/specDocRenderer.R: write a blank line after each printed table, so every table heading starts a new block.
  • docs/cdm53.html, docs/cdm54.html, docs/cdm55.html: the rendered result. In each page, VISIT_DETAIL gets its own <section id="visit_detail"> and a TOC entry. Nothing else changes. To keep the diff small, I applied only the lines that changed between renders before and after the fix, and left out the unrelated Quarto version and CSS hash changes from my local render. docs/search.json changes only by whitespace in the "Clinical Data Tables" entries, so I did not touch it.

Testing

I rendered cdm53.qmd, cdm54.qmd, cdm55.qmd and cdm60.qmd with Quarto 1.10.19 before and after the change:

page TOC entries before / after level-3 sections before / after headings outside a section before / after
cdm53 43 / 44 36 / 37 1 (visit_detail) / 0
cdm54 46 / 47 38 / 39 1 (visit_detail) / 0
cdm55 49 / 50 41 / 42 1 (visit_detail) / 0
cdm60 47 / 47 38 / 38 0 / 0

After the change, every table in each Table_Level CSV has its own section (37, 39, 42 and 38 tables). The before/after HTML diff is limited to the VISIT_DETAIL TOC entry and section wrapper. cdm60 renders identically. The package tests (tests/testthat) still pass. They do not cover site/.

render_spec_doc() printed each field table without a trailing newline,
so the next table heading followed "</table>" on the same line. The
visit_occurrence.visit_end_date ETL conventions contain a markdown list,
and after that table the VISIT_DETAIL heading was not parsed as its own
section, so it was missing from the left-hand table of contents on the
v5.3, v5.4 and v5.5 pages.

Emit a blank line after each table so every table heading starts a new
block, and update the rendered cdm53, cdm54 and cdm55 pages.

Fixes OHDSI#813

This branch has not been deployed

No deployments
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.

Visit_detail missing from v5.5 lateral menu

1 participant