Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: APSQDISP

APSQDISP.m

Go to the documentation of this file.
APSQDISP ;IHS/ASDS/ENM/POC - LOOK UP 
 ;;6.0;IHS PHARMACY MODIFICATIONS;**3**;FEB 20, 2001
EN1 ;EP
 K APSQARR
 S APSQCNT=0,APSQLKUP=""
 S APSQSEQ=0 F  S APSQSEQ=$O(^APSQFAST("S",APSQSEQ)) Q:APSQSEQ=""   D
 .S APSQLKUP=$$SETSTR^VALM1($J(APSQSEQ,2),APSQLKUP,3,3)
 .S APSQIEN=$O(^APSQFAST("S",APSQSEQ,""))
 .Q:'APSQIEN
 .S APSQNAME=$P(^APSQFAST(APSQIEN,0),U,1)
 .S APSQLKUP=$$SETSTR^VALM1(APSQNAME,APSQLKUP,8,15)
 .;I $D(^APSQFAST(APSQIEN,2))#10 S APSQSEC="EXPLODE"
 .I $O(^APSQFAST(APSQIEN,2,0)) S APSQSEC="EXPLODE"
 .E  S APSQSEC=$P(^PSDRUG($P(^APSQFAST(APSQIEN,0),U,2),0),U,1)
 .S APSQLKUP=$$SETSTR^VALM1(APSQSEC,APSQLKUP,25,20)
 .S APSQARR(APSQSEQ,0)=APSQLKUP
 .S APSQCNT=APSQCNT+1
 .S APSQARR("IDX",APSQCNT,APSQSEQ)=APSQIEN
 .S APSQLKUP=""
 .Q
 ;NEED TO SET VALMCNT=APSQCNT
 Q
EN2 ;LOOK UP [ 12/06/98  7:08 PM ]
 K APSQARR
 S (APSQCNT,APSQLKUP)="",(APSQLAST,APSQKILL)=0
 S APSQSEQ=0 F  S APSQSEQ=$O(^APSQFAST("S",APSQSEQ)) Q:APSQSEQ=""   D  ;
 .D SUB1
 .D SWT
 .;S:'APSQKILL APSQCNT=APSQCNT+1
 .D FILE:'APSQKILL
 I APSQKILL S APSQLAST=1 D FILE ;FOR THE LAST ONE IF ODD
 ;D FILE2
 Q
SUB1 ;S APSQSEQ=APSQSEQ+1
 I $D(APSQ("GOT",APSQSEQ)) S APSQSTAR=1
 I 'APSQKILL S APSQLKUP=$$SETSTR^VALM1($J($S($G(APSQSTAR):"*",1:"")_APSQSEQ,2),APSQLKUP,3,3)
 I APSQKILL S APSQLKUP=$$SETSTR^VALM1($J($S($G(APSQSTAR):"*",1:"")_APSQSEQ,2),APSQLKUP,40,3)
 K APSQSTAR
 S APSQIEN=$O(^APSQFAST("S",APSQSEQ,""))
 Q:'APSQIEN
 S APSQNAME=$P(^APSQFAST(APSQIEN,0),U,1)
 I 'APSQKILL S APSQLKUP=$$SETSTR^VALM1(APSQNAME,APSQLKUP,8,10)
 I APSQKILL S APSQLKUP=$$SETSTR^VALM1(APSQNAME,APSQLKUP,45,10)
 ;I $D(^APSQFAST(APSQIEN,2))#10 S APSQSEC="EXPLODE"
 I $O(^APSQFAST(APSQIEN,2,0)) S APSQSEC="EXPLODE"
 E  S APSQSEC=$P(^PSDRUG($P(^APSQFAST(APSQIEN,0),U,2),0),U,1)
 I 'APSQKILL S APSQLKUP=$$SETSTR^VALM1(APSQSEC,APSQLKUP,20,15)
 I APSQKILL S APSQLKUP=$$SETSTR^VALM1(APSQSEC,APSQLKUP,57,15)
 Q
