source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURAGEN.m@ 1087

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

initial load of WorldVistAEHR

File size: 4.9 KB
RevLine 
[613]1NURAGEN ;HIRMFO/JH,FT,MD-GENERIC REPORT GENERATOR FOR ADMIN. part 1 ;4/30/97
2 ;;4.0;NURSING SERVICE;**1,13**;Apr 25, 1997
3 ;LAST MODIFIED BY MD; MAR 95
4 ;There are (2) segments of this print module which services 10 Routines
5 ; A9A1,A9E1,A9F1,A9H1,A9J1
6 ; A6A1,A6E1,A6F1,A6H1,A6J1
7 ;
8PRINT ; PRINT MODULE
9 D:$G(NURSUMSW)!'(NURMDSW) HEADER S (NPR0,NPR1,NPR2,NPR3,NPR4,NPR5,NPR6,NPC6,NPC7,NPC8,NX)="" D N
10 K X,Y,NURLINE,NPC1,NPC2,NPC3,NPC4,NPC5,NPC6,NPC7,NPC8,NPR0,NPR1,NPR2,NPR3,NPR4,NPR5,NPR6,NNURSX,NURAROU,NURSLEV,NURSSP
11 Q
12N S NURFAC="" F S NURFAC=$O(^TMP($J,"L",NURFAC)) Q:NURFAC=""!(NURQUIT) D:$G(NURMDSW)&'$G(NURSUMSW) HEADER D P Q:$G(NURQUIT) D:NURMDSW FSUBTL^NURAGEN1 Q:NURQUIT
13 Q
14P S NURPROG="" F S NURPROG=$O(^TMP($J,"L",NURFAC,NURPROG)) Q:NURPROG=""!(NURQUIT) D PROD,P0 Q:$G(NURQUIT) I NURPLSW,'$G(NURSUMSW) D PSUBTL^NURAGEN1 Q:NURQUIT
15 Q
16P0 S NPC2="" F S NPC2=$O(^TMP($J,"L",NURFAC,NURPROG,NPC2)) Q:NPC2="" D P1 Q:NURQUIT I '$G(NURSUMSW),$G(NURPLSW) D HEADER Q:NURQUIT
17 Q
18P1 S NPC3="" F S NPC3=$O(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3)) Q:NPC3="" S:NURSLEV=3 NPC1=0 D P2 Q:NURQUIT
19 Q
20P2 S NPC4="" F S NPC4=$O(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)) Q:NPC4="" S:NURSLEV=4 NPC1=0 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)) I NURSORT D P3 Q:NURQUIT
21 Q
22P3 S NPC5="" F S NPC5=$O(^TMP($J,"L1",NURSORT,NPC5)) Q:NPC5="" S:NURSLEV=5 NPC1=0 D P4:NURSLEV>3 Q:NURQUIT D PRINT1:NURSLEV=3
23 Q
24P4 S NPC6="" F S NPC6=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6)) Q:NPC6="" S:NURSLEV=6 NPC1=0 D P5:NURSLEV>4 Q:NURQUIT D PRINT1:NURSLEV=4
25 Q
26P5 S NPC7="" F S NPC7=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NPC7)) Q:NPC7="" D P6:NURSLEV>5 Q:NURQUIT D PRINT1:NURSLEV=5
27 Q
28P6 I NURSLEV<7 S NPC8="" F S NPC8=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NPC7,NPC8)) Q:NPC8=""!NURQUIT D PRINT1
29 Q
30 ; DETAIL LINE PRINT ROUTINE
31PRINT1 I ($Y>(IOSL-6)) D HEADER Q:NURQUIT
32 D ENT1^NURAGEN1
33 S NURSW1=1 W:NPC1=0&'($G(NURSUMSW)) ! S NPC1=NPC1+1 I NURROU=2!(NURROU=6)!(NURROU=10)!(NURROU=12)!(NURROU=16)!(NURROU=20) D PRI4 Q
34 D PRI1:(NURROU>0&(NURROU<7))!(NURROU=9)!(NURROU=10),PRI2:(NURROU=7)!(NURROU=8)!(NURROU=17),PRI3:(NURROU>10&(NURROU<17))!(NURROU>18&(NURROU<21)),PRI5:NURROU=18
35 Q
36PRI1 W !,NPC1,?6,$E(NPR2,1,10),?17,$E(NPR3,1,10),?28,$E(NPR5,1,20),?52,NPR4
37 Q
38PRI2 I NURROU=7!(NURROU=8) W !,NPC1,?6,$E(NPR2,1,10),?17,NPR3,?28,$E(NPR6,1,20),?50,NPR4,?65,NPR5 Q
39 W:'$G(NURSUMSW) !,NPC1,?6,$E(NPR2,1,10),?17,$E(NPR5,1,20),?40,NPR3,?59,NPR4
40 Q
41PRI3 W:'$G(NURSUMSW) !,NPC1,?10,$E(NPR2,1,10),?23,$E(NPR4,1,20),?49,NPR3 ;ROU= 11 - 16
42 Q
43PRI4 I NURROU=2!(NURROU=6)!(NURROU=10) W !,NPC1,?6,$S(NPC2'=" BLANK":$E(NPC2,1,10),1:""),?17,$S(NPC4'=" BLANK":NPC4,1:""),?28,$S(NPC6'=" BLANK":$E(NPC6,1,20),1:""),?52,$S(NPC5'=" BLANK":NPC5,1:"") Q
44 W:'$G(NURSUMSW) !,NPC1,?6,$S(NPC3'=" BLANK":$E(NPC3,1,10),1:""),?17,$S(NPC5'=" BLANK":$E(NPC5,1,20),1:""),?48,$S(NPC4'=" BLANK":NPC4,1:"")
45 Q
46PRI5 W:'$G(NURSUMSW) !,NPC1,?6,$E(NPR2,1,10),?17,$E(NPR5,1,20),?45,NPR3,?61,NPR4 ;6H2
47 Q
48HEADER ; HEADING SELECTION FOR GENERIC PRINT ROUTINES
49 S NX="" I (NURROU=12!(NURROU=14)!(NURROU=16)!(NURROU=18)!(NURROU=20)),'NURMDSW,'NURQUEUE,$E(IOST)="C",NURSW1,$Y<(IOSL-6) G NEXT1
50 I 'NURQUEUE,$E(IOST)="C",NURSW1 D ENDPG Q:$G(NURQUIT)
51NEXT1 I (NURROU=12!(NURROU=14)!(NURROU=16)!(NURROU=18)!(NURROU=20)),'NURMDSW,$Y<(IOSL-6),NURSW1 G NEXTL
52 S NURPAGE=NURPAGE+1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
53 I NURMDSW,'$G(NURSUMSW),$L($G(NURFAC))>1 W ?$$CNTR^NURSUT2(NURFAC),$$FACL^NURSUT2($G(NURFAC))
54 W !,NURSTIL S X="T" D ^%DT D:+Y D^DIQ W ?56,Y,?72,"PAGE: ",NURPAGE
55 W !!,NURSTIL1,!,NURSTIL2,!,$$REPEAT^XLFSTR("-",80) Q:'NURSW1
56PROD I $G(NURPLSW),$L(NURPROG)>1,'$G(NURSUMSW) N Z S Z=$$PROD^NURSUT2($G(NURPROG)) W:$G(Z)'="" !!,?$$CNTR^NURSUT2(NURPROG),$G(Z),!,?$$CNTR^NURSUT2(NURPROG),$$REPEAT^XLFSTR("-",$L(Z)+1)
57NEXTL S:NX="T" NURQUIT=1
58 Q
59NODATA ;
60 I $O(^TMP($J,""))="",'$D(NURSNLOC) S NUROUT=1 S NURPROG=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:"") D HEADER W !!,"THERE IS NO DATA FOR THIS REPORT"
61 I $O(^TMP($J,""))="",$D(NURSNLOC) S NUROUT=1 S NURPROG=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:"") D HEADER S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" D NODATA^NURSUT1
62 I $O(^TMP($J,""))'="",$D(NURSNLOC) D I NURSW1=1 D ENDPG^NURSUT1 S NURSW1=0
63 . S (NURY,NURZ,NURX)="" F S NURY=$O(^TMP($J,"L",NURY)) Q:NURY="" F S NURZ=$O(^TMP($J,"L",NURY,NURZ)) Q:NURZ="" F S NURX=$O(^TMP($J,"L",NURY,NURZ,NURX)) Q:NURX="" S ^TMP("NURLOC",$J,NURX)=""
64 . S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" I '$D(^TMP("NURLOC",$J,NL1)) D
65 . . S NURPROG=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:"") D:NURSW1=0 HEADER S NURSW1=1 D NODATA^NURSUT1
66 . . Q
67 . Q
68 Q
69CLOSE ; CLOSE DEVICE
70 W ! I '$G(NURQUIT) D ENDPG
71 D ^%ZISC
72 I $D(ZTQUEUED) S ZTREQ="@"
73 Q
74ENDPG ; HANDLE EOP
75 I $E(IOST)'="C"!($G(NURQUIT)) Q
76 W $C(7),!!,"Press return to continue, ""T"" for totals, or ""^"" to exit: " R NX:DTIME
77 S NX=$$UP^XLFSTR(NX)
78 I '$T!(NX=U) S (NURQUIT,NUROUT)=1
79 Q
Note: See TracBrowser for help on using the repository browser.