On Jan 20, 7:39 am, KRD <[email protected]> wrote: > All, > > This is will be a bit long winded but here goes... > > I am working on a medical records application that will provide a web > interface (HTML) and REST web services. The application supports many > users and many facilities (clinics, hospitals, etc,). A user can > belong to more than one facility and have a different set of > permissions at each facility. > > So far I have modified the restful authentication and restful acl > plugins to deal with a current user and current facility context. In > a web application a simple drop list of facilities that user can > access is enough to change the current facility context of that user. > > As I was considering the REST interface to the application, I decided > that it would be to cumbersome for a user to call a resource to change > their current facility (not RESTful?). Instead I am kicking around the > possibility of using nested resources. When a user > accesseshttp://localhost/facility/2/patients, I change the current facility > context based on the URI. I tested the idea and it works. > > I am concerned that it may get too complex with URIs such as /facility/ > 2/patient/123/vitalstatistics (although it makes perfect sense to > me). I have a number of articles expressing the nesting should not go > beyond 1 level. >
I wonder if you're not missing a model here, something that represents the patient-at-a-facility combination. I'm not sure what it would be called, let's just call it a "registration" for now, something that scope's a patient's data to a particular facility. Then you'd have URLs like: /registrations/123/vitals You'd still have /facilities and /patients for the "master" lists of each, but a specific patient-facility combination would be represented by a registration record (i.e., on the model side, facility has_many :patients :through => :registrations). A Registrations controller could then be a simple RESTful interface on top of that. Does that help? Jeff purpleworkshops.com switchingtorails.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

