The 3rd node is where a single line text message is placed.  If it exists, you can't use FM to delete the cross-reference's logic (i.e. you can't delete the definition of the cross-reference).  It does double duty.  It educates and warns with the text and its existence acts as a lock.  Here are some examples.  If you use FM to delete the don't delete message, then you can use FM to delete the xref.

  1) ^DD(.11,.01,1,1,3) = Lets developers pick indexes by file number
  2) ^DD(.11,.51,1,1,3) = Lets FileMan find indexes defined on fields from a pa
                        = rticular file
  3) ^DD(.31,.01,1,1,3) = Lets developers pick keys by their file number
  4) ^DD(.312,.01,1,1,3) = LETS DEVELOPER PICK KEY FIELDS BY NUMBER
  5) ^DD(.403,.01,1,2,3) = Programmer only
  6) ^DD(.403,.01,1,3,3) = Programmer only
  7) ^DD(.403,7,1,1,3) = Programmer only
  8) ^DD(.4031,5,1,1,3) = Programmer only
  9) ^DD(.4031,7,1,1,3) = Programmer only
 10) ^DD(.4044,1,1,2,3) = Programmer only
 11) ^DD(.4044,3.1,1,1,3) = Programmer only
 12) ^DD(.46,.01,1,3,3) = Along with F cross-reference manages F_file# index.


Kevin Toppenberg wrote:
Thomas,

Thank you for this well thought out and helpful reply.

When I create an entry in the PHARMACY ORDERABLE ITEM
file, I find that an appropriately matched entry in
the ORDERABLE ITEM file, and also some data is put
into the QUICK VIEW file.

I am guessing this must be done through a cross
reference, or perhaps a trigger of some sort(?).  But
it seems that the system would need to wait until the
user has put data in all the fields before launching a
process that creates records in other files.

Any idea how this is done?

Also, I have seen several places the nominclature of
node 1: set, node 2: kill, and node 3: do not delete. 
I am guessing that the first two are the set and kill
codes discussed below.  But what about that 3rd node?

Thanks
Kevin
--- "Holloway, Thomas (EDS)"
<[EMAIL PROTECTED]> wrote:

  
Kevin asked:  
So here are my questions:

    
1. Apparently there is some M code associated with
each cross-reference.  When is this code executed?
      
For every add/edit/delete of that field, FileMan
triggers the
appropriate Set or Kill.  Also if you re-index the
file, the code will
be executed.

    
2. Where is this code stored?  When I look in ^DD,
      
I
    
find only ^DD(50,0,"IX","ASP",50,2.1)="" and
^DD(50,"IX",2.1)=""
      
It is stored in ^DD(file,field,1,index #,n) where
index # is a
sequential IEN at the sub-file level.  Like this:
^DD(50,2.1,0) = PHARMACY ORDERABLE
ITEM^P50.7X^PS(50.7,^2;1^I $D(X) N ND
S ND=$G
(^PSDRUG(DA,"ND")) I

    
+ND,+$P(ND,"^",3),+$$PSJDF^PSNAPIS(0,$P(ND,"^",3))'=$P(^PS(
  
50.7,X,0),"^",2) K X
^DD(50,2.1,1,0) = ^.1
^DD(50,2.1,1,1,0) = 50^ASP
^DD(50,2.1,1,1,1) = S
^PSDRUG("ASP",$E(X,1,30),DA)=""
^DD(50,2.1,1,1,2) = K ^PSDRUG("ASP",$E(X,1,30),DA)
^DD(50,2.1,1,1,3) = Do not delete
^DD(50,2.1,1,1,"%D",0) = ^^1^1^2970925^^
^DD(50,2.1,1,1,"%D",1,0) = Cross-reference to
PHARMACY ORDERABLE ITEM
file #50.7

    
3. From above, it looks like there is separate
'setting' code and 'killing' code.  Is this true?  
      
Yes it's true for regular cross-references.  FileMan
will automatically
create the Set and Kill code in the format that you
have already seen.
If you create a Mumps xref or a Trigger xref, you
will control whether
or not there is Set or Kill 
code and control the content.  There are some very
creative things you
can do with these types but a simple thing might be
to Set an xref
exactly as FM would do but not have any Kill code. 
You will end up with
an historical record that might be useful for some
purpose.

    
4. How is the cross-reference filled?  -- I think I
just figured out the answer on this one.  It occurs
when a value is put into field 2.1 in one of the
      
