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

NURARPC2.m

Go to the documentation of this file.
NURARPC2 ;HIRMFO/MD-CONTINUATION OF DRIVER TO PRINT AMIS 1106 ACUITY REPORTS ;5/9/97
 ;;4.0;NURSING SERVICE;**1**;Apr 25, 1997
 U IO D PRINTRPT
 Q
 I $E(IOST)="C",'NURMDSW(1) D ENDPG^NURSUT1 Q:NUROUT
 S HDRDT=$S(+NDATED'=$P(NDATED,U,2):"FROM ",1:"")_$E(+NDATED,4,5)_"/"_$E(+NDATED,6,7)_"/"_$E(+NDATED,2,3)_$S(+NDATED'=$P(NDATED,U,2):" - "_$E($P(NDATED,U,2),4,5)_"/"_$E($P(NDATED,U,2),6,7)_"/"_$E($P(NDATED,U,2),2,3),1:"")
 I $D(NDATED),+NDATED?7N S:'$D(NURTYPE) NURTYPE=0 S NURSHDR=$S(NURTYPE=0:"AMIS ",1:"Midnight Acuity ")_"Daily Report for "_HDRDT
 S NURMDSW(1)=0,NURPAGE=NURPAGE+1 S Y=DT D:+Y D^DIQ W:$E(IOST)="C"!(NURPAGE>1) @IOF
 S NURSHDR(1)="Report 10-1106 Segment 200",NURSHDR(2)="Cumulative Daily Patient Classification Data"
 I NURMDSW,NHOSPSW,$G(NURFAC(2))'="",'$G(NURSUMSW) W ?$$CNTR^NURSUT2(NURFAC(2)),$S(NURFAC(2)="  BLANK":"NO FACILITY",1:NURFAC(2))
 W !!,Y,?(80-$L(NURSHDR(1)))\2,NURSHDR(1),?70,"PAGE: ",NURPAGE,!,?(80-$L(NURSHDR(2)))\2,NURSHDR(2),!,?(80-$L(NURSHDR))\2,NURSHDR,!
 Q
HEADER1 W !,?72,"PATIENT",! W:$G(HDATE(1))?7N&'($G(NURSUMSW)) "Date: ",$E(HDATE(1),4,5)_"/"_$E(HDATE(1),6,7)_"/"_$E(HDATE(1),2,3) W ?22,"CATEGORY      I      II     III      IV       V   CLASS."
 Q
PRINTRPT ; PRINT REPORT
 S HDATE(1)=0 F  S HDATE(1)=$O(^TMP($J,HDATE(1))) Q:HDATE(1)'>0  D:'NURMDSW HEADER Q:NUROUT  D:'NURMDSW HEADER1 D L0 Q:NUROUT  I NHOSPSW D BRK1 Q:NUROUT
 Q
L0 S NURFAC(2)="" F  S NURFAC(2)=$O(^TMP($J,HDATE(1),NURFAC(2))) Q:NURFAC(2)=""  D:NURMDSW&'($G(NURSUMSW)) HEADER Q:NUROUT  D:NURMDSW&'($G(NURSUMSW)) HEADER1 D L1 Q:NUROUT  I NHOSPSW,NURMDSW D BRK2 Q:NUROUT
 Q
L1 S NF1="" F  S NF1=$O(^TMP($J,HDATE(1),NURFAC(2),NF1)) Q:NF1=""  D L2 Q:NUROUT  D BRK Q:NUROUT
 Q
L2 S NF2="" F  S NF2=$O(^TMP($J,HDATE(1),NURFAC(2),NF1,NF2)) Q:NF2=""  D WRITE Q:NUROUT
 Q
