Skip to content

Fix retirement reason when creating retired AMPATH forms - #334

Open
Duvet05 wants to merge 1 commit into
mekomsolutions:mainfrom
sihsalus:fix/create-retired-ampath-form
Open

Duvet05 wants to merge 1 commit into
mekomsolutions:mainfrom
sihsalus:fix/create-retired-ampath-form

Conversation

@Duvet05

@Duvet05 Duvet05 commented Sep 23, 2026

Copy link
Copy Markdown

When an AMPATH JSON schema declares a new form (or new version) with retired: true, createNewForm saves it without a retirement reason. OpenMRS validation rejects it with retireReason: general.retiredReason.empty; strict Initializer startup aborts.

Reuse the same default retirement reason already applied when retiring an existing form. Integration tests cover a new retired form and a retired version replacing an active form, including preservation of the previous schema resource. No changes to form identity, schema content, publication flags or validation rules.

Validation (synthetic data, no Docker):

  • Both added integration tests failed before the fix; all five AMPATH loader tests pass after it.
  • Full Maven reactor on Java 11: 254 tests, zero failures/errors/skips; build successful.
  • Core 2.8 module on Java 21: 14 tests passed; build successful.
  • git diff --check passed. Excluded unrelated formatter output generated by the inherited build plugin.

Downstream integration: sihsalus/sihsalus#336. The downstream content uses declarative retirement; this fixes the owning loader instead of adding SQL or a second loader. Downstream maintainer: @Duvet05; replace the temporary fork pin with an upstream release containing this fix after equivalent validation.

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