Getnext question
Nancy Palmquist
nlp at vss3.com
Tue Apr 4 08:49:55 PDT 2006
Don Coleman wrote:
> I have the following input processing which uses @KEY to generate
> prescription labels using getnext. This app. was running fine until March
> 24. There is nothing that was changed with regard to this @KEY routine that
> I can think of (or see). However, there were several additional @KEY
> routines added since March 24. The @KEY routine in question does find the
> first prescription correctly but fails all subsequent lookups & tests for
> variables CC & CD. Yet If I enter the same exact search data via *clerk it
> finds each and every match. It seems that the index is failing by actually
> finding entries that come before the ones desired. I have rebuild the
> indexes, removed and recreated the indexes, confirmed that the variables
> used in the lookup are the exact same length & edit type as those real
> fields used in the index. I have also confirmed that all variables defined
> in the automatic table are identical (length & edit type) to those in this
> table. Does anyone see a problem that I am overlooking?
>
> Apr 3, 2006 15:14 File Name: QS1 Page 1
> Processing: pqueue
>
> 5 ------- - - - - - - - - - - - - - - - -
> @keyl If: AA ne ""
> Then: goto ready
> 6 ------- - - - - - - - - - - - - - - - -
> If:
> Then: INPUTPW POPUP AA(10,ALLUP,g) "\r Enter password or press
> <ENTER> to
> exit: \r "
> 7 ------- - - - - - - - - - - - - - - - -
> If: AA eq ""
> Then: exit
> 8 ------- - - - - - - - - - - - - - - - -
> If:
> Then: lookup rph k=AA i=B -nx
> 9 ------- - - - - - - - - - - - - - - - -
> If: not rph
> Then: beep;msgbox "\r Invalid password ";exit
> 10 ------- - - - - - - - - - - - - - - - -
> If:
> Then: AB=rph(1)
> 11 ------- - - - - - - - - - - - - - - - -
> ready If: AC eq ""
> Then: INPUT POPUP AC(9,.0,g) "\r Scan Rx label queue ID#: \r "
> 12 ------- - - - - - - - - - - - - - - - -
> If: AC eq ""
> Then: end
> 13 ------- - - - - - - - - - - - - - - - -
> If:
> Then: INPUT POPUP AD(13,*,g) "\r Scan Medication NDC: \r "
> 14 ------- - - - - - - - - - - - - - - - -
> If: AD eq ""
> Then: end
> 15 ------- - - - - - - - - - - - - - - - -
> If:
> Then: ZE(3,.0,g)="1";CC(8,*,g)=""{AC{"";CD(11,*,g)=""{AD{""
> 16 ------- - - - - - - - - - - - - - - - -
> If:
> Then: lookup ndc = crossndc k=AD i=A -nx
> 17 ------- - - - - - - - - - - - - - - - -
> If: not ndc
> Then: goto nocross
> 18 ------- - - - - - - - - - - - - - - - -
> If:
> Then: AD=ndc(1);AE=CC&CD;goto gotcros
> 19 ------- - - - - - - - - - - - - - - - -
> nocross If:
> Then: AE(19,*,g)=CC&CD
> 20 ------- - - - - - - - - - - - - - - - -
> gotcros If:
> Then: PRINTER TYPE "I-4308";putenv
> "PFPOSTPRINT","C:\PRINTWIZ\PRINTWIZ.EX
> E /P\"I-4308T2\" C:\PRINTWIZ\HARDCOPY.TXT"
> 21 ------- - - - - - - - - - - - - - - - -
> If:
> Then: lookup pqu = pqueue k=AE i=A -npx
> 22 ------- - - - - - - - - - - - - - - - -
> morerx If: not pqu
> Then: end
>
> Apr 3, 2006 15:14 File Name: QS1 Page 2
> Processing: pqueue
>
> 23 ------- - - - - - - - - - - - - - - - -
> If: not pqu
> Then: end
> 24 ------- - - - - - - - - - - - - - - - -
> If: CC ne pqu(8) or CD ne pqu(4)
> Then: end
> 25 ------- - - - - - - - - - - - - - - - -
> If: pqu(9) eq "Y"
> Then: getnext pqu;goto morerx
> 26 ------- - - - - - - - - - - - - - - - -
> If:
> Then: BA(8,*,g)=pqu(1);BB(5,.0,g)=pqu(5);EH(5,.0,g)=pqu(5)
> 27 ------- - - - - - - - - - - - - - - - -
> immedrx If:
> Then: lookup - k=BA i=A -nx
> 28 ------- - - - - - - - - - - - - - - - -
> If: not -
> Then: beep;msgbox "\r Rx #"<BA<"not found in active file";getnext
> pqu;got
> o morerx
> 29 ------- - - - - - - - - - - - - - - - -
> If: '49 lt "2"
> Then: 'beep;msgbox "\r Rx #"<1<"station less than 2";getnext pqu;goto
> mor
> erx
> 30 ------- - - - - - - - - - - - - - - - -
> If:
> Then: lookup req = labelreq k=9 i=A -nx
> 31 ------- - - - - - - - - - - - - - - - -
> If: not req
> Then: beep;msgbox "\r Invalid patient group for Rx #"<1;getnext
> pqu;goto
> morerx
> 32 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "10" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\10";PRINTER FILE
> "C:\PRINTWIZ\HARDCOP
> Y.TXT";goto finish
> 33 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "11" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\11";PRINTER FILE
> "C:\PRINTWIZ\HARDCOP
> Y.TXT";goto finish
> 34 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "12" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\12";PRINTER FILE
> "C:\PRINTWIZ\HARDCOP
> Y.TXT";goto finish
> 35 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "13" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\13";PRINTER FILE
> "C:\PRINTWIZ\HARDCOP
> Y.TXT";goto finish
> 36 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "14" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\14";PRINTER FILE
> "C:\PRINTWIZ\HARDCOP
> Y.TXT";goto finish
> 37 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "99" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\99";PRINTER FILE
> "C:\PRINTWIZ\HARDCOP
> Y.TXT";goto finish
> 38 ------- - - - - - - - - - - - - - - - -
> If: 'req(9) eq "99" and 25 gt "0"
> Then: 'CALL "C:RXPRISON\FILEPRO\QS1\99";PRINTER FILE
> "C:\PRINTWIZ\HARDCOP
> Y.TXT";goto finish
> 39 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "9" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\9";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
> 40 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "1" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\1";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
>
>
>
> April 3, 2006 15:14 File Name: QS1 Page 3
> Processing: pqueue
>
> 41 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "2" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\2";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
> 42 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "3" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\3";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
> 43 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "4" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\4";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
> 44 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "5" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\5";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
> 45 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "6" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\6";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
> 46 ------- - - - - - - - - - - - - - - - -
> If: req(9) eq "7" and 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\7";PRINTER FILE
> "C:\PRINTWIZ\HARDCOPY
> .TXT";goto finish
> 47 ------- - - - - - - - - - - - - - - - -
> If: 25 gt "0"
> Then: CALL "E:\QS1\TODO\FILEPRO\QS1\LABEL";PRINTER FILE
> "C:\PRINTWIZ\HARD
> COPY.TXT"
> 48 ------- - - - - - - - - - - - - - - - -
> finish If:
> Then: lookup pqu = pqueue k=BA i=C -npx
> 49 ------- - - - - - - - - - - - - - - - -
> If: not pqu
> Then: beep;msgbox "\r Rx #"<BA<"NOT in batch queue";goto notque
> 50 ------- - - - - - - - - - - - - - - - -
> If:
> Then: pqu(9)="Y";write pqu
> 51 ------- - - - - - - - - - - - - - - - -
> notque If:
> Then: 57=AB;60=BB;58=@TD;59=@TM;49="2"
> 52 ------- - - - - - - - - - - - - - - - -
> If: 100 lt "2"
> Then: 100="2"
> 53 ------- - - - - - - - - - - - - - - - -
> If:
> Then: write
> 54 ------- - - - - - - - - - - - - - - - -
> If:
> Then: lookup det = qs1det r=free -n
> 55 ------- - - - - - - - - - - - - - - - -
> If: not det
> Then: beep;msgbox "\r QS/1DET FILE UNAVAILABLE";getnext pqu;goto
> morerx
> 56 ------- - - - - - - - - - - - - - - - -
> If:
> Then: det(1)=BA;det(2)="3";det(3)=@TD;det(4)=@TM;det(5)=AB;det(6)=BB
> 57 ------- - - - - - - - - - - - - - - - -
> If:
> Then: det(7)="L";write det;getnext pqu;goto morerx
>
>
>
> Don Coleman
> Donald G. Coleman, Consultant
> 402 Andrew Circle
> Indiana, PA 15701
> dcoleman at dgcreact.com
> (724) 349-6302
>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
Don,
I know we reviewed this but I have one more idea. You added to this
posting that you have added a number of other @keys to the logic. I
would suggest that you strip them all out and test a table with just
this logic remaining.
If the behavior returns to normal, there is a conflict in the lookup or
you have confused the variables somehow.
See what happens.
Nancy
--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: http://www.vss3.com
More information about the Filepro-list
mailing list