Skip to content

OP-887 Aggregate all patient-linked data for GDPR portability export - #1633

Open
giuseppesorge wants to merge 2 commits into
informatici:developfrom
giuseppesorge:OP-887-patient-data-export
Open

OP-887 Aggregate all patient-linked data for GDPR portability export#1633
giuseppesorge wants to merge 2 commits into
informatici:developfrom
giuseppesorge:OP-887-patient-data-export

Conversation

@giuseppesorge

@giuseppesorge giuseppesorge commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

See OP-887.

Adds the aggregation side of the GDPR Art. 20 export: a PatientExport plain aggregate and a new PatientExportManager collecting, via the existing managers, the patient record plus admissions, OPD, laboratories, therapies, operations, vaccines, examinations and bills (with items and payments). Two small manager additions back it: PatVacManager.getPatientVaccines(patientCode) and BillBrowserManager.getPatientBills(patID).

Notes for review:

  • The aggregation lives in a dedicated manager rather than PatientBrowserManager: TherapyManager already constructor-injects PatientBrowserManager, so the reverse edge would create a constructor cycle.
  • New permission patient.export, seeded by sql/step_a128_add_permission_patient_export.sql (P_ID_A 172, granted to admin as GP_ID 318) and mirrored in load_demo_data.sql. The step number and the two ids may need renumbering at merge: a118-a127 and the neighboring ids are reserved by other open PRs.
  • Naming: the ticket says patient.export (singular); every existing patient permission is plural (patients.*). Happy to rename to patients.export if preferred — one-word change across the dependent PRs.
  • Deliberately not exported (documented in the doc PR): profile photo, ward movements, visits, malnutrition, patient consensus, anamnesis, DICOM files. A follow-up ticket can add any of these if wanted.

Verified: new aggregation tests green (vaccines explicitly asserted, per the ticket note about the clinical sheet); the SQL was validated on a real MariaDB 10.6 for all three paths (fresh-install chain, upgrade-only step on an existing schema, full demo load).

Dependent PRs (same branch name for the fork cross-build): API, GUI, web UI and doc follow.

Add PatientExport aggregate and PatientExportManager collecting admissions,
OPDs, laboratories, therapies, operations, vaccines, examinations and bills
(with items and payments) for a single patient. Add the patient.export
permission (step_a128, may be renumbered at merge) and small read helpers
in PatVacManager and BillBrowserManager.
@giuseppesorge

Copy link
Copy Markdown
Contributor Author

Dependent PRs building on this branch: informatici/openhospital-api#595, informatici/openhospital-gui#2229, informatici/openhospital-ui#778, informatici/openhospital-doc#289. Suggested merge order: this PR first (api/gui/ui CI cross-build against the fork branch until then).

…ata-export

# Conflicts:
#	sql/step_04_all_following_steps.sql
@giuseppesorge

Copy link
Copy Markdown
Contributor Author

Merged develop (31c105e) to clear the conflict in sql/step_04_all_following_steps.sql: OP-1231 appended step_a123_add_lot_management_in_pharmacy.sql at the end of the file, so this branch's own source line now comes after it. Nothing else changed, and the branch's diff against develop is the same as before the merge.

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