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

AGALPHA.m

Go to the documentation of this file.
AGALPHA ; IHS/ASDS/EFG - ALPHA LISTING OF REGISTERED PATIENTS ;  
 ;;7.1;PATIENT REGISTRATION;**4,5**;AUG 25,2005
 S AGIO=IO,AG("HAT")=""
DEV S %ZIS="OPQ" D ^%ZIS I POP S IOP=ION D ^%ZIS Q
 G:'$D(IO("Q")) L1 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="L1^AGALPHA",ZTUCI=Y,ZTDESC="ALPHA LIST OF REGISTERED PATIENTS for "_$P(^AUTTLOC(DUZ(2),0),U,2)_"."
 D ^%ZTLOAD G:'$D(ZTSK) DEV K AGIO,ZTRTN,ZTUCI,ZTDESC,ZTSK D ^%ZISC
 Q
L1 ;EP - From TaskMan.
 S (AGPGPG,AGNAME,T)=0,AG("USR")=$P(^VA(200,DUZ,0),U),X=$P(^DIC(4,DUZ(2),0),U) D CTR^AG S AG("LOC")=X X ^%ZOSF("UCI") S X="UCI: "_$P(Y,",",1) D CTR^AG S AGUCI=X,AGBM=IOSL-10 I $D(AGIO),AGIO=IO S AGBM=IOSL-4
 D NOW^AG S X="as of "_AGTIME D CTR^AG S AGTIME=X U IO D HDR
L2 S AGNAME=$O(^DPT("B",AGNAME)) G END:AGNAME="" S DFN=0
L3 S DFN=$O(^DPT("B",AGNAME,DFN)) G L2:DFN="",L3:'$D(^AUPNPAT(DFN,41,DUZ(2),0))!'$D(^DPT(DFN)),L3:$P(^DPT(DFN,0),U)'=AGNAME,L3:$P(^DPT(DFN,0),U,19)>0 ;skip merged patient
 W $P(^DPT(DFN,0),U),"  " S AG=$S($P(^AUPNPAT(DFN,41,DUZ(2),0),U,3)]"":"*",1:"") D DEAD^AGMAN S AG=AG_$S($D(AG("DEAD")):"D",1:"") W:AG]"" "(",AG,")"
 W ?44,$J($P(^AUPNPAT(DFN,41,DUZ(2),0),U,2),6)
 ;K ^UTILITY("DIQ1",$J) S DIC=2,DR=.09,DA=DFN D EN^DIQ1 W:$D(^(DR)) ?53,^(DR) S DR=.03 D EN^DIQ1 W:$D(^(DR)) ?67,$J(^(DR),10)
 ;K ^UTILITY("DIQ1",$J) S DIC=9000001,DR=1107.3,DA=DFN D EN^DIQ1 W:$D(^(DR)) ?53,^(DR) S DR=.03 D EN^DIQ1 W:$D(^(DR)) ?67,$J(^(DR),10)   ;IHS/SD/TPF AG*7.1*4
 K ^UTILITY("DIQ1",$J) S DIC=9000001,DR=1107.3,DA=DFN D EN^DIQ1 W:$D(^(DR)) ?53,^(DR) S DIC=2,DR=.03 D EN^DIQ1 W:$D(^(DR)) ?67,$J(^(DR),10) ;IHS/SD/TPF AG*7.1*5
 W ! S T=T+1 I $Y>AGBM D RTRN^AG G:$D(DUOUT)!$D(DTOUT)!$D(DFOUT) K D HDR
 G L3
END W !!,"Total Patients: ",T K AG("HAT") D RTRN^AG W $$S^AGVDF("IOF")
K D ^%ZISC K AG,AGIO,AGTIME,AGBM,DA,DFN,DIC,DR,G,AGUCI,AG("LOC"),AGNAME,AGPGPG,T,AG("USR"),X,Y D:$D(ZTQUEUED) KILL^%ZTLOAD
 Q
HDR S AGPGPG=AGPGPG+1 W $$S^AGVDF("IOF"),!!,AG("USR"),?71,"Page",$J(AGPGPG,4),!,AG("LOC"),!?19,"REGISTERED PATIENTS - ALPHABETICAL LISTING",!,AGUCI,!?23,"('*' = INACTIVE), ('D' = DECEASED)"
 W !!,AGTIME,!!!?18,"Name",?45,"IHS #",?57,"SSN",?71,"DOB",!,"----------------------------------------",?44,"------",?53,"-----------",?67,"------------",!
 Q