Mark, I think two different things are being confused here.  Vitals as a 
concept is a group with sub-concepts weight and height.  But vitals as an 
observation doesn't exist without both weight and height sub-observations.  The 
concept is more like an XSD and the obs like XML.

This is admittedly not the way forms are organized, there would need to be some 
pruning (or worse, unpruning if they went back later and added weight).  The 
alternative would be to store null non-voided obs where there are group members 
without values.   In either case, only the number of non-voided obs would be 
important.

From: [email protected] [mailto:[email protected]] On Behalf Of Mark Goodrich
Sent: Tuesday, November 29, 2011 4:45 PM
To: [email protected]
Subject: Re: [OPENMRS-DEV] isObsGrouping vs hasGroupMembers

Yes, the ticket I entered is here: TRUNK-1654

The original issue was that getGroupMembers() returned voided and non-voided 
obs, while I felt that it should only return non-voided obs.  .  This change 
has been made.  (And we added getGroupMembers(boolean includeVoided) if you 
want to override this).

We also decided to change the corresponding hasGroupMembers() to only return 
true if a obs has non-voided obs members.  And, again, we added a 
hasGroupMembers(Boolean includeVoided) to override this).

No clear decision was made about isObsGrouping in the ticket... and I admit, I 
didn't give it much thought, but after doing some testing today I feel that 
isObsGrouping() should delegate to hasGroupMembers(true) instead of 
hasGroupMembers(false).

Here's the logic.  Say you have a form and add a "Vitals" parent obs with a 
child "Weight" obs and a child "Height" obs.  Then, for some reason, you void 
the "Weight" and "Height" obs.  Now I would say that "Vitals" currently doesn't 
have any group members (hasGroupMembers()==false) but that "Vitals" is still an 
obs grouping (isObsGrouping()==true)... that is, although it currently doesn't 
have any associated obs, it is an obs that  is used to group obs, not to store 
an actual observation.

This still isn't perfect-for instance, if you add a "Vitals" obs but never add 
any children, isObsGrouping() would be false, even if the obs was only meant to 
group other obs--but it seems closer to correct.

Mark



From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]]<mailto:[mailto:[email protected]]> On Behalf Of 
Friedman, Roger (CDC/CGH/DGHA) (CTR)
Sent: Tuesday, November 29, 2011 3:00 PM
To: 
[email protected]<mailto:[email protected]>
Subject: Re: [OPENMRS-DEV] isObsGrouping vs hasGroupMembers

All those were added by you, Mark.  Could you recreate the logic behind it or 
point us to a ticket?  I can clearly see why a voided obs wouldn't count toward 
creating an obs group, likely they are just mistake corrections.

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]]<mailto:[mailto:[email protected]]> On Behalf Of Mark 
Goodrich
Sent: Tuesday, November 29, 2011 2:42 PM
To: 
[email protected]<mailto:[email protected]>
Subject: Re: [OPENMRS-DEV] isObsGrouping vs hasGroupMembers


Yeah... I can enter a ticket and make the fix... I believe that all needs to be 
done is to change isObsGrouping to call hasGroupMembers(true) instead of 
hasGroupMembers(false)...

Mark



From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]]<mailto:[mailto:[email protected]]> On Behalf Of Ben Wolfe
Sent: Tuesday, November 29, 2011 2:13 PM
To: 
[email protected]<mailto:[email protected]>
Subject: Re: [OPENMRS-DEV] isObsGrouping vs hasGroupMembers

Yes, that way sounds right, needs a ticket.  I assume this was changed because 
of some other method that gets called down the line was changed?

Ben
On Tue, Nov 29, 2011 at 9:45 PM, Mark Goodrich 
<[email protected]<mailto:[email protected]>> wrote:
Just a minor point here... there were some changes made to the way the 
isObsGrouping and hasGroupMembers  works in 1.9.0 but I'm questioning now if 
we've made the right decision.

To do a quick summary:

In 1.9.0, the default parameter-less obs.hasGroupMembers()  and 
obs.isObsGrouping() methods return true if the obs in question havs 1 or more 
*non-voided* member obs.

This seems like the right behavior for hasGroupMembers (and there also now a 
hasGroupMembers(Boolean includeVoided) if you want to override this behavior) 
but I would think perhaps that obs.isObsGrouping() should return true if the 
obs in question has 1 or more members obs *of any type*, voided *or* non-voided.

The logic is like this... if you have an obs that has two child obs that are 
both voided, even though I would say it "has no group members" I would still 
consider it "an obs grouping".

Thoughts?

Mark
________________________________
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