Skip to content

Compile USDM protocols into ODM study builds#86

Merged
tgerke merged 1 commit into
mainfrom
phase-7/usdm-compiler
Jul 18, 2026
Merged

Compile USDM protocols into ODM study builds#86
tgerke merged 1 commit into
mainfrom
phase-7/usdm-compiler

Conversation

@tgerke

@tgerke tgerke commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Stack position: 3/8 (protocol-first build path).

usdmToBuild() turns a validated USDM package into a StudyBuildDefinition for the existing single build write path: encounters (main-timeline order) become StudyEventDefs, each scheduled activity becomes a form shared across the events where it is scheduled, and biomedical concepts resolve through the mapping pack into shared ItemDefs and CodeLists with the protocol's isRequired/response-code constraints applied.

  • Provenance travels as edc: vendor extensions (ADR-0009 pattern) stored under XML attribute keys so they round-trip both serializations: UsdmRef ids on events/forms/items, planned timing and visit windows on events, protocol-source attributes on the MetaDataVersion. A traceability row list is returned for the API layer to persist relationally.
  • Surrogate and unmatched concepts become draft items flagged edc:Unresolved; validateMetaDataVersion now hard-errors on those, so study_metadata_versions stays capture-ready — drafts must be completed in protocol review before publish.
  • OIDs derive from stable protocol names/c-codes (not USDM UUIDs, which churn between authoring-tool exports), keeping recompiles of amended protocols cleanly diffable by diffBuilds.
  • Conditional flow (scheduled decision instances) and sub-timelines surface as manual-follow-up warnings rather than compiled logic — deliberate v1 scope.

Tests: golden structure, determinism (byte-equal double compile), OID stability across renames/additions, publish-gate both ways, and an XML round-trip proving the edc: extensions survive serialize/parse.

usdmToBuild() turns a validated USDM package into a StudyBuildDefinition
through the existing single write path: encounters (main-timeline order)
become StudyEventDefs, each scheduled activity becomes a form shared
across the events where it is scheduled, and biomedical concepts resolve
through the mapping pack into shared ItemDefs and CodeLists with the
protocol's isRequired/response-code constraints applied.

Provenance travels as edc: vendor extensions (ADR-0009 pattern) stored
under XML attribute keys so they round-trip both serializations: UsdmRef
ids on events/forms/items, planned timing and visit windows on events,
and protocol-source attributes on the MetaDataVersion. A traceability
row list is returned for the API layer to persist.

Surrogate and unmatched concepts become draft items flagged
edc:Unresolved; validateMetaDataVersion now hard-errors on those, so
study_metadata_versions stays capture-ready — drafts must be completed
in protocol review before publish. OIDs derive from stable protocol
names/codes, keeping recompiles of amended protocols diffable.
@tgerke
tgerke merged commit 7fa750f into main Jul 18, 2026
1 check passed
@tgerke
tgerke deleted the phase-7/usdm-compiler branch July 18, 2026 16:05
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