file
    
#50 records.
      
Exactly.

   Other than reading the documentation, the best
way to find out "what"
and "where" is to create a small test file with only
two or three
fields.  At that size, you can see the whole ^DD
entry and detect
additions and changes as you try adding different
cross-reference types
to the file.  If you are going to be creating a new
package and adding
new files of your own design, you should look into
the New Style
cross-references and Keys.  There is a tutorial
available in the
Infrastructure documentation library.

Thom H.


"Learn from the mistakes of others.  You can't live
long enough to make
them all yourself."
 

-----Original Message-----
From: [EMAIL PROTECTED]

    
[mailto:[EMAIL PROTECTED]]
  
On Behalf Of Kevin
Toppenberg
Sent: Monday, April 25, 2005 5:47 PM
To: Hardhats Sourceforge
Subject: [Hardhats-members] Fileman cross-reference
questions

Hey all,

I've come to that time in my life where someone
needs
to sit me down and tell me all about.... well...
fileman cross-references.  And I specifically want
to
know how to fill them with the data I want.

Let me set up my situation first.  I am trying to
understand the linkages between files etc. that make
up the pharmacy package.  

Currently, with Dave Whitten's help, I have one drug
that shows up when I try to add a new drug in CPRS.

Here is an overview of the steps that go behind
getting information about the drug to show up in
CPRS.

1. CPRS is given a list of available drugs.  This
list
is stored in File 101.44 (ORDER QUICK VIEW).  In my
example, diltiazem is stored as an option like this:
44^DILTIAZEM.  This 44 is the IEN of the Rx in file
101.43 (ORDERABLE ITEM).

2. During lookup, it uses record/entry# 44 from
101.43, and gets the ID field (field 2).  This is
supposed to have a format like this: 'package
code;99XXX' where XXX indicates the package table
originating this item (i.e. RAP,LRT,etc.).  In my
example, the code was 1.

3. This package code is then used to access a cross
reference in file #50 (DRUG file, ^PSDRUG).  It
accesses it like this: $order(^PSDRUG("ASP",1,0)),
where 1 is the package code from above.  Because I
have only one drug installed, there is only one item
in this cross-reference.  This is 3819.  Thus
^PSDRUG("ASP",1,3819)="".

4. This "3819" from above is the IEN of the drug in
the DRUG file.  From this entry, the available
dosages
etc. are available.

5. So to make drugs available in CPRS, file #50
(DRUG
file) must not only have the drug defined, but there
must also be entries entries in the "ASP" cross
reference.

--------------

OK, that's the setting.
Now, what I have been able to figure out


1. When I lookup information about the "ASP"
cross-reference in VPE, I see only this info about
the
index:

Index    File       Fields
*ASP     50         PHARMACY ORDERABLE ITEM (#2.1)

So I look it up in the Fileman data dictionary
utilities and get this information:

  ASP    REGULAR
Field:  PHARMACY ORDERABLE ITEM  (50,2.1)
Description:  Cross-reference to PHARMACY ORDERABLE
ITEM file #50.7.
  1)= S ^PSDRUG("ASP",$E(X,1,30),DA)=""
  2)= K ^PSDRUG("ASP",$E(X,1,30),DA)
  3)= Do not delete

-------------

So here are my questions:

1. Apparently there is some M code associated with
each cross-reference.  When is this code executed?

2. Where is this code stored?  When I look in ^DD, I
find only ^DD(50,0,"IX","ASP",50,2.1)="" and
^DD(50,"IX",2.1)=""

3. From above, it looks like there is separate
'setting' code and 'killing' code.  Is this true?  

4. How is the cross-reference filled?  -- I think I
just figured out the answer on this one.  It occurs
when a value is put into field 2.1 in one of the
file
#50 records.

I think I have more questions, but that's enough for
now..

Thanks

    
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

  

-- 
Greg Kreis      http://www.PioneerDataSys.com

"You are today where your thoughts have brought you, you will
   be tomorrow where your thoughts take you." (James Lane Allen)

Reply via email to