Repository navigation
feat(viewer): show and manage care relationships per subject and per carer (#6646) - #6687
Open
rubentalstra wants to merge 35 commits into
Open
rubentalstra wants to merge 35 commits into
rubentalstra wants to merge 35 commits into
Conversation
A new Access policy page in the console group draws the controller's ACCESS_POLICY in force by section, each coded value with its rubric and code; its Versions tab lists every version and opens any one read-only; an administrator edits the whole policy in the code editor, saved with If-Match naming the version read (If-None-Match: * for the first). While none is committed the page says nothing is tightened; a 403 and an admin API that is off are drawn as such. The recorder of the replayed CDR provisions its user with the four arguments scim-provision.sh takes, takes its container name from the environment, and seeds two versions of the policy under a write_access_policy grant its own test ceiling admits; the e2e lane seeds the same for its journey.
…ave words The access policy editor, Edit as a new version and the party editors share Unsaved, editor_line, save_as_words and reload_words in pages::common, and Access policy words an attribute as Configuration does; the book page names its audience.
…hic class (#6644) The allow line for the AQL the viewer sends the CDR matches each FROM root AQL defines, EHR and the demographic classes, so the roles and grants queries pass and any other string that starts with SELECT is still read.
…carer (#6646) An EHR's Care tab lists its subject's care relationships, live ones by default and ended ones on request; a party's Care page shows the same for a PERSON with the form that adds one, and the subjects in a carer's care, paged in the session; a relationship's page shows its versions and changes its role or period, ends it today or deletes it, each with If-Match. The recorder seeds the subject's PERSON with three care relationships and the provider ORGANISATION the dev binding names.
rubentalstra
enabled auto-merge
November 26, 2026 12:43
pages::common may not grow past its recorded length, so the editor helpers move to a module of their own.
…ver a version pages::editor::document_form docks the decision bar and draws the refusal, the code editor and its findings; the access policy editor takes it, and Access policy reads an instant through one pages::policy::instant.
…ink and one relationship URL
…he care journey an end date The EHR now draws six tabs, so FerroUI shows a select in place of the row on a phone; the journey's care relationship needs an end, since the e2e access policy holds no relationship_validity default for an open one.
# Conflicts: # app/ferroehr-viewer/locales/policy/en/policy.ftl # app/ferroehr-viewer/locales/shell/en/shell.ftl # app/ferroehr-viewer/src/locale/policy.rs # app/ferroehr-viewer/src/pages/policy/mod.rs # app/ferroehr-viewer/src/routes.rs # app/ferroehr-viewer/src/shell.rs # app/ferroehr-viewer/tests/fixtures/cdr/manifest.json # app/ferroehr-viewer/tests/fixtures/cdr/recording.json # app/ferroehr-viewer/tests/it/e2e_docs_shots.rs # app/ferroehr-viewer/tests/it/ssr_app.rs # scripts/viewer-record.sh # website/book/src/viewer/access-control.md # website/book/src/viewer/index.md
…must be written with an end
…ey ends the relationship
…tionships # Conflicts: # app/ferroehr-viewer/src/bff/mod.rs
# Conflicts: # app/ferroehr-viewer/src/locale.rs # scripts/checks/stray-literals.allow
This branch has not been deployed
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.
Closes #6646
This branch builds on #6683 (#6644, roles and grants), which builds on #6669 (#6642). It carries their commits until they merge. Review only the commits after #6683.
The viewer reads and writes care relationships through the CDR's care relationship resources under
{ext}. The CDR decides each read per subject, so the viewer adds no rule of its own: a relationship the caller may not read is left out, and a403is drawn as the CDR's refusal. No openEHR specification governs these resources: this is FerroEHR's own design over its draft access control package.An EHR's Care tab (
/ehrs/{id}/care,GET care_relationship?subject_id=&subject_namespace=) lists the relationships of the subject thatEHR_STATUSnames. Each row shows:PERSONorROLEtarget, team for aGROUPorORGANISATION.The tab shows live relationships by default. Ended ones too (
all=true) and Live on (at=) are aGETform. A subject with no external reference gets a sentence saying so. The tab links to the subject'sPERSONpage to manage relationships, because the person id is known only once a relationship names it.A party's Care page (
/parties/{kind}/{id}/care, linked from the party Overview):PERSON, the same list (GET demographic/person/{id}/care_relationship) and the form that adds one: carer kind and id, care role, provider identifier issuer and id, From and To.GET care_relationship?carer=), paged through the session cookie (crate::paging, a newcare-of-carerlisting). The list can show patient data, so the page position stays out of the URL.A relationship's page (
/care/{uid}) shows its facts and its versions with who committed each and when (versioned_care_relationship/{uid}/revision_history). An older version opens read-only by its version uid. Three writes are available, each naming the version read inIf-Match, with a refusal drawn in the CDR's words:Care role choices: the
HL7_ParticipationTypecodes, the terminology the CDR reads when the policy binds nocare_rolevalue set. A role of another terminology is posted asterminology|code, and the CDR checks it against the value set the policy binds. The viewer takes the terminology id fromopenehr_rm::draft::access_control::terminology::TERMINOLOGY_ID_PARTICIPATION_TYPE, so it now depends onopenehr-rmwith thedraftfeature.The recorder seeds three more things:
PERSONfor the EHR's subject, declaring its record subject throughopenehr_access::record_subject;ORGANISATION, carrying the identifierurn:oid:2.999.7.9|devthat the dev configuration's party binding names;Tests
ssr_app::careruns over the re-recorded CDR. It covers the EHR tab (live, and ended on request), a person's and a carer's Care page, a relationship's versions, an add (recorded live) and an end.e2e_care(a browser journey) seeds a patient, a carer and a provider over REST. It then adds a relationship through the form, ends it behind its confirmation, finds its first version, and finds the patient in the carer's list./ehrs/{id}/careand/parties/person/{id}/care. Unit tests cover the document a new relationship writes, a change that keeps every other attribute, the path, the span query and the posted role.Docs
viewer/access-control.mdhas a Care relationships section, and the viewer index mentions the tab.6646-viewer-care-relationships.added.md.