source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURCPPS1.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: 4.3 KB
RevLine 
[613]1NURCPPS1 ;HIRMFO/RM,RK-NURSING CARE PLAN REPORT USING GENERIC SORT ;8/29/96
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3EN1 ; ENTRY FROM OPTION NURCPE-CARE
4 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
5 S GMRGRT=$O(^GMRD(124.2,"AA","NURSC",2,"Nursing Care Plan",1,0)),GMRGRT=GMRGRT_"^Nursing Care Plan" I +GMRGRT'>0 W !,"The ""AA"" crossreference for file 124.2 needs to be re-crossreferenced." G QUIT
6 S (NURSGMRG,NURSOUT)=0,GMRGOUT=0
7ASK ; GET PATIENT/ GROUP OF PATIENTS
8 S NACT=0 D WARDPAT^NURCUT0 S:NURQUIT NURSOUT=1 K DIC,NPWARD,NURQUIT G QUIT:NURSOUT
9 I "Pp"[NUREDB S GMRGXPRT="1^0^0" D EN1^GMRGRUT3 S:GMRGOUT NURSOUT=1 K GMRGOUT,GMRGXPRT G QUIT:NURSOUT,ASK:$G(GMRGPDA)'>0
10REASK ; SELECT CURRENT OR COMPLETE LISTING
11 W !!,"Enter a C for a current listing, or an A for a complete listing: " R NURSPLN:DTIME S:NURSPLN="^"!(NURSPLN="^^")!'$T NURSOUT=1 G QUIT:NURSOUT,ASK:NURSPLN=""
12 S:NURSPLN?1L NURSPLN=$C($A(NURSPLN)-32) I NURSPLN'="C",NURSPLN'="A" W !?3,$C(7),"Enter a C to get a current listing which will only give the latest dates,",!?3,"or an A to get a complete listing with all of the dates" G REASK
13 ;
14 W !!,"This Report may be Queued to print on another device,",!,"freeing your terminal for other use.",!
15 S GMRGPDT="N" F X="DFN","GMRGPDA","GMRGRT","NRMBD(","NURSPLN","NUREDB","NURWARD","NURSGMRG" S ZTSAVE(X)=""
16 S ZTDESC="Patient Care Plan Print",ZTRTN="REPORT^NURCPPS1" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
17 ;
18REPORT ; PRINT THESE REPORTS
19 D:'$D(ZTQUEUED) WAIT^DICD U IO
20 K ^TMP($J,"NURCEN") D ^NURCAS2 K NURWARD,NRMBD,DFN
21 I '$D(^TMP($J,"NURCEN")) W $C(7),!,"NO PATIENTS WERE SELECTED." G ASK:'$D(ZTQUEUED),QUIT
22PRINT ;PRINT ROUTINE
23 S NURSOUT=0,NBED="" F S NBED=$O(^TMP($J,"NURCEN",NBED)) Q:NBED=""!NURSOUT D
24 . S NBED(0)=""
25 . F S NBED(0)=$O(^TMP($J,"NURCEN",NBED,NBED(0))) Q:NBED(0)=""!NURSOUT D
26 . . S N1=""
27 . . F S N1=$O(^TMP($J,"NURCEN",NBED,NBED(0),N1)) Q:N1=""!NURSOUT D PRINT1
28 . . Q
29 . Q
30QUIT ; KILL LOCAL VARIABLES
31 D ^%ZISC I $D(ZTQUEUED) S ZTREQ="@"
32 I 'NURSGMRG K NURSGMRG,NURSPLN,DFN,GMRGPDA,GMRGRT,GMRGPDT,GMRGOUT D KVAR^VADPT K VA
33 K ^TMP($J,"NURCEN")
34 K N1,NBED,NI,NRMBD,NUREDB,NURSOUT,NURWARD
35CLEAN ; CLEAN UP FOR NEXT REPORT
36 K %,%DT,%ZIS,ANS,D0,DA,DIC,DIPGM,DIQ,DR,GMRGLEN,GMRGPAR,GMRGPLN,GMRGXPRT,J,NAME,NDATA,NPWARD,NURQUEUE,NROOM,NURAGE,NURPR,NURSA,NURSADD,NURSALGR,NURSB,NURSC,NURSCHIL,NURSCLAS,NURSCPL,NURSDA,NURSDAT,NURSDIAG,NURSDOC,NURSE,NURSEND,NURSERR,NURCLEG
37 K NURSG,NURSGCK,NURSGOCK,NURSH1,NURSH2,NURSH3,NURSH4,NURSH5,NURSH6,NURSH7,NURSHED,NURSI,NURSICK,NURSINCK,NURSIOSL
38 K NURSISW,NURSISW1,NURSITHD,NURSJ,NURSK,NURSL,NURSLCNT,NURSLGT,NURSLIN,NURSLVD,NURSMAR,NURSMED,NURSO,NURSO1,NURSO2,NURSO4,NURSOT
39 K NURSP,NURSP1,NURSP2,NURSP3,NURSPAG,NURSPAT,NURSPDT,NURSPNAM,NURSPOI,NURSPRB,NURSPROV,NURSRB,NURSREL,NURSRET,NURSRM,NURSRN,NURSRTK,NURSSP,NURSSS,NURSSSN,NURSSW1,NURST,NURSTAT,NURSTI,NURSTITL,NURUS,NURSWD,NURSX,POP,ZTSK,ZTDESC
40 I $D(^TMP($J)) F X="NURSDATA","NURSOT","GMRGNAR","NURSGO","NURSIN","NURSDATE" K ^TMP($J,X)
41 Q
42PRINT1 ; PRINT ONE PATIENT RECORD
43 S NDATA=^TMP($J,"NURCEN",NBED,NBED(0),N1),DFN=$P(NDATA,"^")
44 I "Pp"'[NUREDB S GMRGPDA=0 F X=0:0 Q:GMRGPDA>0 S X=$O(^GMR(124.3,"AA",DFN,+GMRGRT,X)) Q:X'>0 F GMRGPDA=0:0 S GMRGPDA=$O(^GMR(124.3,"AA",DFN,+GMRGRT,X,GMRGPDA)) Q:GMRGPDA'>0 I '+$G(^GMR(124.3,GMRGPDA,5)) Q
45PRINT2 ; PRINT ONE PATIENT RECORD GIVEN GMRGPDA.
46 S GMRGPDA=+GMRGPDA,NURSPDT=$P($G(^GMR(124.3,GMRGPDA,0)),"^",3)
47 D NOW^%DTC S GMRGPDT=$S(NURSPLN="C":%,1:NURSPDT)
48 D DEM^VADPT,INP^VADPT
49 S NURSPNAM=$E(VADM(1),1,20),NURSSSN=$S(VA("PID")'="":VA("PID"),1:" "),NURAGE=$S($P(VADM(4),"^")'="":$J($P(VADM(4),"^"),3),1:" ")
50 S DIC="^DPT(",DR=".05;.08",DA=DFN,DIQ="NURSPAT(",DIQ(0)="I" D EN^DIQ1
51 S NURSMAR=$P($G(^DIC(11,+$G(NURSPAT(2,DFN,.05,"I")),0)),"^",3),NURSMAR=$E(NURSMAR_" ")
52 S NURSREL=$P($G(^DIC(13,+$G(NURSPAT(2,DFN,.08,"I")),0)),"^"),NURSREL=$E(NURSREL_" ",1,4)
53 S NURSWD=$E($P(VAIN(4),"^",2),1,8)_$E(" ",$L($P(VAIN(4),"^",2))+1,8),NURSRB=$E(VAIN(5),1,10)_$E(" ",$L(VAIN(5))+1,10),NURSPROV=$E($P(VAIN(2),"^",2),1,20),NURSDIAG=VAIN(9)
54 D LATER^NURCPPS3 D CLEAN
55 Q
56EN2 ; Entry from GMRG Patient edit to print this Nursing Care Plan
57 ; DFN, GMRGPDA, GMRGPDT and GMRGRT must be defined.
58 Q:'$D(DFN)!'$D(GMRGPDA)!'$D(GMRGRT)!'$D(GMRGPDT) S NURSGMRG=1,NURSPLN="C" D DEM^VADPT,INP^VADPT,CONT^NURCPPS3,QUIT,KVAR^VADPT K NURSGMRG,NURSPLN,VA
59 Q
Note: See TracBrowser for help on using the repository browser.