Repository navigation
Add ConditionRole and RiskBasis: optional vocabularies for how a group stands to a condition - #63
Merged
Merged
Conversation
…p stands to a condition Two enums for `normalized` entries on `Group.medical_condition`, never slots, so a record carries none until a normalizer writes them (James, 2026-11-27): - ConditionRole: none | primary | comorbid | at_risk, per condition rather than per item, and more than one where they hold. Succeeds the pipeline's `astra medical role` (manifest `medical_role`, kept to read old records), adding at_risk. - RiskBasis: familial | genetic | clinical | biomarker | condition | exposure | behavioral | trait, one entry per basis the source states and none where it states none. The kinds a survey of 2,377 papers defining an at-risk sample found; no `unstated`, since a missing entry already says so and the schema has one encoding of missingness. `is_healthy` is true for a group only at risk of a condition, and the header's invariant now says so. The extraction projection and the generated models are regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jdkent
added a commit
that referenced
this pull request
Nov 28, 2026
Keeps both vocabulary lists in Normalization.vocabulary's description: condition_extension from this branch, ConditionRole and RiskBasis from #63. Generated models regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds the vocabularies for how a group stands to each condition it names, including being at risk of one. These are the study_schema part of the high-risk design (decisions 2026-11-27).
Both are optional. They are enums for
normalizedentries onGroup.medical_condition, never slots. A record carries none of them until a normalizer writes them, and every existing record stays valid.test_condition_role.pychecks that no model field ranges over either.ConditionRole:none | primary | comorbid | at_riskprimaryand bipolar disorderat_risk. One condition may carry more than one role.astra medical role(manifestmedical_role: none, comorbid, primary, one per item) and addsat_risk. The manifest entry stays, so records written with the old string still read, and its notes now say what replaced it.RiskBasis:familial | genetic | clinical | biomarker | condition | exposure | behavioral | traitfamilialandgenetic. Where the source states none, there is no entry.familial.Age and sex appeared only as matching variables, so there is no demographic value.
unstatedvalue. pondie'schecks.linkmlrefuses an enum value for missingness, because the schema's one encoding of it isextraction_status: not_reported. A missing basis entry already says the source gave none.is_healthymedical_conditionto be empty") say so.normalization.is_healthyimplements the rule in a later PR.Generated
models/storage.py,models/extraction.pyand both JSON Schemas are regenerated.group.yamlis regenerated withpondie.schema.generate, for theis_healthywording. The enums aren't projected: no extracted field reaches them, as withAgeUnit.Checks
In a fresh venv with CI's install:
pytest: 324 passed.tools/generate_models.py --checkpasses.generate --check,field_provenance,linkml,extraction_to_storage_map,storage_parameter_priorities) all pass.Overlap and what follows
condition_extension) edits the sameNormalization.vocabularydescription and the same generated files. Whichever merges second needs a small merge and a regenerate.is_healthy;ConditionRoleand keeps at-risk conditions in their own columns. Its review golden schemas change with the pin.🤖 Generated with Claude Code