source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURCPP8.m@ 623

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1NURCPP8 ;HIRMFO/JH/RM-NURSING CARE PLAN DATA OUTPUT - PRINT ;4/29/93
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3 ; This is the Patient Problem Listing,Data Processor,Output Routine
4 ; 132 Col. Compressed print
5X ; SET UTILITY GLOBAL
6 ; NURS=TEXT TO BE ADDED,NURS(0)=$S(0:PROBLEM,1:GOAL,2:INTERVENTION)
7 ; NURS(1)=LINE IN ^TMP TO BE ADDED
8 ; THE VARIABLE NURS WILL BE KILLED
9 S NURS("OLD")=$S($D(^TMP($J,"NURSDATA",NURS(1))):^(NURS(1)),1:"")
10 F NURS(2)=1:1:5 S NURS("OLD")=$P(NURS("OLD"),"|",1,NURS(2)-1)_$S(NURS(2)=1:"",1:"|")_$E($P(NURS("OLD"),"|",NURS(2))_NURSSS,1,$S(NURS(2)=1:13,NURS(2)=2!(NURS(2)=5):29,NURS(2)=3:28,NURS(2)=4:14,1:14))_"|"_$P(NURS("OLD"),"|",NURS(2)+1,5)
11 I NURS(0)=0 S NURS("NEW")=$E($P(NURS,"|")_$E(NURSSS,1,13),1,13)_"|"_$E($P(NURS,"|",2)_$E(NURSSS,1,29),1,29)_"|"_$E(NURS("OLD"),45,$L(NURS("OLD")))
12 I NURS(0)=1 S NURS("NEW")=$E(NURS("OLD"),1,43)_"|"_$E($P(NURS,"|")_$E(NURSSS,1,28),1,28)_"|"_$E($P(NURS,"|",2)_$E(NURSSS,1,14),1,14)_"|"_$E(NURS("OLD"),89,$L(NURS("OLD")))
13 I NURS(0)=2 S NURS("NEW")=$E(NURS("OLD"),1,87)_"|"_$E($P(NURS,"|")_$E(NURSSS,1,29),1,29)_"|"_$E($P(NURS,"|",2)_$E(NURSSS,1,14),1,14)
14 S ^TMP($J,"NURSDATA",NURS(1))=NURS("NEW")
15 K NURS
16 Q
17GLP1 ;
18 S NURSA(0)=$S($D(^TMP($J,"GMRGNAR",NURSRTK,NURSG(1),0)):^(0),1:""),NURSA=$P(NURSA(0),"^"),NURSA(1)=+$P(NURSA(0),"^",3)
19 F NURSK=1:1:$P(NURSA(0),"^",2) S NURS=$S($D(^TMP($J,"GMRGNAR",NURSRTK,NURSG(1),NURSK)):^(NURSK),1:"")_"||",NURS(0)=1,NURS(1)=NURSO1 D X S NURSO1=NURSO1+1
20 F NURSG=0:0 S NURSG=$O(^TMP($J,"GMRGNAR",NURSG(1),NURSG)) Q:NURSG'>0 S NURSG(0)=NURSG(1) D GOAL
21 S NURSA(0)=+$O(^GMR(124.3,GMRGPDA,1,"B",NURSA(1),0)) I $D(^GMR(124.3,GMRGPDA,1,NURSA(0),"ADD")),^("ADD")]"" S NURSADD=^("ADD"),NURSRET=2,NURSLGT=0,NURSO4=NURSO1 D FORMAT^NURCPP7 S NURSO1=NURSO4
22 S NURS="",NURS(0)=1,NURS(1)=NURSO1 D X S NURSO1=NURSO1+1
23 Q
24GOAL ; CHECK FOR GOAL GOAL/EXPECTED OUTCOME TARGET DATE
25 S NURSI=1,NURS=$S($D(^TMP($J,"GMRGNAR",NURSG(0),NURSG,NURSI)):$E(NURSSS,1,NURSA*3)_^(NURSI),1:"")
26 F NURST(0)=0:0 S NURST(0)=$O(^TMP($J,"NURSDATE",NURSG,NURST(0))) Q:NURST(0)'>0 F NURST=0:0 S NURST=$O(^TMP($J,"NURSDATE",NURSG,NURST(0),NURST)) Q:NURST'>0 D GOAL1
27 F NURST=NURSI:0 Q:NURS="" S NURS(0)=1,NURS(1)=NURSO1 D X S NURSO1=NURSO1+1 S NURST=$O(^TMP($J,"GMRGNAR",NURSG(0),NURSG,NURST)) Q:NURST="" S NURS=$E(NURSSS,1,NURSA*3+1)_^TMP($J,"GMRGNAR",NURSG(0),NURSG,NURST)
28 Q
29 ;
30GOAL1 ;
31 S X=$S($D(^TMP($J,"NURSDATE",NURSG,NURST(0),NURST)):^(NURST),1:"")
32 S Y=$P(X,"^",2) S:Y'="" Y=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)
33 S NURSTAT=$S($L($P(X,"^",4)):"("_$P(X,"^",4)_")"_$E(" ",1,2-$L($P(X,"^",4))),1:" ")
34 S NURSRN=$E($S($D(^VA(200,+$P(X,"^",3),0)):$E($P($P(^(0),"^"),",",2))_$E($P($P(^(0),"^"),",")),1:"")_" ",1,2)
35 ;
36GOAL2 S NURS=NURS_"|"_Y_NURSTAT_$J(NURSRN,2),NURS(0)=1,NURS(1)=NURSO1 D X S NURSO1=NURSO1+1
37 I $D(^TMP($J,"GMRGNAR",NURSG(0),NURSG,NURSI+1)),$P(^(NURSI+1),"^")'="" S NURSI=NURSI+1,NURS=$E(NURSSS,1,NURSA*3+1)_^TMP($J,"GMRGNAR",NURSG(0),NURSG,NURSI)
38 E S NURS=""
39 Q
Note: See TracBrowser for help on using the repository browser.