source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURARPC2.m@ 1259

Last change on this file since 1259 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1NURARPC2 ;HIRMFO/MD-CONTINUATION OF DRIVER TO PRINT AMIS 1106 ACUITY REPORTS ;5/9/97
2 ;;4.0;NURSING SERVICE;**1**;Apr 25, 1997
3 U IO D PRINTRPT
4 Q
5HEADER ; HEADINGS
6 I $E(IOST)="C",'NURMDSW(1) D ENDPG^NURSUT1 Q:NUROUT
7 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:"")
8 I $D(NDATED),+NDATED?7N S:'$D(NURTYPE) NURTYPE=0 S NURSHDR=$S(NURTYPE=0:"AMIS ",1:"Midnight Acuity ")_"Daily Report for "_HDRDT
9 S NURMDSW(1)=0,NURPAGE=NURPAGE+1 S Y=DT D:+Y D^DIQ W:$E(IOST)="C"!(NURPAGE>1) @IOF
10 S NURSHDR(1)="Report 10-1106 Segment 200",NURSHDR(2)="Cumulative Daily Patient Classification Data"
11 I NURMDSW,NHOSPSW,$G(NURFAC(2))'="",'$G(NURSUMSW) W ?$$CNTR^NURSUT2(NURFAC(2)),$S(NURFAC(2)=" BLANK":"NO FACILITY",1:NURFAC(2))
12 W !!,Y,?(80-$L(NURSHDR(1)))\2,NURSHDR(1),?70,"PAGE: ",NURPAGE,!,?(80-$L(NURSHDR(2)))\2,NURSHDR(2),!,?(80-$L(NURSHDR))\2,NURSHDR,!
13 Q
14HEADER1 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."
15 Q
16PRINTRPT ; PRINT REPORT
17 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
18 Q
19L0 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
20 Q
21L1 S NF1="" F S NF1=$O(^TMP($J,HDATE(1),NURFAC(2),NF1)) Q:NF1="" D L2 Q:NUROUT D BRK Q:NUROUT
22 Q
23L2 S NF2="" F S NF2=$O(^TMP($J,HDATE(1),NURFAC(2),NF1,NF2)) Q:NF2="" D WRITE Q:NUROUT
24 Q
25WRITE I NURMDSW(1)!($Y>(IOSL-6)) D HEADER Q:NUROUT D HEADER1
26 S NDATA=^TMP($J,HDATE(1),NURFAC(2),NF1,NF2)
27 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)
28 G:$G(NURSUMSW) D
29 I NURMDSW(2),NURSTYPE="U" W !,"WARD: ",$S(NBDSECT="":NF1,1:NF2) G B
30 I NURMDSW(2) W !,"BED SECTION: ",NF1
31B I NURSTYPE="B" W !,?6,NF2 G C
32 W !,?6,$S(NBDSECT="":NF2,1:NF1)
33C 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)
34D 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
35 Q
36BRK ; UNIT TOTALS
37 G:$G(NURSUMSW) E
38 I $Y>(IOSL-6) D HEADER Q:NUROUT D HEADER1
39 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),!
40E 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
41 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
42 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
43 S NURMDSW(2)=1,(NTC(1),NTC(2),NTC(3),NTC(4),NTC(5),NTCEN)=0
44 Q
45BRK1 ; DATE TOTALS
46 I $Y>(IOSL-6) D HEADER Q:NUROUT D HEADER1
47 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),!
48 S NURMDSW(2)=1,(DTC(1),DTC(2),DTC(3),DTC(4),DTC(5),DTCEN)=0
49 Q
50BRK2 ; FACILITY TOTALS
51 I $Y>(IOSL-6) D HEADER Q:NUROUT D HEADER1
52 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),!
53 S NURMDSW(2)=1,(NFTC(1),NFTC(2),NFTC(3),NFTC(4),NFTC(5),NFTCEN)=0
54 Q
Note: See TracBrowser for help on using the repository browser.