Ian Haywood wrote:
> You mean using the :include parameter?
>
> Just on that, one problem I've run into is you can't use :include on
> polymorphic joins.
> viz I have a class Log which is polymorphically joined to Drug, Note,
> Disease, etc. classes.
>
> class Log < ActiveRecord::Base
>    belongs_to :object, :polymorphic => true
>    belongs_to :person
>    belongs_to :owner, :class_name => "Person", :foreign_key => "who"
> end
>
> class Drug < ActiveRecord::Base
>   has_one :log, :as => :object
> end
>
> class Disease < ActiveRecord::Base
>   has_one :log, :as => :object
> end
>   
Wooooo. Look. Cool Rails shit.

Guys (Ian, Kuangie, Horst, alia) I wonder if there is any value in
modeling this. This seems to be something that the list is interested in
and could perhaps help with. It might be useful even if we never ror.

I am thinking something like:-
Patient belongs to people.
Doctor belongs to people.
Patient has many diseases. (Citation HoG 4. http://tinyurl.com/nq99c)
Disease has many treatments.
Drug belongs to treatments.
Physical exercise belongs to treatments. (Keep the endocrinologists happy.)

Doctor has many surgeries.
Surgery have many doctors.
Patient has one appointment. (or not)

Patient has money.
Money belongs to doctor.
... Well, you get the idea.

It might seem a bit clumsy and it is but we are actually doing this
implicitly and in a very ad hoc way with our current software.

Doable? Valuable?

David

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Gpcg_talk mailing list
[email protected]
http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk

Reply via email to