| 1 | NURCRL0 ;HIRMFO/RM,RTK-CARE PLAN RANK ORDER PRINT ;8/29/96
 | 
|---|
| 2 |  ;;4.0;NURSING SERVICE;;Apr 25, 1997
 | 
|---|
| 3 | EN1 ; ENTRY FROM OPTION 'NURCRP-CP RANK LISTING' TO PRINT RANK ORDER 
 | 
|---|
| 4 |  ; LISTING OF CARE PLAN
 | 
|---|
| 5 |  ;
 | 
|---|
| 6 |  ;  Select Date/Time range for report
 | 
|---|
| 7 |  S %DT("A")="Start with Date (Time Optional): ",%DT="AET",%DT(0)="-NOW" D ^%DT I +Y'>0 G EXIT
 | 
|---|
| 8 |  S NURCBGDT=+Y
 | 
|---|
| 9 | ENDT S %DT("A")="Go to Date (Time Optional): ",%DT="AET",%DT(0)=NURCBGDT D ^%DT I +Y>0 S X=+Y,%DT="T",%DT(0)="-NOW" D ^%DT W:+Y'>0 $C(7)," ??" G:+Y'>0 ENDT I +Y>0 S NURCENDT=+Y_$S(Y[".":"",1:".24")
 | 
|---|
| 10 |  E  G EXIT
 | 
|---|
| 11 |  ;
 | 
|---|
| 12 |  ;  Select Ward(s) for report :Use Nursing utility
 | 
|---|
| 13 |  W ! I $$MDIC^NURCRL3'>0 G EXIT
 | 
|---|
| 14 |  S X="" F  S X=$O(NURSNLOC(X)) Q:X=""  F Y=0:0 S Y=$O(NURSNLOC(X,Y)) Q:Y'>0  F NURC=0:0 S NURC=$O(^NURSF(211.4,Y,3,NURC)) Q:NURC'>0  D
 | 
|---|
| 15 |  .S NURSMAS=+$G(^NURSF(211.4,Y,3,NURC,0)) I NURSMAS>0 S NURSMAS(0)=$P($G(^DIC(42,NURSMAS,0)),"^") I $L(NURSMAS(0)) S NURSMAS(NURSMAS(0),NURSMAS)=""
 | 
|---|
| 16 |  ;
 | 
|---|
| 17 |  ;  Select the Ward/Group Report ID for the header
 | 
|---|
| 18 |  K DIRUT S NURCLID=$$RPRTID^NURCROP2 G:$D(DIRUT) EXIT
 | 
|---|
| 19 |  ;
 | 
|---|
| 20 |  ;   Select whether report is for Admitting location or all locations
 | 
|---|
| 21 |  W ! S NURCSORT=$$SORTYP^NURCROP2 G EXIT:NURCSORT'>0
 | 
|---|
| 22 |  ;
 | 
|---|
| 23 |  ;  Select if want to display Dx only, Dx/Int or Int only
 | 
|---|
| 24 |  W ! K DIR S DIR(0)="SOM^1:Nursing Diagnoses Only;2:Combination Nursing Diagnoses/Interventions;3:Interventions Only;",DIR("A")="Select which data is to be displayed in this report",DIR("?")="ENTER A CODE FROM THE LIST."
 | 
|---|
| 25 |  D ^DIR K DIR I "^^"[Y G EXIT
 | 
|---|
| 26 |  S NURCRTYP=Y
 | 
|---|
| 27 |  ;
 | 
|---|
| 28 | DEV ;  Ask device and allow to queue
 | 
|---|
| 29 |  ;   If QUEUE then call ^%ZTLOAD and exit
 | 
|---|
| 30 |  W ! S %ZIS="Q" D ^%ZIS I POP K IO("Q") G EXIT
 | 
|---|
| 31 |  I $E(IOST)="P",'$D(IO("Q")),'$D(IO("S")) D ^%ZISC S XQH="NURS-PRINTER QUEUE" W $C(7) D EN^XQH K XQH G DEV
 | 
|---|
| 32 |  I $D(IO("Q")) D  G EXIT
 | 
|---|
| 33 |  .   K IO("Q")
 | 
|---|
| 34 |  .   S ZTIO=ION,ZTRTN="PRINT^NURCRL0",ZTDESC="Nursing Care Plan Statistics - Rank Order Print",ZTSAVE("NURSMAS*")="",ZTSAVE("NURCBGDT")="",ZTSAVE("NURCENDT")="",ZTSAVE("NURCRTYP")="",ZTSAVE("NURCSORT")="",ZTSAVE("NURCLID")=""
 | 
|---|
| 35 |  .   D ^%ZTLOAD K ZTSK
 | 
|---|
| 36 |  .   Q
 | 
|---|
| 37 |  ;
 | 
|---|
| 38 | PRINT ; ENTRY FROM TASK TO PRINT RANK ORDER PRINT IF QUEUED TO DEVICE
 | 
|---|
| 39 |  ;
 | 
|---|
| 40 |  ; Call print routine
 | 
|---|
| 41 |  D PRINT^NURCRL4
 | 
|---|
| 42 |  ;
 | 
|---|
| 43 |  ;  If terminal don't let last page scroll off of screen
 | 
|---|
| 44 |  ; I 'NURCOUT S NURCPAGE=$$HEADER^NURCRL1(-1)
 | 
|---|
| 45 | EXIT ;
 | 
|---|
| 46 |  ;  Clean up variables
 | 
|---|
| 47 |  K ^TMP($J) S NUROUT=$S('$D(NURCOUT):1,1:NURCOUT) D CLOSE^NURSUT1,^NURCKILL
 | 
|---|
| 48 |  Q
 | 
|---|