Skip to content

OP-1037 Add the administrative consensus flag to PatientConsensus - #1620

Open
giuseppesorge wants to merge 2 commits into
informatici:developfrom
giuseppesorge:OP-1037-administrative-consensus-flag
Open

OP-1037 Add the administrative consensus flag to PatientConsensus#1620
giuseppesorge wants to merge 2 commits into
informatici:developfrom
giuseppesorge:OP-1037-administrative-consensus-flag

Conversation

@giuseppesorge

@giuseppesorge giuseppesorge commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

OP-1037 — Administrative Service Flag (core)

Adds a new administrative boolean flag (column PTC_ADMINISTRATIVE) to the Patient Consensus feature, mirroring the existing service flag (PTC_SERVICE) end-to-end. Per the ticket, the flag records the administrative consensus for additional services (Portal), so the hospital can block the service for administrative reasons against the patient's will.

Changes

  • PatientConsensus model: new administrativeFlag field, accessors, constructor parameter and toString().
  • New migration sql/step_a124_patient_consensus_administrative_flag.sql (ALTER TABLE OH_PATIENT_CONSENSUS ADD COLUMN PTC_ADMINISTRATIVE TINYINT(1) NOT NULL DEFAULT 0 AFTER PTC_CONSENSUS), registered in step_04_all_following_steps.sql after step_93 so existing databases get the column.
  • sql/load_demo_data.sql: the column and a default value added to the demo oh_patient_consensus CREATE and its INSERTs.
  • The original step_93_patient_consensus_table.sql CREATE is intentionally left unchanged, so a fresh install (step_93 then step_a124) does not double-add the column.
  • Tests updated to set/assert the new flag.

Note for reviewers

  • Step number a124: a118 is the next free number on develop, but several other open migration PRs reserve a118a123; this uses a124 to avoid an immediate collision. Happy to renumber on merge.
  • Upgrade path: the migration is registered in step_04_all_following_steps.sql (the fresh-install aggregator that create_all_* source). The documented incremental upgrade chain under sql/update/ currently ends at step_a117 (in update_1_14-1_15.sql); like the other open post-1.15 migration PRs, step_a124 will need to be rolled into the next release.'s update_1_15-1_16.sql so databases upgraded via sql/update also get the column.

Testing

  • org.isf.patconsensus.Tests (6) and org.isf.patient.Tests (71) green.
  • Verified on MariaDB 10.6: the step_93step_a124 sequence adds the column with no duplicate-column error and back-fills it to 0; the load_demo_data column count matches its INSERT values; create_all_demo (sourcing step_04 then load_demo_data) yields the column.

Part of OP-1037: API informatici/openhospital-api#592, GUI informatici/openhospital-gui#2222.

Add a new PTC_ADMINISTRATIVE boolean flag to the patient consensus, mirroring the existing service flag end-to-end: PatientConsensus.administrativeFlag (field, accessors, constructor, toString); a new migration sql/step_a124_patient_consensus_administrative_flag.sql (ALTER ADD COLUMN AFTER PTC_CONSENSUS, registered in step_04) for existing databases; and the column/value added to load_demo_data. The original step_93 CREATE is intentionally left unchanged so the step sequence does not double-add the column. Tests updated to set/assert the new flag.

Verified on MariaDB: the step_93 -> step_a124 sequence adds the column with no duplicate error and back-fills it to 0; the load_demo column count matches its INSERT values. NB: step number a124 may need renumbering at merge time if it collides with another open migration PR.
…rative-consensus-flag

# Conflicts:
#	sql/step_04_all_following_steps.sql
@giuseppesorge

Copy link
Copy Markdown
Contributor Author

Merged develop (7816c42) 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.

One thing for whoever merges first: this branch claims step_a124, and so does #1616 (OP-1242) — whichever lands second will have to be renumbered.

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