Skip to content

[celo-contracts] Add a Medical Record Correction Mechanism #920

Description

@llinsss

Background:
addMedicalRecord (celo-contracts/contracts/PetChainRegistry.sol) writes a MedicalRecord that can never be modified afterward — there is no update/correction function of any kind.

Problem:
A vet who makes a data-entry mistake (wrong diagnosis text, wrong date) has no way to correct it; the only option is leaving permanently incorrect medical history on-chain.

What "done" looks like:

  • A correctMedicalRecord(uint256 recordId, string calldata diagnosis, string calldata treatment, string calldata notes) function, restricted to the original recording vet (or admin), updates the record and emits a MedicalRecordCorrected event preserving the original values in the event log for auditability.
  • Tests cover authorized and unauthorized correction attempts.

Implementation guidelines:

  • Key file: celo-contracts/contracts/PetChainRegistry.sol.

PR must include:

  • New function + event
  • Tests
  • Passing Hardhat test run

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions