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

AGALPHA1.m

Go to the documentation of this file.
AGALPHA1 ; IHS/ASDS/EFG - ALPHA LIST OF ALL 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^AGALPHA1",ZTUCI=Y,ZTDESC="ALPHA LIST, ALL PATIENTS"_"."
 D ^%ZTLOAD G:'$D(ZTSK) DEV K AG,AGIO,ZTDESC,ZTRTN,ZTSK,ZTUCI D ^%ZISC
 Q
L1 ;EP - From TaskMan.
 S (AGPGPG,AGNAME,AGTOT)=0,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,",",1) D CTR^AG S AGUCI=X D LINES^AG,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(^DPT(DFN,0)),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="" I $D(^AUPNPAT(DFN,41,DUZ(2),0)),$P(^AUPNPAT(DFN,41,DUZ(2),0),U,3)]"" S AG="*"
 D DEAD^AGMAN S AG=AG_$S($D(AG("DEAD")):"D",1:"") W:AG]"" "(",AG,")"
 ;K ^UTILITY("DIQ1",$J) 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,$J(^(DR),10)
 ;K ^UTILITY("DIQ1",$J) S DIC=9000001,DR=1107.3,DA=DFN D EN^DIQ1 W:$D(^(DR)) ?52,^(DR) S DR=.03 D EN^DIQ1 W:$D(^(DR)) ?66,$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)) ?52,^(DR) S DIC=2,DR=.03 D EN^DIQ1 W:$D(^(DR)) ?66,$J(^(DR),10)   ;IHS/SD/TPF AG*7.1*5
 W !
 F AG=1:1 S DIC=9000001.41,DA=DFN,AG("DRENT")=AG,DR=.02 D ^AGDICLK Q:$D(AG("LKERR"))  W ?20,$J(AG("LKPRINT"),6) S AG("DRENT")=AG,DR=.01 D ^AGDICLK W:'$D(AG("LKERR")) ?30,$P(^DIC(4,AG("LKPRINT"),0),U) W !
 S AGTOT=AGTOT+1 I $Y>AGBM D RTRN^AG G:$D(DUOUT)!$D(DTOUT)!$D(DFOUT) K D HDR
 G L3
END W !!,"Total Patients: ",AGTOT K AG("HAT") D RTRN^AG W @IOF
K D ^%ZISC K AG,AGIO,AGTIME,AGBM,DA,AG("DENT"),DFN,DIC,DR,G,AGL,AG("LKDATA"),AG("LKERR"),AG("LOC"),AGNAME,AGPGPG,AGTOT,AGUCI,AG("USR"),X,Y D:$D(ZTQUEUED) KILL^%ZTLOAD
 Q
HDR S AGPGPG=AGPGPG+1 W @IOF,!!,AG("USR"),?72,"page ",AGPGPG,!,AG("LOC"),!?23,"ALL PATIENTS - ALPHABETICAL LISTING",!,AGUCI,!?24,"('*' = INACTIVE), ('D' = DECEASED)",!,AGTIME,!
 W !!?3,"Name",?21,"IHS #",?30,"FACILITY",?56,"SSN",?70,"DOB",!!,AG("="),!
 Q