APCLNJ22 ; IHS/CMI/LAB - PRINT VISITS WITH INJURIES ;
;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
;
INIT ;initialize variables
S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
D ^APCLNJ23 K APCLSTOP,APCLPAGE
S APCLSTOP="",APCLPAGE=0 D HEAD
I '$G(APCLGTOT) W !,"No injury visits to report." G END
;
PRNT ;
;I $Y>(IOSL-8) D HEAD Q:APCLSTOP="^"
W !
;W !,"HOWDY DOODY",!
;W "GRAND TOTAL= ",APCLGTOT,!
S APCLZ=0
F S APCLZ=$O(APCLCNTR(APCLZ)) Q:APCLZ'=+APCLZ S APCLTEXT=$O(APCLCNTR(APCLZ,"")) D
. I $Y>(IOSL-2) D HEAD Q:APCLSTOP="^"
. W !,?5,APCLTEXT W ?40,$J(APCLCNTR(APCLZ,APCLTEXT),3,0) S APCLPER=(APCLCNTR(APCLZ,APCLTEXT)/APCLGTOT)*100 W ?50,$J(APCLPER,3,0)
. W ?65,$P(APCLCNTR(APCLZ,APCLTEXT),U,2)
W !,?39,"_____",?49,"_____",?63,"_____",!!
W !,?5,"TOTALS:",?41,APCLGTOT,?50,"100%",?65,APCLATOT,!
;W "ALCOHOL RELATED TOTAL = ",APCLATOT,!
G END
Q
HEAD I 'APCLPAGE G HEAD1
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLSTOP="^" Q
HEAD1 ;
W:$D(IOF) @IOF S APCLPAGE=APCLPAGE+1
W !
S X=$P(^DIC(4,DUZ(2),0),"^")
W !,$P(^VA(200,DUZ,0),"^",2),?(80-$L(X)/2),X,?72,"Page ",APCLPAGE,!
W !,?22,"INJURY SURVEILLANCE SUMMARY REPORT",!,?27,"(EXTERNAL CAUSE CODES)",!
W ?24,"Visits with Injury Diagnosis",!
W ?32,"Visit Dates: ",!,?24,APCLBDD," to ",APCLEDD
W !,?63,"CAUSE OF DX",!
W ?5,"EXTERNAL CAUSE CATEGORY SUMMARY",?38,"COUNT",?48,"% TOTAL",?60,"(ALCOHOL RELATED)"
W !,"--------------------------------------------------------------------------------"
Q
TIME NEW Y,%A,%B,%C S Y="" Q:'$D(X) Q:X<0!(X>86400)
S %A=X\60,%B=%A\60 S:%B>12 %B=%B-12 S:%B=0 %B=12 S:%B<10 %B=" "_%B
S %C=$S(%A=0:"M ",%A=720:"N ",%A=1440:"M ",%A<720:"am",1:"pm")
S Y=%B_":"_$E(%A#60+100,2,3)_" "_%C K %A,%B,%C Q
;
END ;
D DONE^APCLOSUT
K APCLGOT
Q
APCLNJ22 ; IHS/CMI/LAB - PRINT VISITS WITH INJURIES ;
+1 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
+2 ;
INIT ;initialize variables
+1 SET Y=APCLBD
DO DD^%DT
SET APCLBDD=Y
SET Y=APCLED
DO DD^%DT
SET APCLEDD=Y
+2 DO ^APCLNJ23
KILL APCLSTOP,APCLPAGE
+3 SET APCLSTOP=""
SET APCLPAGE=0
DO HEAD
+4 IF '$GET(APCLGTOT)
WRITE !,"No injury visits to report."
GOTO END
+5 ;
PRNT ;
+1 ;I $Y>(IOSL-8) D HEAD Q:APCLSTOP="^"
+2 WRITE !
+3 ;W !,"HOWDY DOODY",!
+4 ;W "GRAND TOTAL= ",APCLGTOT,!
+5 SET APCLZ=0
+6 FOR
SET APCLZ=$ORDER(APCLCNTR(APCLZ))
IF APCLZ'=+APCLZ
QUIT
SET APCLTEXT=$ORDER(APCLCNTR(APCLZ,""))
Begin DoDot:1
+7 IF $Y>(IOSL-2)
DO HEAD
IF APCLSTOP="^"
QUIT
+8 WRITE !,?5,APCLTEXT
WRITE ?40,$JUSTIFY(APCLCNTR(APCLZ,APCLTEXT),3,0)
SET APCLPER=(APCLCNTR(APCLZ,APCLTEXT)/APCLGTOT)*100
WRITE ?50,$JUSTIFY(APCLPER,3,0)
+9 WRITE ?65,$PIECE(APCLCNTR(APCLZ,APCLTEXT),U,2)
End DoDot:1
+10 WRITE !,?39,"_____",?49,"_____",?63,"_____",!!
+11 WRITE !,?5,"TOTALS:",?41,APCLGTOT,?50,"100%",?65,APCLATOT,!
+12 ;W "ALCOHOL RELATED TOTAL = ",APCLATOT,!
+13 GOTO END
+14 QUIT
HEAD IF 'APCLPAGE
GOTO HEAD1
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET APCLSTOP="^"
QUIT
HEAD1 ;
+1 IF $DATA(IOF)
WRITE @IOF
SET APCLPAGE=APCLPAGE+1
+2 WRITE !
+3 SET X=$PIECE(^DIC(4,DUZ(2),0),"^")
+4 WRITE !,$PIECE(^VA(200,DUZ,0),"^",2),?(80-$LENGTH(X)/2),X,?72,"Page ",APCLPAGE,!
+5 WRITE !,?22,"INJURY SURVEILLANCE SUMMARY REPORT",!,?27,"(EXTERNAL CAUSE CODES)",!
+6 WRITE ?24,"Visits with Injury Diagnosis",!
+7 WRITE ?32,"Visit Dates: ",!,?24,APCLBDD," to ",APCLEDD
+8 WRITE !,?63,"CAUSE OF DX",!
+9 WRITE ?5,"EXTERNAL CAUSE CATEGORY SUMMARY",?38,"COUNT",?48,"% TOTAL",?60,"(ALCOHOL RELATED)"
+10 WRITE !,"--------------------------------------------------------------------------------"
+11 QUIT
TIME NEW Y,%A,%B,%C
SET Y=""
IF '$DATA(X)
QUIT
IF X<0!(X>86400)
QUIT
+1 SET %A=X\60
SET %B=%A\60
IF %B>12
SET %B=%B-12
IF %B=0
SET %B=12
IF %B<10
SET %B=" "_%B
+2 SET %C=$SELECT(%A=0:"M ",%A=720:"N ",%A=1440:"M ",%A<720:"am",1:"pm")
+3 SET Y=%B_":"_$EXTRACT(%A#60+100,2,3)_" "_%C
KILL %A,%B,%C
QUIT
+4 ;
END ;
+1 DO DONE^APCLOSUT
+2 KILL APCLGOT
+3 QUIT