NUBIC/ncs_navigator_core — pull request #32 by greenone1975 (2013-02-12 22:09:00+00:00)
Title: Participant awareness of its provider type, Task #3308

### Summary

Adding the capability for a participant to query whether its (any) associated provider is from a hospital source, as indicated on its associated `PBS list` `in_out_frame_code`, and a class method for `Participant` to get all hospital-sourced participants.

#### Background

This commit started with this [gist] (https://gist.github.com/greenone1975/4757173) The extensive method chain spanning several models jumped out as a definite code smell, especially when I started writing tests in each model, with the set-up growing obscenely with each chain link.

I sought ways to alleviate this situation, drawing inspiration from this [post] (http://devblog.avdi.org/2011/07/05/demeter-its-not-just-a-good-idea-its-the-law/), which was ultimately unsatisfying - drawing on the suggestion to use delegation seemed to just cover-up the structural coupling.

I discussed this with David and the resulting commit is mostly his work, with my tests. I really like how he just acknowledged in `Participant` the associations that are already in existence, so we could just query the `PbsList` directly.

Still not certain this solves the smell of reaching across models, but it's a way better solution than the couple I had implemented before.