source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURCAS1.m@ 1328

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1NURCAS1 ;HIRMFO/MD/RM/MD-PATIENT PROBLEM/NURSING INTERVENTION PRINT ;10/2/95
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3 S GMRGRT=$O(^GMRD(124.2,"AA","NURSC",2,"Nursing Care Plan",1,0)),GMRGPDA=0
4 F REVDAT=0:0 S REVDAT=$O(^GMR(124.3,"AA",DFN,GMRGRT,REVDAT)) Q:'REVDAT S GMRGPDA=$O(^GMR(124.3,"AA",DFN,GMRGRT,REVDAT,0)) I GMRGPDA Q:'$S('$D(^GMR(124.3,GMRGPDA,5)):0,1:+^(5)) S GMRGPDA=0
5 Q:'GMRGPDA S NURSCPE=+$O(^NURSC(216.8,"B",GMRGPDA,0))
6 K NURSPROB,NURSORD,^TMP($J,"GMRGNAR"),^TMP($J,"NURPROB")
7 F PROB=0:0 S PROB=$O(^NURSC(216.8,NURSCPE,"EVAL","AA",PROB)) Q:PROB'>0 S REVDATE=+$O(^(PROB,0)),DA=+$O(^(REVDATE,0)) I $D(^NURSC(216.8,NURSCPE,"EVAL",DA,0)),'$P(^(0),"^",4) D PROB
8 D NOW^%DTC S GMRGPDT=% F INTER=0:0 S INTER=$O(^NURSC(216.8,NURSCPE,"ORD","AA",INTER)) Q:INTER'>0 S REVDATE=+$O(^(INTER,0)),DA=+$O(^(REVDATE,0)) I $D(^NURSC(216.8,NURSCPE,"ORD",DA,0)),'$P(^(0),"^",3) D INTER
9 S (ISW,PSW)=0,(ISW(0),PSW(0))=1,(INTER,PROB)="" D AR F NX=1:1 S INTER=$S(NX=1!(NX'=1&(INTER'="")&'ISW):$O(NURSORD(INTER)),1:INTER),PROB=$S(NX=1!(NX'=1&(PROB'="")&'PSW):$O(NURSPROB(PROB)),1:PROB) Q:INTER=""&(PROB="") D FORMAT Q:NURQUIT
10 K ^TMP($J,"GMRGNAR"),^TMP($J,"NURPROB")
11 Q
12PROB ;PATIENT PROBLEM ARRAY
13 S NURPROB=$P($G(^GMRD(124.2,PROB,0)),"^") Q:'$L(NURPROB)!'$D(^GMR(124.3,GMRGPDA,1,"ALIST",PROB))
14 S P=+$O(^GMR(124.3,GMRGPDA,1,"B",PROB,0)),GMRGXPRT=NURPROB,GMRGXPRT(0)=$S($D(^GMR(124.3,GMRGPDA,1,P,0)):$P(^(0),"^",2),1:""),GMRGXPRT(1)="^^0^^1" D EN1^GMRGRUT2 S PRPROB=GMRGXPRT K GMRGXPRT
15 S NURSPROB(PRPROB)=PROB
16 F NX=1:1 S GMRGLEN=$S(NX=1:38,1:36),GMRGPLN=PRPROB D FITLINE^GMRGRUT1 S ^TMP($J,"NURPROB",PROB,NX)=GMRGPLN(0),PRPROB=GMRGPLN(1) Q:PRPROB=""
17 Q
18INTER ;NURSING INTERVENTION ARRAY
19 S NURORD=$P($G(^GMRD(124.2,INTER,0)),"^") Q:'$L(NURORD)!'$D(^GMR(124.3,GMRGPDA,1,"ALIST",INTER))
20 S P=+$O(^GMR(124.3,GMRGPDA,1,"B",INTER,0)),GMRGXPRT=NURORD,GMRGXPRT(0)=$S($D(^GMR(124.3,GMRGPDA,1,P,0)):$P(^(0),"^",2),1:""),GMRGXPRT(1)="^^0^^1" D EN1^GMRGRUT2 S NURORD=GMRGXPRT K GMRGXPRT
21 S NURSORD(NURORD)=INTER
22 S GMRGPAR=INTER,GMRGPAR(0)="0^"_(IOM-34)_"^2^NURORD" D EN1^GMRGPNBL
23 Q
24FORMAT ;PATIENT PROBLEM/NURSING INTERVENTION DISPLAY
25 D:PROB'=""
26 . F RVDT=0:0 S RVDT=$O(^NURSC(216.8,NURSCPE,"EVAL","AA",NURSPROB(PROB),RVDT)) Q:RVDT'>0 S IEN=$O(^NURSC(216.8,NURSCPE,"EVAL","AA",NURSPROB(PROB),RVDT,0)) I IEN>0 D Q
27 . . S XX=$G(^NURSC(216.8,NURSCPE,"EVAL",IEN,0)),Y=$P(XX,U,5) D DD^%DT S NURSEVDT=Y
28 . . Q
29 . Q
30 I PROB'="",'PSW S PRPROB=$G(^TMP($J,"NURPROB",+NURSPROB(PROB),2)),NURPLN=$G(^TMP($J,"NURPROB",+NURSPROB(PROB),1))_"^"_NURSEVDT,(PSW(0),PSW,PSW(1))=1
31 E I PROB'="" S PSW(1)=PSW(1)+1,PRPROB=$G(^TMP($J,"NURPROB",+NURSPROB(PROB),PSW(1)+1)),NURPLN=$G(^TMP($J,"NURPROB",+NURSPROB(PROB),PSW(1)))_"^"_NURSEVDT
32 I INTER'="",'ISW S PRORD=$G(^TMP($J,"GMRGNAR","NURORD",+NURSORD(INTER),2)),NURPLN(0)=$E($G(^TMP($J,"GMRGNAR","NURORD",+NURSORD(INTER),1)),3,38),(ISW(0),ISW,ISW(1))=1
33B E I INTER'="" S ISW(1)=ISW(1)+1,PRORD=$G(^TMP($J,"GMRGNAR","NURORD",+NURSORD(INTER),ISW(1)+1)),NURPLN(0)=$G(^TMP($J,"GMRGNAR","NURORD",+NURSORD(INTER),ISW(1)))
34 I $G(PRPROB)="" S PSW=0
35 I $G(PRORD)="" S ISW=0
36 I ($Y>(IOSL-6)) D HEADER^NURCAS0 Q:NURQUIT D HEADER1^NURCAS0,AR
37 W ! W:($D(NURPLN)#2) ?$S('PSW(0):2,1:0),$E($P(NURPLN,U),1,28) W ?30,$G(NURSEVDT) S NURSEVDT=" " W:$D(NURPLN(0)) ?47,NURPLN(0) S (ISW(0),PSW(0))=0 K NURPLN
38 Q
39AR W !,"PATIENT PROBLEMS",?30,"EVALUATION DATE",?47,"NURSING INTERVENTIONS"
40 Q
Note: See TracBrowser for help on using the repository browser.