Hi Lary,
Sometimes I have even borrowed my neighbors hammer
, there's nothing like a vertical learning curve!
Keep at it!
I'm not sure exactly what you mean when you say assigning the MedId. Are you trying to assign the med to the person? Or the person to the Med?
I also don't know what amount of data you have "The whole ball of wax".
I'm guessing that you want to assign the med to the person, so, All the meds available to add to the person are in a table "meds".
Just an idea---
On this second page, use a select * from meds statement to fill a list, there should be other textviews and possibly listviews as needed. Short Click on the list to add a medication, Long click to read the details.
The Short Click selects a med and pre-fills the appropriate textviews and maybe even some other listviews from all the data contained in the medication table as it pertains to the medID selected. You could then choose the right dosage, etc., and then use a button to run an insert/append sql statement that adds the med to the Table "meds_issued" and includes the personID. Use another activity to show the person and all the meds assigned/issued to the person with dosages, etc.
I realize I may be shooting in the dark, but as I said, I've wrangled with the beast TypeII and for now have it beaten into submission, so I really can relate to the overwhelming details that go along with it. Appointments, Meds(Multiple), Lab Test, Other ailments that shoot off of Diabetes and so on.
A list of tables banging around in my head are:
patient - What I would use for the "main" table to pull it all together
person - for the name and address, email, etc., of the person/s added to the patient table - You could have more than 1.
meds - for all the meds
lab_test A1C's and so on
sugar_level (Glucose) readings
appointments - eye, general, specialist, etc.
doctors - names, groups
insurance company
emergency contacts
what I want for my birthday - OKAY, that one doesn't count!
There would be an interface to append, update, and delete for each table.
Once that part was running smooth, then I would worry about pulling it all together.
I hope these ramblings can help in some way.
For a good picture of Joins, See the links below.
The following is Annotated
http://stackoverflow.com/questions/38549/difference-between-inner-and-outer-joins
Source:
Visual-Representation-of-SQL-Joins explained in detail by
C.L. Moffatt
And another http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
End of Annotation
Mark