Hi, I have a general question concerning Drupal (I just installed 7) - I'm a total newbie here, so I’m just trying to understand how to relate pieces of data to each other. Basically, I need what seems to amount to a node reference / value pair, or some sort of composite field, and I just don't see how to do it. I have a contrived example to demonstrate the question:

A user has a list of “illnesses”, and for each illness they have there is an associated list of drugs prescribed for that user, along with the dosage (the dosage can vary depending on the severity of the illness, for example). So I’ve created an illness content type that describes an illness and a drug content type for each drug. I’ve also created a content type for “prescriptions for a particular illness for a user” to relate the list of drugs prescribed as treatment to the illness the user has (using node_reference in the references module for that). So there is a one to many relationship in a "prescriptions for a particular illness for a user" node between an illness and a list of drugs.

The problem is that I also need to add the dosage prescribed for each drug selection. (ie. I need more than just a node reference field with a select list that lets me pick an arbitrary number of drugs - I need the node reference field tied to an integer field to save the dosage). How can I do that?

I'm trying to understand what the appropriate method of doing this in drupal is - It's such a trivial thing to do if you're creating your own db schemas/queries and such that I'm surprised I'm having so much trouble with it, lol.

Thank you for the help!

-dan

Comments

Anonymous’s picture

I know the issue. I kind off have the same problem. I just build my first drupal site with drupal 6 and now I'm trying to get my head around drupal 7. Don't get it.

I have a data sheet (technical manual). in this data sheet there is a heading (title, description, category (with taxonomy), .. ) and some building blocks. In these building blocks I have some information (title, description, ...) and pictures. The pictures have also some addition information.

Now the story: sometimes a dealer changes, and let us say, we have new keys for the technical manual.
then I wont to change just that picture and it will automaticly update on every building block, in every data sheet it is called for.

Sow, i'm searching for the same thing ....

I hope somebody can help us soon ...

gollyg’s picture

I am guessing you are no longer looking for a solution, but for anyone else who is, for D7 field_collection should do the trick - http://drupal.org/project/field_collection. This module provides the multi-group functionality formerly provided by cck3.

It is quite clever - it creates a new field type of collection, which is actually itself a reference to a field_collection entity. Then it allows you to field this new entity. This gives you full access to both fields and also display mode theming.