source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURCROP1.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.3 KB
Line 
1NURCROP1 ;HIRMFO/RM,RTK-RANK ORDER PRINT (CONT.) ;8/29/96
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3HEADER(PG) ; FUNCTION PRINTS HEADER FOR NEXT PAGE
4 ; FUNCTION VALUE IS THE NUMBER OF NEW PAGE, -1 IF ABNORMAL USER EXIT
5 N DIR,X,Y I PG>0,$E(IOST)="C" W ! D ENDPG^NURSUT1 I $G(NUROUT) S PG=-1 G RETURN
6 W:$E(IOST)="C"!(PG>1) @IOF
7 S PG=PG+1 W !,"RANK LISTING OF PATIENT PROBLEMS",?71,"PAGE",$J(PG,3)
8 I PG'<0 S Y=NURCBGDT\1 D DD^%DT W !,"From: ",Y S Y=NURCENDT\1 D DD^%DT W " to: ",Y W !!,"Rank Freq Problem" I NURCLID'="" W " Report Identifier: ",NURCLID
9 I PG'<0 W !,"=============================================================================="
10RETURN Q PG
11HDRINT() ; PRINTS HEADER FOR INTERVENTIONS UNDER A PROBLEM
12 ; FUNCTION VALUE IS 1 IF ABNORMAL USER END, ELSE 0
13 N WRT S WRT=1 I IOSL-8<$Y S NURCPAGE=$$HEADER(NURCPAGE) I NURCPAGE<0 S WRT=0
14 I WRT W !?5,"Rank Freq Intervention",!?5,"---- ---- ------------"
15 Q 'WRT
16WRTPROB(RANK,PROB,FREQ) ; WRITES OUT LINE FOR PROBLEM, CHECKS FOR HEADER PRINT
17 ; FUNCTION VALUE IS 1 IF ABNORMAL USER END, ELSE 0
18 N WRT S WRT=1 I IOSL-7<$Y S NURCPAGE=$$HEADER(NURCPAGE) I NURCPAGE<0 S WRT=0
19 I WRT W !!,$J(RANK,3),?5,$J(FREQ,4),?11,$P($G(^GMRD(124.2,+PROB,0)),"^")
20 Q 'WRT
21WRTORD(RANK,ORD,FREQ) ; WRITES OUT LINE FOR ORDERABLE, CHECKS FOR HDR PRINT
22 ; FUNCTION VALUE IS 1 IF ABNORMAL USER EXIT, ELSE 0
23 N WRT S WRT=1 I IOSL-6<$Y S NURCPAGE=$$HEADER(NURCPAGE) I NURCPAGE<0 S WRT=0
24 I WRT W !?5,$J(RANK,3),?10,$J(FREQ,4),?16,$P($G(^GMRD(124.2,+ORD,0)),"^")
25 Q 'WRT
26WRTOPT(BS5) ; WRITES OUT LINE FOR PATIENTS UNDER ORDERABLE, CHECKS FOR HDR
27 ; FUNCTION VALUE IS 1 IF ABNORMAL USER END, ELSE 0
28 N WRT S WRT=1 I IOM-8<$X S:IOSL-6<$Y NURCPAGE=$$HEADER(NURCPAGE) S:NURCPAGE<0 WRT=0 W:WRT !?20
29 I WRT W BS5,","
30 Q 'WRT
31WRTPPT(BS5) ; WRITES OUT LINE FOR PATIENTS UNDER PROBLEM, CHECKS FOR HDR
32 ; FUNCTION VALUE IS 1 IF ABNORMAL USER END, ELSE 0
33 N WRT S WRT=1 I IOM-8<$X S:IOSL-6<$Y NURCPAGE=$$HEADER(NURCPAGE) S:NURCPAGE<0 WRT=0 W:WRT !?15
34 I WRT W BS5,","
35 Q 'WRT
36ACTIVE(PR,NCP,BDT,EDT) ;
37 ; FUNCTION VALUE IS 0 IF THIS PROBLEM IS ACTIVE OVER DATE/TIME RANGE
38 ; BGD-EDT, ELSE VALUE IS 1
39 N ACTIVE,NNCP,X,Y S ACTIVE=1
40 S NNCP=$O(^NURSC(216.8,"B",NCP,0)) S:NNCP'>0!'$$PROBLEM(PR) ACTIVE=0
41 I ACTIVE S ACTIVE=0 F X=(9999999-EDT):0 S X=$O(^NURSC(216.8,NNCP,"EVAL","AA",PR,X)) Q:X'>0 S Y=$O(^NURSC(216.8,NNCP,"EVAL","AA",PR,X,0)) I Y S Y=$G(^NURSC(216.8,NNCP,"EVAL",Y,0)) S ACTIVE='(+Y<BDT&$P(Y,"^",4)) Q
42 Q ACTIVE
43PROBLEM(AGGY) ;
44 ; FUNCTION VALUE IS 1 IF AGGY HAS CLASS OF NURSING PROBLEM, ELSE
45 ; RETURNS 0.
46 N CLAS,PROBLEM S PROBLEM=1
47 S CLAS=$O(^GMRD(124.25,"AA","NURSC","NURSING PROBLEM",0)) S:'CLAS PROBLEM=0
48 I PROBLEM S PROBLEM=($P($G(^GMRD(124.2,AGGY,0)),"^",4)=CLAS)
49 Q PROBLEM
50GETTRM(PR,CLAS) ;
51 ; GETS FIRST TERM ENCOUNTERED IN TREE WITH PR AS ROOT WITH CLASS.=CLAS
52 N A,B,C,D,E
53 S A=PR,E=0 D RECUR1
54 Q E
55RECUR1 N D,B F B=0:0 S B=$O(^GMRD(124.2,A,1,B)) Q:B'>0 S C=+$G(^GMRD(124.2,A,1,B,0)) I '$P(C,"^",6),+C S D=$G(^GMRD(124.2,C,0)) S:$P(D,"^",4)=CLAS E=C Q:E S D=A,A=C D RECUR1 S A=D Q:E
56 Q
57GETLST(PR,CLAS) ; GETS LIST OF TERMS IN TREE WITH PR AS ROOT WITH CLASS.=CLAS
58 ; FUNCTION RETURNS 1 IF LIST NOT EMPTY, ELSE RETURNS 0.
59 N A,B,C,D K NURSLIST
60 S A=PR D RECUR
61 Q ''$D(NURSLIST)
62RECUR N D,B F B=0:0 S B=$O(^GMRD(124.2,A,1,B)) Q:B'>0 S C=+$G(^GMRD(124.2,A,1,B,0)) I '$P(C,"^",6),+C S D=$G(^GMRD(124.2,C,0)) S:$P(D,"^",4)=CLAS NURSLIST(C)="" S D=A,A=C D RECUR S A=D
63 Q
Note: See TracBrowser for help on using the repository browser.