1 | LRLABXT ;SLC/TGA - REPRINTS DEMAND LABELS ;2/19/91 10:38
|
---|
2 | ;;5.2;LAB SERVICE;**80,161**;Sep 27, 1994
|
---|
3 | ;
|
---|
4 | EN ; Reprint labels
|
---|
5 | D IOCHK
|
---|
6 | I '$D(LRLABLIO) D K Q
|
---|
7 | D OPEN^%ZISUTL("LRHOME","HOME") ; Setup handle for user's "HOME" device.
|
---|
8 | D USE^%ZISUTL("LRHOME")
|
---|
9 | K DIR,DIRUT,DTOUT,DUOUT,X,Y
|
---|
10 | S DIR(0)="SO^1:Range of Accessions;2:Selected Accessions",DIR("A")="Selection Method",DIR("B")=1
|
---|
11 | D ^DIR
|
---|
12 | I $D(DIRUT) D K Q
|
---|
13 | S LRTYPE=+Y
|
---|
14 | ASK ;
|
---|
15 | D USE^%ZISUTL("LRHOME")
|
---|
16 | S (LRACC,LREXMPT)=1,(LRCNT,LRQUIT)=0
|
---|
17 | K ^TMP("LRLABXT",$J)
|
---|
18 | I LRTYPE=1 D
|
---|
19 | . D ^LRWU4
|
---|
20 | . I LRAN<1 S LRQUIT=1 Q ; User aborted selection.
|
---|
21 | . S FIRST=LRAN,X=$O(^LRO(68,LRAA,1,LRAD,1,":"),-1)
|
---|
22 | . W !
|
---|
23 | . S DIR(0)="NO^"_LRAN_":"_X_":0",DIR("A")="Reprint from "_LRAN_" to",DIR("B")=LRAN
|
---|
24 | . D ^DIR K DIR
|
---|
25 | . I $D(DIRUT) S LRQUIT=1 Q
|
---|
26 | . W !
|
---|
27 | . S LRAN=FIRST-1,LAST=Y
|
---|
28 | . F S LRAN=$O(^LRO(68,LRAA,1,LRAD,1,LRAN)) Q:'LRAN!(LRAN>LAST) D
|
---|
29 | . . W:$X>(IOM-1) ! W "." ; Let user know we're looking.
|
---|
30 | . . D SETTMP
|
---|
31 | I LRTYPE=2 F D Q:LRQUIT!(LRAN<1)
|
---|
32 | . D ^LRWU4
|
---|
33 | . I $D(DTOUT)!($D(DUOUT)) S LRQUIT=1 Q
|
---|
34 | . I LRAN<1 S:'$D(^TMP("LRLABXT",$J)) LRQUIT=1 Q
|
---|
35 | . D SETTMP
|
---|
36 | I 'LRQUIT,LRCNT>10 D
|
---|
37 | . N DIR,DIRUT,DTOUT,DUOUT,X,Y
|
---|
38 | . S DIR(0)="YO",DIR("A",1)="Reprinting labels for "_LRCNT_" accessions!",DIR("A")="Are you sure",DIR("B")="NO"
|
---|
39 | . D ^DIR
|
---|
40 | . I Y<1!($D(DIRUT)) S LRQUIT=1 Q
|
---|
41 | I LRQUIT D K Q
|
---|
42 | I $D(LRLABLIO("Q")) D G ASK
|
---|
43 | . S ZTIO=LRLABLIO,ZTRTN="LOAD^LRLABXT",ZTDESC="Reprint Lab Accession Labels"
|
---|
44 | . S ZTSAVE("^TMP(""LRLABXT"",$J,")=""
|
---|
45 | . D ^%ZTLOAD
|
---|
46 | . W !,"Labels ",$S($G(ZTSK):"queued to "_$P(LRLABLIO,";")_" Task #"_ZTSK,1:"NOT queued"),!
|
---|
47 | . K ZTSK,ZTRTN,ZTIO,ZTDESC,ZTSAVE
|
---|
48 | W !!,"Printing labels on ",$P(LRLABLIO,";"),!
|
---|
49 | D USE^%ZISUTL("LRLABEL")
|
---|
50 | LOAD ; Tasked entry point and from above.
|
---|
51 | D PSET^LRLABLD
|
---|
52 | F S LRLABX=$Q(^TMP("LRLABXT",$J)) Q:LRLABX="" Q:$QS(LRLABX,1)'="LRLABXT"!($QS(LRLABX,2)'=$J) D
|
---|
53 | . S LRAA=$QS(LRLABX,3),LRAD=$QS(LRLABX,4),LRAN=$QS(LRLABX,5)
|
---|
54 | . D LBLTYP^LRLABLD
|
---|
55 | . D PRINT
|
---|
56 | . K @LRLABX
|
---|
57 | I $D(ZTQUEUED) D K Q
|
---|
58 | G ASK
|
---|
59 | ;
|
---|
60 | PRINT ;
|
---|
61 | ; Called by above, LRLABXOL
|
---|
62 | Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0))
|
---|
63 | S X=^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRSN=+$P(X,U,5),LRODT=+$P(X,U,4),LRLLOC=$P(X,U,7)
|
---|
64 | S LRCE=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.1)),"^")
|
---|
65 | S LRACC=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.2)),"^")
|
---|
66 | S LRRB=0
|
---|
67 | D LRBAR^LRLABLD
|
---|
68 | D GO^LRLABLD
|
---|
69 | Q
|
---|
70 | ;
|
---|
71 | IOCHK ; Select and check label printer.
|
---|
72 | ; Called from above, LRLABXOL
|
---|
73 | I '$D(LRLABLIO) D
|
---|
74 | . D ^LRLABLIO
|
---|
75 | . ; Time delay - allow port to be reopened if closed in call to LRLABLIO
|
---|
76 | . I $D(LRLABLIO),'$D(IO("Q")) H 2
|
---|
77 | I '$D(LRLABLIO) Q
|
---|
78 | I '$D(LRLABLIO("Q")) D
|
---|
79 | . N %ZIS,IOP
|
---|
80 | . S %ZIS="",IOP=LRLABLIO
|
---|
81 | . D OPEN^%ZISUTL("LRLABEL",IOP,.%ZIS) ; Setup handle for user's LABEL device.
|
---|
82 | . I POP D
|
---|
83 | . . W !,$C(7),"Unable to open device"
|
---|
84 | . . K LRLABLIO
|
---|
85 | Q
|
---|
86 | ;
|
---|
87 | SETTMP ; Setup TMP global with accession to reprint.
|
---|
88 | S LRCNT=LRCNT+1,^TMP("LRLABXT",$J,LRAA,LRAD,LRAN)=""
|
---|
89 | Q
|
---|
90 | ;
|
---|
91 | K ; Cleanup
|
---|
92 | I $D(ZTQUEUED) S ZTREQ="@"
|
---|
93 | E D CLOSE^%ZISUTL("LRLABEL"),CLOSE^%ZISUTL("LRHOME"),PKILL^%ZISP
|
---|
94 | D KVAR^LRX
|
---|
95 | K %,IO("Q"),A,B,DIC,I,I1,IOP,J,K,L,LAST,N,POP,R,S1,S2,T,X,Y,Z
|
---|
96 | K LRAA,LRACC,LRAD,LRAN,LRCE,LRCNT,LRDAT,LRDPF,LREXMPT,LRINFW,LRLABEL,LRLF,LRDFN,LRODT,LRPREF,LRSSP
|
---|
97 | K LRNOLABL,LRPRAC,LRTJ,LRTJDATA,LRLABX,LRQUIT,LRTOP,LRTS,LRTYPE,LRTV,LRTVOL,LRTXT,LRVOL,LRLABLIO,LRFN,LRAD,LRLLOC,LRNN,LRRB,LRSN
|
---|
98 | K LRX,LRXL,LRBAR,LRBAR1,LRBAR0,LRBARID,LRUID,LRURG,LRURG0,LRURGA
|
---|
99 | K ^TMP("LRLABXT",$J)
|
---|
100 | Q
|
---|