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

AGTEMPP.m

Go to the documentation of this file.
AGTEMPP ; IHS/ASDS/EFG - PRINT LIST OF TEMPORARY CHART # PATIENTS ;  
 ;;7.1;PATIENT REGISTRATION;**4**;AUG 25,2005
 I $O(^AUPNPAT("D",999999))="" W "At this time, there are no patients with temporary chart numbers.",!!,"Press the RETURN key to continue. " R Y:30 Q
 S AGIO=IO,AG("HAT")=""
DEV S %ZIS="OPQ" D ^%ZIS I POP S IOP=ION D ^%ZIS Q
 G:'$D(IO("Q")) START K IO("Q") I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
 X ^%ZOSF("UCI") S ZTRTN="START^AGTEMPP",ZTUCI=Y,ZTDESC="TEMPORARY HRNs for "_$P(^AUTTLOC(DUZ(2),0),U,2)_"." F G="DUZ" S ZTSAVE(G)=""
 D ^%ZTLOAD G:'$D(ZTSK) DEV K AG,AGIO,ZTDESC,ZTRTN,ZTSK,ZTUCI D ^%ZISC
 Q
START ;EP - From TaskMan.
 S (AGPGPG,T)=0,AGTEMP=999999,X=$P(^DIC(4,DUZ(2),0),U) D CTR^AG S AG("LOC")=X,AG("USR")=$P(^VA(200,DUZ,0),U),AGBM=IOSL-10 I $D(AGIO),AGIO=IO S AGBM=IOSL-4
 X ^%ZOSF("UCI") S X="UCI: "_$P(Y,",") D CTR^AG S AGUCI=X
 U IO D NOW^AG S X="as of "_AGTIME D CTR^AG S AGTIME=X D HDR
E K ^UTILITY("DIQ1",$J) S AGTEMP=$O(^AUPNPAT("D",AGTEMP)) G END:AGTEMP="" S DFN=$O(^AUPNPAT("D",AGTEMP,0)) G E:DFN=""
 W:$D(^DPT(DFN,0)) $P(^(0),U)
 ;S DIC=2,DR=.09,DA=DFN D EN^DIQ1 W:$D(^(DR)) ?52,^(DR) S DR=.03 D EN^DIQ1 W:$D(^(DR)) ?66,^(DR)
 W ?52,$$GET1^DIQ(9000001,DFN_",",1107.3) S DIC=2,DA=DFN,DR=.03 D EN^DIQ1 W:$D(^(DR)) ?66,^(DR)  ;IHS/SD/TPF AG*7.1*4
 W !
 F AG("II")=1:1 S DIC=9000001.41,DA=DFN,AG("DRENT")=AG("II"),DR=.02 D ^AGDICLK Q:$D(AG("LKERR"))  W ?20,$J(AG("LKPRINT"),6) S AG("DRENT")=AG("II"),DR=.01 D ^AGDICLK W:$D(AG("LKPRINT")) ?30,$P(^DIC(4,AG("LKPRINT"),0),U) W !
 S T=T+1 I $Y>AGBM D RTRN^AG G:$D(DUOUT)!$D(DFOUT)!$D(DTOUT) END1 D HDR
 G E
END W !!,"Total patients with temporary chart numbers: ",T K AG("HAT") D RTRN^AG W $$S^AGVDF("IOF")
END1 D ^%ZISC K AG,AGBM,AGIO,AGTIME,C,DA,AG("DENT"),DFN,DIC,DLOUT,DR,G,AGL,AG("LKDATA"),AG("LKERR"),AG("LKPRINT"),AG("LOC"),N,AGUCI,AG("USR"),AGPCC,AGPGPG,T,AGTEMP,X,Y D:$D(ZTQUEUED) KILL^%ZTLOAD
 Q
HDR S AGPGPG=AGPGPG+1,AG("LINE")="=" W $$S^AGVDF("IOF"),!!,AG("USR"),?72,"page ",AGPGPG,!,AG("LOC"),!?22,"PATIENTS WITH TEMPORARY CHART NUMBERS",!,AGUCI,!,AGTIME,!!!!?3,"Name",?21,"IHS #",?30,"FACILITY",?56,"SSN",?70,"DOB",! D LINE^AG
 Q