source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURCPPS2.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1NURCPPS2 ;HIRMFO/JH/RM-NURSING CARE PLAN DATABASE SEARCH part 2 ;4/17/92
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3 ;This is a Cont. of Patient Problem Listing, Data Processor:
4PROB ; PROCESS PROBLEM LIST NURSP=AGGY IEN
5 D STEVAL^NURCPPS4
6 S NURSK=0,NURSL=NURSP,NURSDA=$O(^GMR(124.3,GMRGPDA,1,"B",NURSP,0)) D:NURSDA>0 STAUD^NURCPPS4
7 I NURSPLN="C" S NURSI=$O(^TMP($J,"NURSDATE",NURSP,0)),NURSJ=$O(^(+NURSI,0)) I $D(^TMP($J,"NURSDATE",NURSP,+NURSI,+NURSJ)),"^R^S^U^"[("^"_$P(^(+NURSJ),"^",4)_"^") Q
8 F NURSC=0:0 S NURSC=$O(^GMRD(124.2,NURSP,1,"B",NURSC)) Q:NURSC'>0 D:$D(^GMRD(124.2,"AKID",NURSC,NURSP,0)) PROBCHIL
9 Q
10PROBCHIL ; PROCESS NURSP's CHILDREN
11 ; NURSP=AGGY IEN OF PROBLEM, NURSC=AGGY IEN OF CHILD
12 I NURSPLN="C" S NURSI=$O(^GMR(124.3,GMRGPDA,1,"B",NURSC,0)),NURSI=$O(^GMR(124.3,GMRGPDA,1,+NURSI,2,"AA",0)),NURSJ=$O(^(+NURSI,0)) Q:'NURSJ
13 S NURSCHIL=$S($D(^GMRD(124.2,NURSC,0)):^(0),1:"")
14 I '($P(NURSCHIL,"^",4)=NURSGCK!($P(NURSCHIL,"^",4)=NURSICK)) D NOGOIN^NURCPPS4 Q
15 S NURSA=0,NURSG(0)=NURSC
16PCR ;
17 S NURSA=NURSA+1
18 F NURSG(NURSA)=0:0 S NURSG(NURSA)=$O(^GMRD(124.2,NURSC,1,"B",NURSG(NURSA))) Q:NURSG(NURSA)'>0 D:$D(^GMRD(124.2,"AKID",NURSG(NURSA),NURSC,0)) GIPR
19 S NURSA=NURSA-1 S:NURSA NURSC=NURSG(NURSA-1)
20 Q
21GIPR ;
22 S X=$O(^GMRD(124.2,NURSC,1,"B",NURSG(NURSA),0)) Q:$P($G(^GMRD(124.2,NURSC,1,+X,0)),"^",6)!'$O(^GMR(124.3,GMRGPDA,1,$S(NURSPLN="A":"B",1:"ALIST"),NURSG(NURSA),0)) S NURSB(0)=$O(^GMR(124.3,GMRGPDA,1,"B",NURSG(NURSA),0)) Q:'NURSB(0)
23 S NURSA(1)=$S($D(^GMRD(124.2,+NURSG(NURSA),0)):^(0),1:1)
24 I NURSPLN="C",$P(NURSA(1),"^",4)=NURSGOCK S X=$O(^NURSC(216.8,NURSPOI,"TARG","AA",+NURSG(NURSA),0)),X=$O(^(+X,0)) I $P($G(^NURSC(216.8,NURSPOI,"TARG",+X,0)),"^",2) Q ;IF GOAL MET OR DC'D AND CURRENT REPORT, THEN DO NOT ADD TO SORT
25 I NURSPLN="C",$P(NURSA(1),"^",4)=NURSINCK S X=$O(^NURSC(216.8,NURSPOI,"ORD","AA",+NURSG(NURSA),0)),X=$O(^(+X,0)) I $P($G(^NURSC(216.8,NURSPOI,"ORD",+X,0)),"^",3) Q ;IF ORDER DC'D AND CURRENT REPORT, THEN DO NOT ADD TO SORT
26 I $P(NURSA(1),"^",4)=NURSGOCK!($P(NURSA(1),"^",4)=NURSINCK) S NURSG=NURSG(NURSA) D GOIN^NURCPPS4 Q
27 S NURSB=NURSA-1*3,GMRGXPRT=$P(NURSA(1),"^"),GMRGXPRT(0)=$S($D(^GMR(124.3,GMRGPDA,1,NURSB(0),0)):$P(^(0),"^",2),1:""),GMRGXPRT(1)="0^245^0^0^1" D EN1^GMRGRUT2
28 S:'$D(^TMP($J,"GMRGNAR",NURSG(0),NURSG(1),0)) ^(0)="0^0"
29 S NURSO(0)=^TMP($J,"GMRGNAR",NURSG(0),NURSG(1),0),NURSO=$P(NURSO(0),"^",2)+1,GMRGPLN="-"_$S($E(GMRGXPRT)'?1L:$E(GMRGXPRT),1:$C($A($E(GMRGXPRT))-32))_$E(GMRGXPRT,2,$L(GMRGXPRT)),GMRGLEN=IOM-NURSRM-NURSB+1
30 F NURSB(0)=0:1 D FITLINE^GMRGRUT1 S ^TMP($J,"GMRGNAR",NURSG(0),NURSG(1),NURSO)=$E(NURSSS,1,NURSB-1)_GMRGPLN(0),^(0)=NURSA_"^"_NURSO_"^"_NURSG(NURSA),NURSO=NURSO+1 Q:GMRGPLN(1)="" S GMRGPLN=" "_GMRGPLN(1),GMRGLEN=IOM-NURSRM-NURSB+1
31 S NURSC=NURSG(NURSA) D PCR
32 Q
Note: See TracBrowser for help on using the repository browser.