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

APSPDRP2.m

Go to the documentation of this file.
APSPDRP2 ; IHS/DSD/ENM - CONTINUATION OF APSPDRP1 ;  [ 09/03/97   1:30 PM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;;09/03/97
 ; IHS/OHPRD/JCM 10/17/90 Changed PRINT+9 $P(APSPDRP1(0)) to 4 from 2
 ;
 ; Had to break up APSPDRP1 because of its size
 ; This routine should not be called by any other routine than
 ; APSPDRP1
 ;--------------------------------------------------------------------
START ;
 Q:'$D(APSPDRP1)
 S APSPDRP2=""
 F APSPDRP1("DATE")=0:0 S APSPDRP1("DATE")=$O(^TMP("APSPDRP1",$J,APSPDRP1("STUDY"),APSPDRP1("DATE"))) Q:'APSPDRP1("DATE")!($D(APSPDRP1("QFLG")))  D PROV
 K APSPDRP2
END Q
 ;_____________________________________________________________________
PROV ;
 F APSPDRP1("PROV")=0:0 S APSPDRP1("PROV")=$O(^TMP("APSPDRP1",$J,APSPDRP1("STUDY"),APSPDRP1("DATE"),APSPDRP1("PROV"))) Q:'APSPDRP1("PROV")!($D(APSPDRP1("QFLG")))  D DA
 Q
DA ;
 F APSPDRP1("DA")=0:0 S APSPDRP1("DA")=$O(^TMP("APSPDRP1",$J,APSPDRP1("STUDY"),APSPDRP1("DATE"),APSPDRP1("PROV"),APSPDRP1("DA"))) Q:'APSPDRP1("DA")!($D(APSPDRP1("QFLG")))  D PRINT
 Q
PRINT ;
 S APSPDRP1("REM CNT")=0
 I $D(^APSPDUE(32,APSPDRP1("DA"),12)) F APSPIII=0:0 S APSPIII=$O(^APSPDUE(32,APSPDRP1("DA"),12,APSPIII)) Q:'APSPIII  S APSPDRP1("REM LINE",APSPIII)=^APSPDUE(32,APSPDRP1("DA"),12,APSPIII,0),APSPDRP1("REM CNT")=APSPDRP1("REM CNT")+1
 I $E(IOST,1,2)="P-",($Y+1+APSPDRP1("CR LF")+APSPDRP1("REM CNT"))>IOSL W @IOF D HEADER^APSPDRP1
 I $E(IOST,1,2)'="P-",($Y+1+APSPDRP1("CR LF")+APSPDRP1("REM CNT"))>IOSL D EOP G:$D(APSPDRP1("QFLG")) PRINTX
 W !
 S APSPDRP1(0)=^APSPDUE(32,APSPDRP1("DA"),0)
 S Y=$P(APSPDRP1(0),U,1) X ^DD("DD")
 W Y K Y
 W ?15,$E($P(^DPT($P(APSPDRP1(0),U,4),0),U,1),1,25) ;IHS/OHPRD/JCM 10/17/90
 W ?40,$E($P(^DIC(16,$P(APSPDRP1(0),U,6),0),U,1),1,25)
 W ?62
 F APSPI=0:0 S APSPI=$O(^APSPDUE(32,APSPDRP1("DA"),11,APSPI)) Q:'APSPI  S APSPDRP1("CR",$P(^APSPDUE(32.2,APSPI,0),U,1))=^APSPDUE(32,APSPDRP1("DA"),11,APSPI,0)
 F APSPII=0:0 S APSPII=$O(APSPDRP1("CR",APSPII)) Q:'APSPII  W:$X+12>IOM !,?62 W ?($X+3),$S($P(APSPDRP1("CR",APSPII),U,2)=0:"NO",$P(APSPDRP1("CR",APSPII),U,2)=1:"YES",1:"UN") D
 . S:'$D(APSPDRP1("YES CNT",APSPII)) APSPDRP1("YES CNT",APSPII)=0
 . S:$P(APSPDRP1("CR",APSPII),U,2) APSPDRP1("YES CNT",APSPII)=(APSPDRP1("YES CNT",APSPII)+1)
 W ?(IOM-3),$S('$P(APSPDRP1(0),U,8):"NO",1:"YES") S:$P(APSPDRP1(0),U,8) APSPDRP1("ALL MET CNT")=(APSPDRP1("ALL MET CNT")+1)
 I $D(APSPDRP1("REM LINE")) W !,"Remarks: " F APSPIIII=1:1:APSPDRP1("REM CNT") W:APSPIIII=1&($X+$L(APSPDRP1("REM LINE",APSPIIII))>IOM) ! W:APSPIIII'=1 ! W APSPDRP1("REM LINE",APSPIIII)
 W !
 S APSPDRP1("CNT")=(APSPDRP1("CNT")+1)
PRINTX K APSPDRP1("CR"),APSPDRP1(0),APSPI,APSPII,APSPIII,APSPDRP1("REM LINE")
 Q
EOP ; Calls reader for an End of Page call
 S DIR(0)="E" D ^DIR K DIR,X,Y
 S:$D(DTOUT)!($D(DUOUT)) APSPDRP1("QFLG")=1
 S (DX,DY)=1 X:$D(^%ZOSF("XY"))#2 ^("XY")
 Q