Compile USDM protocols into ODM study builds#86
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack position: 3/8 (protocol-first build path).
usdmToBuild()turns a validated USDM package into aStudyBuildDefinitionfor 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.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.edc:Unresolved;validateMetaDataVersionnow hard-errors on those, sostudy_metadata_versionsstays capture-ready — drafts must be completed in protocol review before publish.diffBuilds.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.