feat(grz-db): add cases table and pluggable case resolver#633
Open
Hoeze wants to merge 4 commits into
Open
Conversation
c044a98 to
88d6216
Compare
354c3fe to
ca220c0
Compare
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.
Introduces case tracking so multiple submissions can be grouped into one case (an
initialsubmission plus itsaddition/correction/followupfor the same patient/case).The authoritative case identity is the RKI pseudonym (
psn), unique once assigned;(submitter_id, local_case_id)are non-unique resolution keys used until a pseudonym exists. Case lookup is a pluggable strategy (SubmitterLocalCaseResolvertoday,PsnResolverfor the future PSN-based flow).submitter_idstays onsubmissions.feat(grzctl): add db case commands and link submissions to cases on populate
Adds
grzctl db case(list/show/modify/create/relink/delete) and links each submission to its case duringdb submission populate, enforcing that a new case starts with aninitial(ortest) submission and that at most one initial exists per case. A new Alembic migration adds thecasestable and a nullablesubmissions.case_id, backfills existing submissions by grouping on(submitter_id, pseudonym), and keepssubmitter_idonsubmissions. Deploying requiresgrzctl db upgrade.Fixes #632