WRITE I NURMDSW(1)!($Y>(IOSL-6)) D HEADER Q:NUROUT  D HEADER1
 S NDATA=^TMP($J,HDATE(1),NURFAC(2),NF1,NF2)
 S NC(1)=+$P(NDATA,U),NC(2)=+$P(NDATA,U,2),NC(3)=+$P(NDATA,U,3),NC(4)=+$P(NDATA,U,4),NC(5)=+$P(NDATA,U,5) S NCEN=0,NCEN=NCEN+NC(1)+NC(2)+NC(3)+NC(4)+NC(5)
 G:$G(NURSUMSW) D
 I NURMDSW(2),NURSTYPE="U" W !,"WARD: ",$S(NBDSECT="":NF1,1:NF2) G B
 I NURMDSW(2) W !,"BED SECTION: ",NF1
B I NURSTYPE="B" W !,?6,NF2 G C
 W !,?6,$S(NBDSECT="":NF2,1:NF1)
C W ?34,$J(NC(1),3),?42,$J(NC(2),3),?50,$J(NC(3),3),?58,$J(NC(4),3),?66,$J(NC(5),3),?74,$J(NCEN,3)
D S NTC(1)=NTC(1)+NC(1),NTC(2)=NTC(2)+NC(2),NTC(3)=NTC(3)+NC(3),NTC(4)=NTC(4)+NC(4),NTC(5)=NTC(5)+NC(5),NTCEN=NTCEN+NCEN,NURMDSW(2)=0
 Q
BRK ; UNIT TOTALS
 G:$G(NURSUMSW) E
 I $Y>(IOSL-6) D HEADER Q:NUROUT  D HEADER1
 W !,?34,"---     ---     ---     ---     ---     ---",!,$S(+NHOSPSW:"SUBTOTAL ",1:"TOTAL"),?34,$J(NTC(1),3),?42,$J(NTC(2),3),?50,$J(NTC(3),3),?58,$J(NTC(4),3),?66,$J(NTC(5),3),?74,$J(NTCEN,3),!
E S DTC(1)=DTC(1)+NTC(1),DTC(2)=DTC(2)+NTC(2),DTC(3)=DTC(3)+NTC(3),DTC(4)=DTC(4)+NTC(4),DTC(5)=DTC(5)+NTC(5),DTCEN=DTCEN+NTCEN
 S NFTC(1)=NFTC(1)+NTC(1),NFTC(2)=NFTC(2)+NTC(2),NFTC(3)=NFTC(3)+NTC(3),NFTC(4)=NFTC(4)+NTC(4),NFTC(5)=NFTC(5)+NTC(5),NFTCEN=NFTCEN+NTCEN
 S NFC(1)=NFC(1)+NTC(1),NFC(2)=NFC(2)+NTC(2),NFC(3)=NFC(3)+NTC(3),NFC(4)=NFC(4)+NTC(4),NFC(5)=NFC(5)+NTC(5),NFCEN=NFCEN+NTCEN
 S NURMDSW(2)=1,(NTC(1),NTC(2),NTC(3),NTC(4),NTC(5),NTCEN)=0
 Q
BRK1 ; DATE TOTALS
 I $Y>(IOSL-6) D HEADER Q:NUROUT  D HEADER1
 W !,?34,"---     ---     ---     ---     ---     ---",!,$E(HDATE(1),4,5)_"/"_$E(HDATE(1),6,7)_"/"_$E(HDATE(1),2,3)," TOTAL",?34,$J(DTC(1),3),?42,$J(DTC(2),3),?50,$J(DTC(3),3),?58,$J(DTC(4),3),?66,$J(DTC(5),3),?74,$J(DTCEN,3),!
 S NURMDSW(2)=1,(DTC(1),DTC(2),DTC(3),DTC(4),DTC(5),DTCEN)=0
 Q
BRK2 ; FACILITY TOTALS
 I $Y>(IOSL-6) D HEADER Q:NUROUT  D HEADER1
 W !,?34,"---     ---     ---     ---     ---     ---",!,NURFAC(2)," TOTALS",?33,$J(NFTC(1),4),?41,$J(NFTC(2),4),?49,$J(NFTC(3),4),?57,$J(NFTC(4),4),?65,$J(NFTC(5),4),?73,$J(NFTCEN,4),!
 S NURMDSW(2)=1,(NFTC(1),NFTC(2),NFTC(3),NFTC(4),NFTC(5),NFTCEN)=0
 Q