AGRSSN1A ; IHS/ASDS/EFG - SSN Statistical Report - CONT FEB 6,1995 ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
WRT ;EP
S IOP=AG("IOP")_";80",AG("PG")=0 D ^%ZIS U IO
D HD
S AG("LOC")=0 F AG("I")=1:1 S AG("LOC")=$O(^TMP("AG-SSN1",$J,AG("LOC"))) Q:AG("LOC")="" D BODY
I AG("I")>2 S AG("LOC")=0 D BODY
G XIT
BODY I $Y>(IOSL-7),IO=IO(0),$E(IOST)="C" S DIR(0)="E" D ^DIR Q:$D(DTOUT)!$D(DUOUT)!$D(DIROUT) D HD
I $Y>(IOSL-7) D HD
D LOC
W !,"Age Distributions..: 0-9 10-19 20-29 30-39 40-49 50-59 60-Over Total "
I AG("LOC")'=0 W !," ----- ----- ----- ----- ----- ----- ------- -------"
E W !," ===== ===== ===== ===== ===== ===== ======= ======="
W !,"Patients with SSN..:"
S AG("T")=0 F X=1:1:7 W $J($FN($P(^TMP("AG-SSN1",$J,AG("LOC"),0),U,X),",",0),$S(X=7:9,1:7)) S AG("T")=AG("T")+$P(^(0),U,X)
W ?73,$J($FN(AG("T"),","),7)
W !,"Total Patients.....:"
S AG("T")=0 F X=8:1:14 W $J($FN($P(^TMP("AG-SSN1",$J,AG("LOC"),0),U,X),",",0),$S(X=14:9,1:7)) S AG("T")=AG("T")+$P(^(0),U,X)
W ?73,$J($FN(AG("T"),","),7)
W !,"Percent Compliance.:"
S (AG("TT"),AG("CT"))=0 F X=1:1:7 S AG("C")=$P(^TMP("AG-SSN1",$J,AG("LOC"),0),U,X),AG("T")=$P(^(0),U,X+7) W $J($S('+AG("T"):0,1:AG("C")/AG("T")*100),$S(X=7:9,1:7),0) S AG("TT")=AG("TT")+$P(^(0),U,X+7),AG("CT")=AG("CT")+$P(^(0),U,X)
W ?73,$J($S(+AG("TT")=0:0,1:AG("CT")/AG("TT")*100),7,0)
Q
;
HD W $$S^AGVDF("IOF") S AG("PG")=AG("PG")+1
W !,AG("HD"),?60 S Y=DT D DD^%DT W Y,?73,"Page ",AG("PG")
W:$D(AG("HD",1)) !,AG("HD",1)
W:$D(AG("HD",2)) !,AG("HD",2)
W !,"--------------------------------------------------------------------------------"
Q
LOC W !! I AG("LOC")=0 W "********************************* TOTALS **********************************"
E W "LOCATION: ",AG("LOC")
Q
XIT Q
AGRSSN1A ; IHS/ASDS/EFG - SSN Statistical Report - CONT FEB 6,1995 ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
WRT ;EP
+1 SET IOP=AG("IOP")_";80"
SET AG("PG")=0
DO ^%ZIS
USE IO
+2 DO HD
+3 SET AG("LOC")=0
FOR AG("I")=1:1
SET AG("LOC")=$ORDER(^TMP("AG-SSN1",$JOB,AG("LOC")))
IF AG("LOC")=""
QUIT
DO BODY
+4 IF AG("I")>2
SET AG("LOC")=0
DO BODY
+5 GOTO XIT
BODY IF $Y>(IOSL-7)
IF IO=IO(0)
IF $EXTRACT(IOST)="C"
SET DIR(0)="E"
DO ^DIR
IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT
DO HD
+1 IF $Y>(IOSL-7)
DO HD
+2 DO LOC
+3 WRITE !,"Age Distributions..: 0-9 10-19 20-29 30-39 40-49 50-59 60-Over Total "
+4 IF AG("LOC")'=0
WRITE !," ----- ----- ----- ----- ----- ----- ------- -------"
+5 IF '$TEST
WRITE !," ===== ===== ===== ===== ===== ===== ======= ======="
+6 WRITE !,"Patients with SSN..:"
+7 SET AG("T")=0
FOR X=1:1:7
WRITE $JUSTIFY($FNUMBER($PIECE(^TMP("AG-SSN1",$JOB,AG("LOC"),0),U,X),",",0),$SELECT(X=7:9,1:7))
SET AG("T")=AG("T")+$PIECE(^(0),U,X)
+8 WRITE ?73,$JUSTIFY($FNUMBER(AG("T"),","),7)
+9 WRITE !,"Total Patients.....:"
+10 SET AG("T")=0
FOR X=8:1:14
WRITE $JUSTIFY($FNUMBER($PIECE(^TMP("AG-SSN1",$JOB,AG("LOC"),0),U,X),",",0),$SELECT(X=14:9,1:7))
SET AG("T")=AG("T")+$PIECE(^(0),U,X)
+11 WRITE ?73,$JUSTIFY($FNUMBER(AG("T"),","),7)
+12 WRITE !,"Percent Compliance.:"
+13 SET (AG("TT"),AG("CT"))=0
FOR X=1:1:7
SET AG("C")=$PIECE(^TMP("AG-SSN1",$JOB,AG("LOC"),0),U,X)
SET AG("T")=$PIECE(^(0),U,X+7)
WRITE $JUSTIFY($SELECT('+AG("T"):0,1:AG("C")/AG("T")*100),$SELECT(X=7:9,1:7),0)
SET AG("TT")=AG("TT")+$PIECE(^(0),U,X+7)
SET AG("CT")=AG("CT")+$PIECE(^(0),U,X)
+14 WRITE ?73,$JUSTIFY($SELECT(+AG("TT")=0:0,1:AG("CT")/AG("TT")*100),7,0)
+15 QUIT
+16 ;
HD WRITE $$S^AGVDF("IOF")
SET AG("PG")=AG("PG")+1
+1 WRITE !,AG("HD"),?60
SET Y=DT
DO DD^%DT
WRITE Y,?73,"Page ",AG("PG")
+2 IF $DATA(AG("HD",1))
WRITE !,AG("HD",1)
+3 IF $DATA(AG("HD",2))
WRITE !,AG("HD",2)
+4 WRITE !,"--------------------------------------------------------------------------------"
+5 QUIT
LOC WRITE !!
IF AG("LOC")=0
WRITE "********************************* TOTALS **********************************"
+1 IF '$TEST
WRITE "LOCATION: ",AG("LOC")
+2 QUIT
XIT QUIT