source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURAGEN2.m@ 868

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

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1NURAGEN2 ;HIRMFO/JH/MD-GENERIC REPORT GENERATOR FOR ADMIN. part 2 ;MAR 95
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3 ;This is a continuation of routine NURAGEN1.
4 ;
5F1 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC6,NURSX,NURSORT)=""
6 Q
7F2 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NPC7,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC7,NURSX,NURSORT)=""
8 Q
9F3 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC6,NPC4,NURSX)=""
10 Q
11F4 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NPC7,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC7,NPC5,NURSX)=""
12 Q
13F5 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NPC7,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC7,NURSX,NURSORT)=""
14 Q
15F6 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NPC7,NPC8,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC8,NURSX,NURSORT)=""
16 Q
17F7 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC5,NURSX,NURSORT)=""
18 Q
19F8 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC6,NURSX,NURSORT)=""
20 Q
21F9 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC5,NPC3,NURSX)=""
22 Q
23F10 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC6,NPC4,NURSX)=""
24 Q
25F11 S NURSORT=$G(^TMP($J,"L",NURFAC,NURPROG,NPC2,NPC3,NPC4)),NURSX=0 I NURSORT F S NURSX=$O(^TMP($J,"L1",NURSORT,NPC5,NPC6,NPC7,NURSX)) Q:NURSX'>0 S ^TMP("NURA",$J,NURFAC,NURPROG,NPC7,NURSX,NURSORT)=""
26 Q
27NURA ;SET ^TMP("NURA",$J) FOR PERSON AND ASSIGNMENT COUNT
28 K ^TMP("NURA",$J) S (NURSORT,NURSORT(1))=0
29 F S NURSORT=$O(^TMP($J,"L1",NURSORT)) Q:NURSORT'>0 S N="" F S N=$O(^TMP($J,"L1",NURSORT,N)) Q:N="" S N(1)="" F S N(1)=$O(^TMP($J,"L1",NURSORT,N,N(1))) Q:N(1)="" S N(2)="" F S N(2)=$O(^TMP($J,"L1",NURSORT,N,N(1),N(2))) Q:N(2)="" D
30 .I NURSORT(2)>2 S N(3)="" F S N(3)=$O(^TMP($J,"L1",NURSORT,N,N(1),N(2),N(3))) Q:N(3)="" D
31 ..I NURSORT(2)=3 D GLOB
32 ..S N(4)="" F S N(4)=$O(^TMP($J,"L1",NURSORT,N,N(1),N(2),N(3),N(4))) Q:N(4)="" D
33 ...I NURSORT(2)=4 D GLOB
34 ...E S N(5)="" F S N(5)=$O(^TMP($J,"L1",NURSORT,N,N(1),N(2),N(3),N(4),N(5))) Q:N(5)="" D GLOB
35 .I NURSORT(2)=2 D GLOB
36 K N Q
37GLOB ;S ^TMP("NURA",$J) FOR ASSIGNMENT AND PERSON COUNTS
38 I NURROU=7!(NURROU=18) S ^TMP("NURA",$J,@NURSORT(3),N(3)_"-"_N(4))="" Q
39 I NURROU=8 S ^TMP("NURA",$J,@NURSORT(3),N(4)_"-"_N(5))="" Q
40 I NURROU=17 S ^TMP("NURA",$J,@NURSORT(3),N(2)_"-"_N(3))="" Q
41 S NURSORT(1)=NURSORT(1)+1,^TMP("NURA",$J," BLANK"," BLANK",@NURSORT(3),NURSORT(1),NURSORT)=""
42 Q
43GENDER ;TOTAL COUNTS FOR GENDER REPORTS
44 K ^TMP("NURA",$J) S NURFAC="" F S NURFAC=$O(^TMP($J,"L",NURFAC)) Q:NURFAC="" S NURPROG="" F S NURPROG=$O(^TMP($J,"L",NURFAC,NURPROG)) Q:NURPROG="" S NL="" F S NL=$O(^TMP($J,"L",NURFAC,NURPROG,NL)) Q:NL="" D
45 . S NL(1)="" F S NL(1)=$O(^TMP($J,"L",NURFAC,NURPROG,NL,NL(1))) Q:NL(1)="" S NL(2)="" F S NL(2)=$O(^TMP($J,"L",NURFAC,NURPROG,NL,NL(1),NL(2))) Q:NL(2)="" S NURSORT=^TMP($J,"L",NURFAC,NURPROG,NL,NL(1),NL(2)) D:NURSORT L1
46 Q
47L1 S NL1="" F S NL1=$O(^TMP($J,"L1",NURSORT,NL1)) Q:NL1="" S NL1(1)="" F S NL1(1)=$O(^TMP($J,"L1",NURSORT,NL1,NL1(1))) Q:NL1(1)="" S NL1(2)="" F S NL1(2)=$O(^TMP($J,"L1",NURSORT,NL1,NL1(1),NL1(2))) Q:NL1(2)="" D
48 .I NURSORT(2)=3 S NL1(3)="" F S NL1(3)=$O(^TMP($J,"L1",NURSORT,NL1,NL1(1),NL1(2),NL1(3))) Q:NL1(3)="" D GLOB1
49 .E D GLOB1
50 Q
51GLOB1 S NURSORT(1)=NURSORT(1)+1,^TMP("NURA",$J,@NURSORT(3),@NURSORT(4),NURSORT(1))=""
52 Q
Note: See TracBrowser for help on using the repository browser.