Using the reference application we want to be able to record past visit notes even when there is an existing active visit for a patient but this does not seem to be possible with the way the ref app is behaving when comparing the “Current Visit Actions” as opposed to “General Actions” on the patient dashboard.
Current Behavior
On the patient dashboard of the reference application I noticed that if a form is added to both the “Current Visit Actions” and the “General Actions” sections the way the application behaves when opening it is the same when there is an active visit. That is, the form is opened in the context of the active visit. This happens even when the user decides to open a previous visit from the “Recent Visit” section. I know this because I duplicated the “Visit Note” which comes built in, added the duplicate to the “General Actions” section via the Configure Metadata → Manage Forms. When I opening the form while there is no any active visit, I am able to change the encounter date to whatever past date I want (i.e. the date picker only restricts future dates, see below)
On the other hand when there is an active visit, the date picker restricts the date choice to the active visit date range (if the visit happens to span multiple days, see below)
I think the “General actions” forms should not be restricted to the active visit context, also performing action in a previous visit context should happen in the context of the previous visit.
HTTP Status 500 - Request processing failed; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value : org.openmrs.Form.dateCreated
type Exception report
message Request processing failed; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value : org.openmrs.Form.dateCreated
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value : org.openmrs.Form.dateCreated
I think the general actions should be general meaning they should not be tied to the current active visit. Just to be clear below is what I think should happen.
If there is an active visit, when the user clicks a general action, the action should not be tied to that active visit because there is already a current visit actions section which in my opinion should be the right place for that type of behavior.
If there is no active visit, the application actually behaves the way it should. Only general actions are displayed and they are not tied to any specific visit.
On the other hand if a user is on the visit page, the actions which by the way are not distinguished as general vs current should apply to the current opened visit as the message on the page implies anyway as opposed to always be tied to either the active visit if available or not tied to any visit if there isn’t any active visit already.