
ADR: Mapping Sheet Structure
Katarzyna Graczyk
2026-07-16
Source:vignettes/articles/adr-mapping_sheet.Rmd
adr-mapping_sheet.Rmd| Package | mighty.metadata |
| Status | Approved |
| Version | 0.2.0 |
| Description | ADR for defining the structure of mapping metadata in compliance
with mighty.toolbox needs |
Success Criteria
-
mighty.metadatadeclares schema support for study-levelstandardsandterminologyfields ininst/schema/study.json. -
_study.ymlsupports structuredstandardsandterminologysections. - Each
standards/terminologyentry requiresidandversion. -
mighty.toolboxcan consumestandardsandterminologyfrom_study.ymlwithout manual transformation when generatingdefine.xml. - The structure can be correctly referenced in all supported levels
for
define.xmlgeneration.
Context
Standards and terminology are study-level metadata and should be
stored directly in _study.yml. The required structure is
list-based and explicit:
-
standards: list of objects withidandversion -
terminology: list of objects withidandversion
This structure is intended to be the source consumed by
mighty.toolbox for define.xml generation.
Decisions
- Standards/terminology are implemented inside
_study.ymlas study-level metadata. - Validation is implemented in
inst/schema/study.json. - Two new optional top-level fields are added to study metadata:
standardsterminology
- Entries in both lists must contain:
-
id(required) -
version(required)
-
Example Representation
study_id: example_study
standards:
- id: ADaM-IG
version: 1.1
terminology:
- id: ADAM
version: 2025-08-06
- id: SDTM
version: 2025-08-06
- id: MedDRA
version: 22.1
- id: WHODrug
version: 2023 JANValidation and Checks
Validation is performed as part of study-level schema validation for
_study.yml.
Rules:
-
standardsandterminologyare optional top-level fields. - If present, each must be an array of objects.
- Each object must include required fields
idandversion. - Additional fields may be allowed for forward compatibility unless explicitly restricted in schema.
Validation must also accept the “empty mapping information” case:
- missing
standardsand/orterminology - existing
standards: []and/orterminology: []
Both variants are interpreted as no standards/terminology entries.
Responsibility split:
-
mighty.metadataperforms structural/schema validation only (presence, shape, required fields). -
mighty.metadatadoes not perform domain-semantic validation (e.g., version-existence checks in GCMD). -
mighty.toolboxperforms domain-semantic validation required for downstreamdefine.xmlgeneration, including checks whether submitted versions exist in GCMD.
Classes
The implementation follows the existing mighty_study
structure by extending the study payload (loaded from
_study.yml) rather than introducing a new top-level
component. This keeps standards/terminology in the same study-level
object and aligns with the decision that they are part of core study
metadata.
Implementation Details
- Update
inst/schema/study.json:- add
standardsas an array of objects, - add
terminologyas an array of objects, - require
idandversionfor each item.
- add
- Keep validation in the existing study loading path
(
_study.ymlschema validation). - Ensure
write_mighty_study()preserves/writesstandardsandterminologyin_study.yml.
Add tests:
- valid
_study.ymlwith both sections, - missing
id/version-> validation message, - roundtrip read/write retains structure,
- empty-list cases (
standards: [],terminology: []) are valid, but validation messages may be issued.
Testing Strategy
- Test in
mighty.toolboxusingmighty.metadatametadata. - Unit and/or acceptance tests in
mighty.metadata. - Add tests for empty standards/terminology scenarios:
- no
standardsfield, - no
terminologyfield, -
standards: [], -
terminology: [], - expected result: valid study metadata with no standards/terminology entries.
- no
Compliance Considerations
- All development on GitHub using Pull Requests for merges to
main, following standard ATMOS branch protection rules. -
R CMD Checkmust pass on all relevant platforms before a PR is approved.
References
- mighty.metadata
- mighty.toolbox (internal package)
- r.workflows