Skip to content

S0314-astm-13: publication-level LIVD metadata, carried onto every annotation - #86

Open
NSchatz wants to merge 3 commits into
mainfrom
sdd/S0314-astm-13
Open

NSchatz wants to merge 3 commits into
mainfrom
sdd/S0314-astm-13

Conversation

@NSchatz

@NSchatz NSchatz commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Spec: pipeline/active/S0314-astm-13/spec.md (umbrella).

A consumer who builds a LIVD catalog from a vendor publication could record the vendor rows and nothing about the publication behind them, so a mapping this library annotated was not reproducible and the attribution statement the LOINC license requires had nowhere to travel beside the mappings it applies to.

What this adds

  • LivdPublication: four optional publication-level elements (publisher, publicationVersion, loincVersion, loincCopyright), supplied as an optional second argument to defineLivdCatalog and readable back as LivdCatalog.publication. Each declared value is preserved verbatim; absent, empty and whitespace only are one case, no value declared.
  • LivdAnnotation.catalogLoincVersion: the catalog's declared LOINC version, carried on every annotation that catalog produced, whatever the lookup answered. Conditional, so an annotation from a catalog declaring none keeps the key set it has today.
  • ASTM_LIVD_CATALOG_NO_LOINC_VERSION on LivdCatalog.warnings, raised once where the catalog is defined and never per record, with AstmLivdCatalogWarning, LivdCatalogIdentity, LIVD_CATALOG_IDENTITY_UNDECLARED and livdCatalogMissingLoincVersion.

What it deliberately does not do

  • No validation of any kind: no version format check, no copyright-text check, no publisher check. This package still performs no LOINC validation of any kind, and the suite grades that by asserting values no validator would accept, so a validator added later goes red.
  • No refusal: a catalog with no LOINC version is built, indexed and answers every lookup exactly as it would have, and the per-record warning stream keeps the same codes, in the same order, in the same number.
  • The warning message is a constant carrying no consumer-supplied text. The catalog is named from a structured field, and a catalog that declared no identity is said to have declared none rather than given an invented or indexed name.
  • Carrying an attribution statement is not discharging it. The obligation stays the consumer's and the shipped guide says so beside the capability.

Release bookkeeping: a minor changeset (it adds public values), a CHANGELOG.md [Unreleased] entry, and documentation/release-readiness.md updated: the audit row, the five added identifiers in the surface enumerations with the counts to match, and the one break candidate this carries (LivdWarningCode gains a registry member, so an exhaustive switch needs one more arm).

Gates: pnpm typecheck && pnpm lint && pnpm format:check && pnpm test:coverage && pnpm build && pnpm attw && pnpm smoke && pnpm check && pnpm check:no-emdash && pnpm check:no-internal-refs && pnpm phi-scan runs green end to end (1220 passed, 4 pre-existing skips; src/terminology at 99.03 statements, 99.19 branches). No gate config, allow-list or workflow was touched, and no suppression or skipped test was added.

…g-LOINC-version warning

Four optional, consumer-supplied publication elements ride on a LIVD catalog
(publisher, publication version, LOINC version, LOINC copyright), each preserved
verbatim and validated by nothing. The declared LOINC version is carried onto
every annotation the catalog produces, conditionally, so a catalog declaring none
keeps the key set it has today. A catalog defined with no LOINC version surfaces a
value-free ASTM_LIVD_CATALOG_NO_LOINC_VERSION warning on the catalog itself and is
still built: the message is a constant and the catalog is named through a
structured identity field, which says positively when none was declared.
…ness record

The LIVD guide section builds its catalog with the four publication elements,
states that the LOINC license requires a statement of attribution and where the
consumer's statement rides, and puts the two limits beside the capability: this
package validates none of the metadata, and carrying an attribution is not
discharging it. The changeset is minor because the change adds public values; the
release-readiness record names it in the audit, enumerates the five added
identifiers with the counts to match, and records the LivdWarningCode widening as
its one break candidate.
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.

1 participant