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

PSGPOR.m

Go to the documentation of this file.
PSGPOR ;BIR/CML3-PATIENT ORDER PURGE REPORT ;24 JAN 94 / 11:15 AM
 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
 S PSGPOD=$E($$ENDTC^PSGMI(PSGPOD),1,8) D NOW^%DTC S PSGOD=$$ENDTC^PSGMI(%) S (LN1,LN2,PG)="",$P(LN1,"-",81)="",$P(LN2,"=",81)="" U IO D HEADER I '$O(^PS(53.43,1,1,PSGJ,1,0)) W !!!?31,"NO ORDERS PURGED." G DONE
 S (PG,PT,NDT)=0 F PSGP=0:0 S PSGP=$O(^PS(53.43,1,1,PSGJ,1,PSGP)) Q:'PSGP  S ND=$P(^(PSGP,0),"^",2) D:$Y+5>IOSL HEADER D WRT
 D:$Y+9>IOSL HEADER W !!!,LN2,!!?3,"PATIENTS: ",PT,?55,$J(NDT,5,0) W:$Y @IOF
 ;
DONE ;
 W:$Y @IOF K ^PS(53.43,1,1,PSGJ),ND,NDT,PT,PSGP,PSGID,PSGOD,LN1,LN2 Q
 ;
 S PG=PG+1 W:$Y @IOF W !!?25,"PATIENT ORDER PURGE REPORT",?64,PSGOD,!?16,"(FOR PATIENTS DISCHARGED ON OR BEFORE ",PSGPOD,")",?73-$L(PG),"Page: ",PG,!?5,"Patient",?55,"Number of",!?55,"Orders Purged",!,LN1 Q
 ;
WRT ;
 S PN=$G(^DPT(PSGP,0)) W !!?2,$S($P(PN,"^")]"":$P(PN,"^"),1:PSGP),$S($P(PN,"^",9):"  ("_$E($P(PN,"^",9),6,10)_")",1:""),?55,$J(ND,5,0) S PT=PT+1,NDT=NDT+ND Q