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

APSPAMIS.m

Go to the documentation of this file.
APSPAMIS ; IHS/DSD/ENM - BHAM ISC/SAB/IHS/ENM - IHS PHARMACY AMIS REP ;  [ 09/03/97   1:30 PM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;;09/03/97
 W ! S %DT(0)=-DT,%DT("A")="PRINT AMIS STATS STARTING: " S %DT="EPXA" D ^%DT G:"^"[X END G APSPAMIS:Y<0 S SDT=Y K %DT(0)
EDT W ! S %DT(0)=SDT,%DT("A")="ENDING STATS DATE: " D ^%DT G:"^"[X END S EDT=Y I Y<0 G EDT K %DT
ZDIV ;IHS/DSD/ENM 10/16/96 ASK DIV MODULE ADDED
 S DIR(0)="Y",DIR("A")="Would you like all divisions",DIR("B")="YES",DIR("?")="Enter 'Yes' or 'No'" D ^DIR K DIR Q:$D(DTOUT)
 I "Yy"[X S APSPANS="A" G DEV
 S DIR(0)="PO^59:EMZ",DIR("A")="Select Division",DIR("?")="Enter the Division Name or Number "
 D ^DIR G:$D(DTOUT)!$D(DUOUT) END K DIR
 S APSPANS=+Y
 ;IHS/DSD/ENM 10/16/96 END OF ASK DIV MODULE
DEV K %ZIS,IOP,ZTSK S %ZIS("B")="",PSOION=ION,%ZIS="QM" D ^%ZIS I POP S IOP=PSOION D ^%ZIS K IOP,PSOION G END
 ;I $E(IOST)["C"!($G(IOM)<132) W *7,!!,"PRINTOUT MUST BE SENT TO A 132 COLUMNS PRINTER !!",!! G DEV ;IHS/DSD/ENM DISABLED 5.15.95
 K PSOION I $D(IO("Q")) S ZTDESC="Option to print the Outpatient AMIS report",ZTRTN="ENQ^APSPAMIS" F G="SDT","EDT","APSPANS" S:$D(@G) ZTSAVE(G)=""
 I  K IO("Q") D ^%ZTLOAD W:$D(ZTSK) !,"Report Queued !" K G,ZTSAVE,ZTSK,Y,X,%DT G END
ENQ ;START COMPUTATIONS
 K ^TMP($J) D COM S PSDATE=SDT-1 F G=0:0 S PSDATE=$O(^PS(59.1,PSDATE)) Q:'PSDATE!(PSDATE>EDT)!($D(DUOUT))  F I=0:0 S I=$O(^PS(59.1,PSDATE,1,I)) Q:'I!($D(DUOUT))  D  ;IHS/DSD/ENM 5.15.95
 .S ^TMP($J,I,PSDATE)=$P(^PS(59.1,PSDATE,1,I,0),"^",2)_"^"_$P(^PS(59.1,PSDATE,1,I,0),"^",7,8)_"^"_$P(^PS(59.1,PSDATE,1,I,0),"^",10,12)_"^"_$P(^PS(59.1,PSDATE,1,I,0),"^",14,17) D
 ..F G=1:1:10 S DAT(I,G)=$P(^TMP($J,I,PSDATE),"^",G)+DAT(I,G),GT(G)=$P(^TMP($J,I,PSDATE),"^",G)+GT(G)
 S GR=0
 F DIV=0:0 S DIV=$O(^PS(59,DIV)) Q:'DIV!($D(DUOUT))  D:GR SUB D RPT F PSDATE=0:0 S PSDATE=$O(^TMP($J,DIV,PSDATE)) Q:'PSDATE!($D(DUOUT))  S DAT=^(PSDATE) D:$Y+4>IOSL RPT W !,$E(PSDATE,4,5)_"-"_$E(PSDATE,6,8)_"-"_$E(PSDATE,2,3) D  S GR=1,ST=DIV
 .F K=1:1:10 W $J($P(DAT,"^",K),9)
 .I $Y+4>IOSL,IOST["C-" D FZZ Q:$D(DUOUT)!($D(DTOUT))  ;IHS/DSD/ENM 5.95
 Q:$D(DUOUT)!($D(DTOUT))  ;IHS/DSD/ENM 5.95
 D SUB,GR
 ;
END W ! W:$E(IOST)'["C" @IOF D ^%ZISC K GR,ST,%DT,G,SDT,EDT,X,Y,POP,^TMP($J),K,PSDATE,I,DAT,G,GT,DIV S:$D(ZTQUEUED) ZTREQ="@"
 Q
RPT ; HEADER
 Q:$D(DUOUT)!($D(DTOUT))
 U IO W @IOF,!?55,"A M I S    R E P O R T",!!?40,"FROM "_$E(SDT,4,5)_"-"_$E(SDT,6,7)_"-"_$E(SDT,2,3),?60,"TO "_$E(EDT,4,5)_"-"_$E(EDT,6,7)_"-"_$E(EDT,2,3)_"      DIVISION: "_$P(^PS(59,DIV,0),"^")
 W !!,"DATE    " F K=1:1:10 W $J($P("INPAT^OTHER^CNTLD^PAT REQ^FEE^STAFF^NEW^REFILL^WINDOW^MAIL","^",K),9)
 W ! F K=1:1:132 W "-"
 Q
COM ;COMPILE SUB-TOTALS AND GRAND TOTALS
 F DIV=0:0 S DIV=$O(^PS(59,DIV)) Q:'DIV  F G=1:1:10 S (DAT(DIV,G),GT(G))=0
 Q
SUB ;PRINT SUB TOTALS
 ;I $Y+2>IOSL,IOST["C-" D FZZ Q:$D(DUOUT)!($D(DTOUT)) ;IHS/DSD/ENM 5.95
 ;W:$Y+2>IOSL @IOF W !?8 F K=1:1:10 W $J("-------",9)
 W !,"SUB-TOTALS",!,?8 F K=1:1:10 W:$D(ST) $J(DAT(ST,K),9)
 I $Y+2>IOSL,IOST["C-" D FZZ Q:$D(DUOUT)!($D(DTOUT))  ;IHS/DSD/ENM 5.95
 W:$Y+2>IOSL @IOF W !?8 F K=1:1:10 W $J("-------",9)
 Q
GR ;PRINT GRAND TOTALS
 I $Y+4>IOSL,IOST["C-" D FZZ Q:$D(DUOUT)!($D(DTOUT))  ;IHS/DSD/ENM 5.95
 W:$Y+4>IOSL @IOF W !?8 F K=1:1:10 W $J("-------",9)
 W !,"GRAND TOTALS",!,?8 F K=1:1:10 W $J(GT(K),9)
 W ! Q
FZZ ;IHS/DSD/ENM CAUSE A PAUSE 5.95
 K DTOUT,DUOUT,DIR  S DIR("?")="Enter '^' to halt or Press Return to Continue",DIR(0)="FO",DIR("A")="Press Return to Continue or '^' to Halt" D ^DIR
 Q