source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURCPP1.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1NURCPP1 ;HIRMFO/JH/RM-NURSING CARE PLAN DATA OUTPUT part 1 ;1/13/92
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3 ; This is the Patient Problem Listing,Data Processor,Output Routine
4EN1 ;
5 D NOW^%DTC S Y=% D D^DIQ S NURSDAT=$P(Y,":",1,2),NURSISW=1,NURSSP=0,NURSLIN("-")="",$P(NURSLIN("-"),"-",IOM)="-",NURSPAG=1,(NURSLCNT,NURSSW1)=0 D SPACES^NURCPP3
6 S NURSMED="Diagnosis: "_$E(NURSDIAG_NURSSS,1,37)_" "_"Physician: "_NURSPROV
7 S NURSHED=$E(NURSPNAM_NURSSS,1,20)_" "_NURSSSN_" "_NURAGE_" "_$E(NURSWD_NURSSS,1,8)_" "_$E(NURSRB_NURSSS,1,10)_" "_$E(NURSREL_NURSSS,1,4)_" "_NURSMAR
8 ;
9 S NURSO=0,NURSP(1)="" F NURSX=0:0 S NURSP(1)=$O(NURSPRB(NURSP(1))) Q:NURSP(1)="" F NURSP=0:0 S NURSP=$O(NURSPRB(NURSP(1),NURSP)) Q:NURSP'>0 D PROB
10 F X=0:0 Q:$S('$D(^TMP($J,"NURSDATA",NURSO)):1,^(NURSO)'="":1,1:0) K ^(NURSO) S NURSO=NURSO-1
11 I NURSO'>0 U IO S NURSISW=0,ANS="" D HEADER^NURCPP3 W !!,"THERE IS NO DATA FOR THIS REPORT" S NURSISW=2,NURSLCNT=NURSLCNT+2 D HEADER^NURCPP3 Q
12 U IO D GETOUPT^NURCPP3
13 ;
14 Q
15 ;
16PROB ; CHECK FOR PROBLEM AND EVALUATION DATE
17 K NURSLVD F X=1:1:2 S NURSO=NURSO+1,^TMP($J,"NURSDATA",NURSO)=""
18 S GMRGXPRT=$S($D(^GMRD(124.2,NURSP,0)):$P(^(0),"^"),1:""),NURSP(0)=$O(^GMR(124.3,GMRGPDA,1,"B",NURSP,0)),GMRGXPRT(0)=$S(NURSP(0)'>0:"",$D(^GMR(124.3,GMRGPDA,1,NURSP(0),0)):$P(^(0),"^",2),1:""),GMRGXPRT(1)="^^0^^1" D EN1^GMRGRUT2
19 S GMRGPLN=GMRGXPRT,GMRGLEN=50 D FITLINE^GMRGRUT1 S ^TMP($J,"NURSDATA",NURSO)=GMRGPLN(0)
20 F NURSE(0)=0:0 S NURSE(0)=$O(^TMP($J,"NURSDATE",NURSP,NURSE(0))) Q:NURSE(0)'>0 F NURSE=0:0 S NURSE=$O(^TMP($J,"NURSDATE",NURSP,NURSE(0),NURSE)) Q:NURSE'>0 D PROB1
21 I ^TMP($J,"NURSDATA",NURSO)'="" S NURSO=NURSO+1,^TMP($J,"NURSDATA",NURSO)=""
22 F NURSE=0:0 Q:GMRGPLN(1)="" S GMRGLEN=50,GMRGPLN=GMRGPLN(1) D FITLINE^GMRGRUT1 S ^TMP($J,"NURSDATA",NURSO)=GMRGPLN(0),NURSO=NURSO+1,^(NURSO)=""
23 G PROB3
24 ;
25PROB1 ;
26 S X=$S($D(^TMP($J,"NURSDATE",NURSP,NURSE(0),NURSE)):^(NURSE),1:"")
27 S Y=$P(X,"^",2) S:Y'="" Y=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3) S NURSTAT=$S($L($P(X,"^",4)):"("_$P(X,"^",4)_")",1:" "),NURSRN=$E($S($D(^VA(200,+$P(X,"^",3),0)):$P($P(^(0),"^"),","),1:"")_" ",1,10)
28 I '$D(NURSLVD) S NURSLVD=("^R^S^U^"[("^"_$P(X,"^",4)_"^")) ; switch to determine if problem inactive
29 S X=^TMP($J,"NURSDATA",NURSO),^(NURSO)=X_$E(NURSSS,1,57-$L(X))_NURSH3_Y_NURSTAT_NURSP3_NURSRN,X=""
30 I GMRGPLN(1)'="" S GMRGPLN=GMRGPLN(1),GMRGLEN=50 D FITLINE^GMRGRUT1 S X=GMRGPLN(0)
31 S NURSO=NURSO+1,^TMP($J,"NURSDATA",NURSO)=X
32 Q
33PROB3 F NURSOT=0:0 S NURSOT=$O(^TMP($J,"NURSOT",NURSP,NURSOT)) Q:NURSOT'>0 S NURSO=NURSO+1,^TMP($J,"NURSDATA",NURSO)="" D OTHER
34 ;
35 I $D(^TMP($J,"NURSDATA",NURSO)),^(NURSO)'="" S NURSO=NURSO+1,^(NURSO)=""
36 S NURSO=NURSO+1,^TMP($J,"NURSDATA",NURSO)=""
37 K NURSB("G"),NURSB("I") F NURSE=0:0 S NURSE=$O(^GMRD(124.2,NURSP,1,"B",NURSE)) Q:NURSE'>0 S NURSE(0)=$S($D(^GMRD(124.2,NURSE,0)):$P(^(0),"^",4),1:"") S:NURSE(0)=NURSGCK NURSB("G",NURSE)="" S:NURSE(0)=NURSICK NURSB("I",NURSE)=""
38 D ^NURCPP2
39 S NURSP(0)=$O(^GMR(124.3,GMRGPDA,1,"B",NURSP,0)) I NURSP(0)>0,$D(^GMR(124.3,GMRGPDA,1,NURSP(0),"ADD")),^("ADD")]"" S NURSLGT=47,NURSADD=^("ADD"),NURSO=NURSO+1,^TMP($J,"NURSDATA",NURSO)="" D FORMAT^NURCPP4
40 Q
41 ;
42OTHER ; PRINT OTHER INFO ABOUT PROBLEM
43 F NURST=0:0 S NURST=$O(^TMP($J,"GMRGNAR","R",NURSOT,NURST)) Q:NURST'>0 D STOT
44 Q
45STOT ;
46 S X=^TMP($J,"GMRGNAR","R",NURSOT,NURST)
47 S ^TMP($J,"NURSDATA",NURSO)=" "_X_$E(NURSSS,1,57-$L(X)),NURSO=NURSO+1,^TMP($J,"NURSDATA",NURSO)=""
48 Q
Note: See TracBrowser for help on using the repository browser.