FILE ;
 S APSQCNT=APSQCNT+1
 ;S APSQARR(APSQSEQ,0)=APSQLKUP
 S APSQARR(APSQCNT,0)=APSQLKUP
 S APSQLKUP=""
 Q
 ;LINE BELOW FOR LAST ONE
 I APSQLAST S APSQLAST=0 S APSQARR("TMP",APSQCNT)=(APSQCNT*2-1)
 ;THIS WHOLE SERIES OF LINES TO SET IDX IS TO GET AROUND ONE COLUMN
 E  S APSQARR("TMP",APSQCNT)=(APSQCNT*2-1)_","_(APSQCNT*2)
 Q
FILE2 ;FIX IDX
 S (I,IDX)=0 F  S IDX=$O(APSQARR("TMP",IDX)) Q:IDX=""  D
 .S I=I+1
 .;VALM("BM") IS THE BOTTOM MARGIN MUST BE 6!!! OR MUST CHANGE "4" BELOW
 .S APSQBM=VALM("BM")-4 ;GOT FOUR LINES AT BEGINNING OF HEADING
 .S APSQARR("IDX",IDX,$S((I=APSQBM)&$P(APSQARR("TMP",IDX),",",2):$P(APSQARR("TMP",IDX),",",2),1:$P(APSQARR("TMP",IDX),",",1)))=""
 .I I=VALM("BM") S I=0
 ;NEED TO SET VALMCNT=APSQCNT
 Q
SWT ;SWITH APSQKILL BACK AND FORTH BETWEEN 1 AND 0
 ;APSQKILL IS USED TO SET THE FIRST AND SECOND PART OF VARIABLE APSQLKUP
 ;AND SET A APSQARR("DIR",APSQSEQ,APSQIEN)=""
 S APSQARR("DIR",APSQSEQ,APSQIEN)=""
 I APSQKILL=1 S APSQKILL=0 Q
 E  S APSQKILL=1
 Q
SELECT ;SELECT ENTITIES
 ;D EN^VALM2(XQORNOD(0),"O") ;this list man call allows user to select an entry in list
 ;I '$D(VALMY) W !,"Nothing selected." Q
 D FULL^VALM1 ;give me full control of screen
 Q:'$D(APSQARR("DIR"))
 S APSQBEG=$O(APSQARR("DIR","")),APSQEND=$O(APSQARR("DIR",""),-1)
 K DIR
 S DIR(0)="LO^"_APSQBEG_":"_APSQEND
 D ^DIR
 I '+Y W !,"NO SELECTIONS-BYE" Q
 S APSQY="" F  S APSQY=$O(Y(APSQY)) Q:APSQY=""  D
 .F I=1:1 S APSQGOT=$P(Y(APSQY),",",I) Q:APSQGOT=""  D
 ..S APSQGOTT=$O(APSQARR("DIR",APSQGOT,""))
 ..I APSQGOTT="" W !,"NO SUCH CRITTER ",APSQGOT," SO ITEM DELETED!"
 ..;E  S APSQARR("GOT",APSQGOTT)=""
 ..E  S APSQARR("GOT",APSQGOT,APSQGOTT)="",APSQ("GOT",APSQGOT,APSQGOTT)=""
 D LIST,HANG,EN2,BACK
 Q
HANG ;
 S DIR(0)="EO",DIR("A")="HIT RETURN TO CONTINUE..." D ^DIR K DIR
 Q
LIST ;LIST ENTRIES SELECTED
 W !,$S($D(APSQARR("GOT")):"",1:"NO ")," ENTRIES SELECTED:"
 S APSQLIST=0 F  S APSQLIST=$O(APSQARR("GOT",APSQLIST)) Q:APSQLIST=""  D
 .S APSQLIS1=$O(APSQARR("GOT",APSQLIST,""))
 .W !,$P(^APSQFAST(APSQLIS1,0),U,1)
 Q
BACK ;GO BACK
 D TERM^VALM0
 S VALMBCK="R"
 ;D INIT AGAIN
 K DIR
 Q