OK. I've added https://tickets.openmrs.org/browse/TRUNK-2521

My current workaround (which is sufficient for my current requirements) simply 
looks at the end date. The one with an empty end date is assumed to be the last 
one (and only this one can be voided anyways through the UI).

christian

On Aug 8, 2011, at 7:34 PM, Burke Mamlin wrote:

Roger,

We currently use date (not timestamp) for transitions.  Using the time entered 
as a tie-breaker is a workaround, allowing a one-liner change to provide 
predictable ordering.  We can refactor to add explicit ordering and/or addition 
of time of day to state transitions if & when either the issue become 
prioritized over other work or a volunteer comes along with patch containing a 
viable solution.

-Burke

On Mon, Aug 8, 2011 at 12:42 PM, Friedman, Roger (CDC/CGH/DGHA) (CTR) 
<[email protected]<mailto:[email protected]>> wrote:
Burke --
                I feel uncomfortable using creation date to distinguish, that 
field's not supposed to carry substantive data.                  What if we had 
a workflow_state_transition table that specified predecessor-successor 
relationships.  That would allow validation of state changes and potentially 
graphical rendering of state transition diagrams.  It still wouldn't help if 
there were cyclical relationships (X->A, A->B, B->A) that could be accomplished 
on the same day.
                Perhaps we should always ask the user to verify data entry when 
start date and end date are the same, and in addition to asking whether they 
really mean it, ask for any other states that were started and completed that 
day, in order, and then modify the low-order part of the date to reflect that.  
Gets a little complex when editing.

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>] On Behalf Of Burke Mamlin
Sent: Monday, August 08, 2011 11:54 AM
To: 
[email protected]<mailto:[email protected]>
Subject: Re: [OPENMRS-DEV] Multiple Program Workflow States with same start date

We can infer ordering from date_created (i.e., time that the information was 
recorded).  As long as you enter same-day transitions in the order that they 
actually occurred, then the inference will work.

If the need to record program transitions with greater accuracy (e.g., to the 
hour/minute) becomes more common, then we will need to refactor program 
transitions to accommodate the need.

-Burke
On Mon, Aug 8, 2011 at 10:36 AM, Darius Jazayeri 
<[email protected]<mailto:djazayeri%[email protected]>> wrote:
I suppose we intend to allow this, and we should be preserving the ordering. As 
long as there are just the two transitions on the same day, and one of them 
continues, I'm not sure how we distinguish the proper order. (E.g. if on one 
day you go to state A, then B, then C, and continue in C, but A and B are both 
stored with start-date and end-date = midnight, we can't know whether A or B 
came first.)

-Darius

On Mon, Aug 8, 2011 at 12:03 AM, Ben Wolfe 
<[email protected]<mailto:[email protected]>> wrote:
Yes, same day transitions should be allowed.  Can you post your patch to a 
ticket and then link us to it here?

Ben

On Sat, Aug 6, 2011 at 11:58 AM, Christian Neumann 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

Is it supported to have multiple program workflow state with the same start 
date?

Sometimes it happens that we have 2 state transitions at the same day (e.g. 
initially enrolled and referred to another facility at the same day). OpenMRS 
allows this and properly sets the end date for the first state to the same day 
in the DB and leaves the second state open without an end date.

However the order of the states displayed in the UI and for voiding the last 
one isn't consistent. Sometimes the history of the states is ok; sometimes the 
already closed state is shown last. And it's not only a display problem as 
voiding the last state (aka the active one) sometimes voids the first already 
closed state, and sometimes the one which is still open. The two screenshots 
for the same patient should make it clear.

For some time now I have a workable patch for the underlying PatientProgram 
class, but I wanted to check and see what others think about same day 
transitions.

Cheers,
christian
<image001.jpg>
<image002.jpg>
________________________________
Click here to 
unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> 
from OpenMRS Developers' mailing list

________________________________
Click here to 
unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> 
from OpenMRS Developers' mailing list

________________________________
Click here to 
unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> 
from OpenMRS Developers' mailing list

________________________________
Click here to 
unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> 
from OpenMRS Developers' mailing list

________________________________
Click here to 
unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> 
from OpenMRS Developers' mailing list


_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-devel-l" in the  body (not 
the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

Reply via email to