source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRLL1A.m@ 1766

Last change on this file since 1766 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1LRLL1A ;SLC/RWF - LOAD LIST CONTROL ; 2/23/89 17:29 ;
2 ;;5.2;LAB SERVICE;;Sep 27, 1994
3L1 W !,"All urgencys" S %=1,LRURX="I 1" D YN^DICN G END:%=-1 I %=0 W !,"Build the list with all urgencys or with a range." G L1
4 I %=2 S DIC="^LAB(62.05,",DIC("S")="I '$P(^(0),U,3)",DIC(0)="AEMQ",DIC("A")="Most Urgent:" D ^DIC G END:Y<.1 S L1=+Y,DIC("A")="Least Urgent:" D ^DIC G END:Y<.1 S LRURX="I LRUS'<"_+L1_"&(LRUS'>"_+Y_")"
5L2 W !,"1 Allow splitting tests from each accession between load/worklists.",!,"2 Require all tests to build or build none at all (for each accession).",!,"Choose: 1//" R X:DTIME G:X="^" END I X'="",'(X=1!(X=2)) W !,"Enter 1 or 2." G L2
6 S LRSPLIT=(X'=2),DUOUT=0
7 D CLEAR^LRLL3:'$D(^LRO(68.2,LRINST,2)) S LAST=$S($D(^LRO(68.2,LRINST,2)):^(2),1:"^1^1^0^0") G END:DUOUT
8 IF +LAST,+LAST'=DT W !!,"LOAD/WORK LIST SET FOR " S Y=+LAST D DD^LRX W Y S %=1 D CLEAR^LRLL3 G END:DUOUT
9C1 S LRAD=DT W !,"HOW MANY",$S(LRTYPE:" TRAYS",1:" ENTRIES")," TO BUILD: ALL//" R X:DTIME G END:X["^"
10 W:X["?" !,"Accessions will be put on the list only to fill the number of",$S(LRTYPE:" trays",1:" entries")," specified." G C1:X["?" S:X=""!("Aa"[$E(X)) X=9999 S:X<1 X=1 S LRTRACNT=+X
11 W:LRAA !," ACCESSION LIST: ",$P(^LRO(68,LRAA,0),U,1) I LRAA="" W !,"Need an accession area." S LRDEF=2 D NODEF
12 K LRSTAR W !,"USE DEFAULT SETUP" S %=1 D YN^DICN Q:%<1 S LRDEF=% G BUILD:%=1
13NODEF K DIC
14 W ! D CLEAR^LRLL3
15 S DIC="^LRO(68,",DIC(0)="AEOQ",DIC("B")=$P(^LRO(68,LRAA,0),U,1) D ^DIC K DIC Q:Y<1 S LRAA=+Y
16 D:$P(^LRO(68,LRAA,0),U,3)="Y" LRSTAR G BUILD:$D(LRSTAR)
17DAT R !,"Accession DATE: T//",X:DTIME S:X="" X="T" S %DT="EP" D ^%DT G DAT:X["?" S LRAD=Y
18 R !,"ACCESSION NUMBER: FIRST//",LRST:DTIME S LRST=$S(LRST="":1,LRST:+LRST,1:-1) Q:LRST<0
19 R !," GOTO: LAST//",LRLLT:DTIME S LRLLT=$S(LRLLT="":9999999,LRLLT:+LRLLT,1:-1) Q:LRLLT<0
20BUILD S LRTRAY=1+$P(LAST,U,4),LRCUP=1+$P(LAST,U,5)
21 W !,$S(LRTYPE:"TRAY",1:"SEQUENCE #")," TO START WITH: ",$S(LRTYPE:LRTRAY,1:LRCUP),"//" R X:DTIME Q:X=U I X["?" W !?5,"Enter number to start with.",! G BUILD
22 S X=$S(X="":$S(LRTYPE:LRTRAY,1:LRCUP),X<1:1,1:+X) S:LRTRAY'=$P(LAST,U,4) LRCUP=1
23 S LRTRAY=$S(LRTYPE:+X,1:1),LRCUP=+$S(LRTYPE:$S($D(^LRO(68.2,LRINST,1,LRTRAY)):LRCUP,1:1),1:+X)
24 IF $D(^LRO(68.2,LRINST,1,LRTRAY,1,LRCUP,0)) W $C(7),!," STARTING POINT IN USE. OK" S %=1 D YN^DICN G BUILD:%'=1
25 I LRDEF=1,$P(^LRO(68,LRAA,0),U,3)="Y" D LRSTAR Q:%<0
26 G B1:$D(LRSTAR)
27 S X=$P(^LRO(68,LRAA,0),U,3),LRAD=$S(X="Y":$E(LRAD,1,3)_"0000","D"[X:LRAD,"M"[X:$E(LRAD,1,5)_"00","Q"[X:$E(LRAD,1,3)_"0000"+(($E(LRAD,4,5)-1)\3*300+100),1:LRAD)
28B1 S $P(^LRO(68.2,LRINST,2),U,2,3)=LRTRAY_U_LRCUP S:LRCUP>0 LRCUP=LRCUP-1 K % X LRLLINIT
29B2 K IO("Q") W !,"Queue build and print:" S %=2 D YN^DICN Q:%<0 S:%=1 IO("Q")=1 I %=0 W !?5,"Answer YES or NO.",! G B2
30 G ^LRLL1
31LRSTAR W !,"Do you wish to build by date (rather than by accession number)" S %=1 D YN^DICN G LRSTAR:%=0 Q:%'=1
32 S %DT="AEQ",%DT("A")="Enter earliest date received at lab to build: " D ^%DT K %DT S:Y<1 %=-1 Q:Y<0 S LRSTAR=Y
33 K DUOUT S %DT="AEQ",%DT("A")="Enter latest date received at lab to build: " D ^%DT K %DT S LRLST=Y,%=$S($D(DUOUT):-1,1:0)
34 S LRAD=$E(LRSTAR,1,3)-1_"0000" S:LRLST'=-1 LRWDTL=$E(LRLST,1,3)_"0000",LRLST=LRLST\1+.99 S:LRLST=-1 LRWDTL=$E(DT,1,3)_"0000"
35 Q
36END G END^LRLL1
37 ;LRTRAY = CURRENT TRAY #, LRCUP = CURRENT CUP #
38 ;LRTYPE = 0 FOR SEQ., 1 FOR TRAY, 2 FOR BATCH
39 ;LRFULL = 0 FOR ALL WORK, 1 FOR FULL TRAY'S ONLY
40 ;MAXCUP = # OF LRCUP PER LRTRAY, 0 IF NO LIMIT
Note: See TracBrowser for help on using the repository browser.