Details
-
Bug
-
Status: Approved
-
TBD
-
Resolution: Fixed
-
None
-
None
-
Undetermined
Description
Background
The <encounterDiagnoses/> tag with openmrs-core 2.2 and above saves diagnoses associated with a given encounter as diagnoses rather than obs. This is currently possible in its handler by first saving the encounter in the middle of handling submissions of the involved tags. Saving an encounter requires some preliminary validations which should be specifically done by the FormEntrySession.
To do
Because of this, this ticket will ensure diagnoses are saved in an CustomFormSubmissionAction for the associated <encounterDiagnoses/> submission handler. EncounterDiagnosesElement will extend CustomFormSubmissionAction and register a <postSubmissionAction/> handler referencing itself. This will help avoid re-validating and re-applying all actions on the encounter with respect to the involved HTML-form-entry widgets/tags.
Relate talk thread : https://talk.openmrs.org/t/encounterdiagnoses-encounterdiagnoses-after-obsgroup-obsgroup-with-empty-obs-throws-validation-error-obsdatetime-cannot-be-empty-or-null/26815