An input transform on a pointer is typically used in just such a manner to provide screening on the pointed to file.  This allows users to access a file from many perspectives.  For example, if it was a zipcode file, you could have a screen that would limit selection (which also limits what you see to select from) to just one state, while others could look at and select from the whole file.  If it was a procedures file, you could limit a given instance to a specific type of procedure.  This all allows use of a simgle standard file for differing circumstances, instead of requiring multiple overlapping files.

The logic you are seeing happens after FileMan has set up DIC and DIC(0) for use in a file lookup and selection from the pointed to file.  (NOTE: DIC(0) will differ depending on a question asked during file modification as to whether or not a user can add a new entry to the pointed to file while looking up an entry from the field pointing to the file.)

The naked reference in the DIC("S") logic is to the zero node of a given entry in the pointed to file (this is standard for any DIC("S") even if set by someone doing a look up from programmer mode.  As within any DIC("S"), for the lookup portion of this logic FileMan is looking for $T to be true before it allows an entry to be seen or selected.  Then within the input transform, if no entry is selected, indicated by Y<0, X is killed, which is standard within any type of field (pointer, free text, set, whatever) to indicate that an invalid entry was made or nothing was selected.  When '$D(X), FileMan knows to beep and/or display "??" as appropriate, and then reprompt the field (my memory is fuzzier on the details on this, and I don't think they are quite as important).

I don't know anything about why "ORAL" is specifically eliminated from selection.  I'd guess that given it is NUMBER 1, it was a early value of the field that they later chose to make more specific, after which they didn't want ORAL used and yet could not eliminate ORAL from the file, since that would mess up instances where it was used.

Hope this clarifies things.

Kevin Toppenberg wrote:

I need help understanding an input transform

In file 50.7/PHARMACY ORDERABLE ITEM, in field MED
ROUTE (.06), I am being limited in the choices
available to me.  I want to be able to put in ORAL or
PO for a drug route.

Here is a screen log:

INPUT TO WHAT FILE: PHARMACY ORDERABLE ITEM//
EDIT WHICH FIELD: ALL//

Select PHARMACY ORDERABLE ITEM NAME: dilTIAZEM
TAB
NAME: DILTIAZEM//
DOSAGE FORM: TAB//   (No Editing)
IV FLAG:
INACTIVE DATE:
DAY (nD) or DOSE (nL) LIMIT:
MED ROUTE: BUCCAL// PO??
     Enter the most common MED ROUTE associated with
this medication.
     ONLY MED ROUTES MARKED FOR USE BY ALL PACKAGES
ARE SELECTABLE.
MED ROUTE: BUCCAL//

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

Here I show that PO is a valid record in the
MEDICATION ROUTE file (50.1)--and that it DOES appear
to be marked for use by "all packages"

OUTPUT FROM WHAT FILE: MEDICATION ROUTES//
Select MEDICATION ROUTES NAME: PO
     1   PO  ORAL      PO
     2   PO SC  ORAL/SUBCUTANEOUS      PO SC
CHOOSE 1-2: 1  ORAL      PO
ANOTHER ONE:
STANDARD CAPTIONED OUTPUT? Yes//   (Yes)
Include COMPUTED fields:  (N/Y/R/B): NO// b  BOTH
Computed Fields and Record Num
ber (IEN)

NUMBER: 1                               NAME: ORAL
  OUTPATIENT EXPANSION: MOUTH           ABBREVIATION:
PO
  PACKAGE USE: ALL PACKAGES

------------
Here is the input transform for the field (field .06
of file 50.7).

INPUT TRANSFORM:  S DIC("S")="I
$P(^(0),""^"")'=""ORAL"",$P(^(0),""^"",4)" D ^DIC K
DIC S DIC=DIE,X=+Y K:Y<0 X

The node;piece 0;4 --> Package Use(0:national drug
file only, 1:All packages)

So each entry is tested for
     $P(^(0),"^")'="ORAL"
and  $P(^(0),"^",4)>0       both must be true.

1. I don't understand how all an input transform is
setup.  For example, before calling d ^DIC, doesn't
DIC=FileNum have to be set, and DIC(0)="AEQ" or
something.  Also what is the naked reference ^(0)
referring to.  Also, how does the input transform
communicate back?  By setting $T, or by killing X?  If
X is killed is any further processing carried out by
fileman?

2. Looking at this specific example, there seems to be
a specific restriction against having a route to be
ORAL--why?

Thanks
Kevin

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

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to