(feat) O3-5420: Add PersonAttribute adapter support to Form Engine#681
Open
RajPrakash681 wants to merge 3 commits intoopenmrs:mainfrom
Open
(feat) O3-5420: Add PersonAttribute adapter support to Form Engine#681RajPrakash681 wants to merge 3 commits intoopenmrs:mainfrom
RajPrakash681 wants to merge 3 commits intoopenmrs:mainfrom
Conversation
- Implement PersonAttributeAdapter following PatientIdentifierAdapter pattern - Add personAttribute type to inbuilt field value adapters registry - Add attributeType field to FormQuestionOptions interface - Add PersonAttribute interface to domain types - Add savePersonAttribute API method for backend persistence - Add personAttribute to contextInitializableTypes array - Add preparePersonAttributes and savePersonAttributes helper functions - Integrate person attribute processing in encounter form submission flow - Add comprehensive unit tests with full coverage (11 tests passing) This enables Form Builder to render and process person attribute fields. Previously, these fields were silently hidden in preview mode, causing form rendering issues and preventing data submission. Tested with all existing tests passing (334 tests) and no TypeScript errors.
Author
|
@NethmiRodrigo please have a look! |
Author
ibacher
reviewed
Feb 23, 2026
Member
ibacher
left a comment
There was a problem hiding this comment.
Yeah, I think this basically looks right, except in cases where we may need more transformation, e.g., attributes that store Concepts, or Locations.
| submission: {}, | ||
| initialValue: {}, | ||
| }, | ||
| } as any; |
Member
There was a problem hiding this comment.
Please try to avoid as any wherever possible. Most of these use-cases, it's better to use an explicit cast. This one can be done (satisfies FormField) with very little effort.
src/api/index.ts
Outdated
| 'Content-Type': 'application/json', | ||
| }, | ||
| method: 'POST', | ||
| body: JSON.stringify(personAttribute), |
Member
There was a problem hiding this comment.
Nit:
Suggested change
| body: JSON.stringify(personAttribute), | |
| body: personAttribute, |
Author
|
@ibacher, does this look good to go, or would you suggest any further changes? |
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.
Requirements
Summary
This enables Form Builder to render and process person attribute fields. Previously, these fields were silently hidden in preview mode, causing form rendering issues and preventing data submission.
Screenshots
Related Issue
https://issues.openmrs.org/browse/O3-5420
Other