On Mar 25, 2006, at 6:41 PM, Kevin Toppenberg wrote:
How long have I been using Fileman now? And I still have a hard time
handling multiples...
I've heard people go so far as to say that multiples were a mistake,
but I don't agree. In fact, I think it's extremely telling that
exactly the same concept occurs in UML, where it's called an
association class. Think about it this way: If the association of a
subentry with its containing entry is a kind of object, you might
want to be able to associate attributes with it. Going back to my old
standby: If a hotel has a ROOM file, there may be multiple valued
field GUEST associated with each room. But, of course, you don't just
want to know that Jane Smith is in room 501, you might want to know
when she checked in. It would be very natural to model the check-in
data as a field in the subfile associated with a multiple. (As an
aside: this is a bit of terminology many people trip over: multiples
are not subfiles, multiple valued fields, or just multiples, are
fields talking their values in a subfile.)
Here is the VPE data dictionary for the DRUG INGREDIENTS file....
1 0;1 .01
NAME [RFI]
1;0 1 DRUG IDENTIFIER W:^ D:^ <-Mult
[50.4161A]
2 -0;1 .01 -DRUG
IDENTIFIER [FI]
3 0;2 2 PRIMARY INGREDIENT <-Pntr
[P50.416a]
4 2;1 3 INACTIVATION
DATE [D]
<> <> <>
As much as I like VPE, I never use it for data dictionary listings.
I want to add new record that is like this:
.01="CEFTAZIDINE PENTAHYDRIDE"
2="CEFTAZIDINE"
In the past, when dealing with multiples, I have first created the
overall record, then gotten the IEN (e.g. 1234) and used it to create
the multiple. Like this:
TMGFDA(50.4161,"+1,1234,",FieldNumber)="CEFTAZIDINE PENTAHYDRIDE"
using UPDATE^DIE
But how do I do this when the .01 field, itself, is a multiple???
Have you ever created an IENS using a +1, a +2, etc.? There's no
reason why you can't use +1 for the .01 field when adding an entirely
new record, but then you need to populate the subfile, too, so you're
going to create an entry there (call it +2). Note that I've never
tried this, but I assume you'll need an IENS with +1 for the .01
field for the new entry in the top level entry, and a +2 for the .01
in the subfile corresponding to the top-level .01.
I have to admit, I don't really understand why anyone would want to
make .01 multiple. Let's think about what this might mean: A file is
conceptually something like a class, with entries in that file being
instances. Every entry in the file has a unique ID (the IEN) that
should normally remain invisible (in RDBMS terminology, it's called a
surrogate key). The .01 (or NAME) field is typically the way we refer
to that object. Some attributes are multiple valued, and I suppose we
might want to think of "NAME" as having this property. But the point
is that we're not talking about different objects here, but one
object having multiple names. To make things more confusing, each of
those names will have its own identity (IEN in a subfile). But how
can this all be represented at the global level? Fileman introduces a
new subscript for each. Thus in the ROOM file in hotel's database we
might have
^ROOM( 1)=101
^ROOM(2)=102
^ROOM(3)=103
etc.
(Here, the .01 field is the room number.) Now, suppose there is a
multiple-valued field .02 called GUEST. How would it be stored? We
might use 1 as the subscript for this subfile, so we might have
something like
^ROOM(1)=101
^ROOM(1,1,1)=Doe^Jane
^ROOM(1,1,2)=Smith^George
etc.
But think about it: What is the subscript (corresponding to the
second 1 above) used to introduce the .01 field? If you really,
really want a multiple-valued .01 field, I think you'd really have to
introduce a .001 field (NUMBER field).
So decided to try doing it with classic fileman:
set DIC=50.416
set DIC(0)="AEQML"
d ^DIC
I don't think that quite makes sense. when editing a subentry, you
want to set DIC equal to the global root of the subentry. I'd have to
think about what you can do with Classic Fileman, but I'm sure it
would take at least two DIC calls. I'd just stick to the DBS call.
I then added an entry with name of "KILLTHIS" via the LAYGO
functionality.
But now I can't delete the file because it won't let me edit the .
01 field!
-screen log-
INPUT TO WHAT FILE: DRUG INGREDIENTS//
EDIT WHICH FIELD: ALL//
Select DRUG INGREDIENTS NAME: killTHIS
...OK? Yes// (Yes)
INACTIVATION DATE: @??
INACTIVATION DATE:
Select DRUG INGREDIENTS NAME: killTHIS
...OK? Yes// (Yes)
INACTIVATION DATE: ^.01??
INACTIVATION DATE:
Can someone help?
-confused-
Don't worry, it is confusing.
Kevin
===
Gregory Woodhouse
[EMAIL PROTECTED]
"Education is a progressive discovery
of our own ignorance."
--Will Durant
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members