source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURCRL1.m@ 862

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

initial load of WorldVistAEHR

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