NURCRL0 ;HIRMFO/RM,RTK-CARE PLAN RANK ORDER PRINT ;8/29/96
;;4.0;NURSING SERVICE;;Apr 25, 1997
EN1 ; ENTRY FROM OPTION 'NURCRP-CP RANK LISTING' TO PRINT RANK ORDER
; LISTING OF CARE PLAN
;
; Select Date/Time range for report
S %DT("A")="Start with Date (Time Optional): ",%DT="AET",%DT(0)="-NOW" D ^%DT I +Y'>0 G EXIT
S NURCBGDT=+Y
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")
E G EXIT
;
; Select Ward(s) for report :Use Nursing utility
W ! I $$MDIC^NURCRL3'>0 G EXIT
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
.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)=""
;
; Select the Ward/Group Report ID for the header
K DIRUT S NURCLID=$$RPRTID^NURCROP2 G:$D(DIRUT) EXIT
;
; Select whether report is for Admitting location or all locations
W ! S NURCSORT=$$SORTYP^NURCROP2 G EXIT:NURCSORT'>0
;
; Select if want to display Dx only, Dx/Int or Int only
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."
D ^DIR K DIR I "^^"[Y G EXIT
S NURCRTYP=Y
;
DEV ; Ask device and allow to queue
; If QUEUE then call ^%ZTLOAD and exit
W ! S %ZIS="Q" D ^%ZIS I POP K IO("Q") G EXIT
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
I $D(IO("Q")) D G EXIT
. K IO("Q")
. 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")=""
. D ^%ZTLOAD K ZTSK
. Q
;
PRINT ; ENTRY FROM TASK TO PRINT RANK ORDER PRINT IF QUEUED TO DEVICE
;
; Call print routine
D PRINT^NURCRL4
;
; If terminal don't let last page scroll off of screen
; I 'NURCOUT S NURCPAGE=$$HEADER^NURCRL1(-1)
EXIT ;
; Clean up variables
K ^TMP($J) S NUROUT=$S('$D(NURCOUT):1,1:NURCOUT) D CLOSE^NURSUT1,^NURCKILL
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURCRL0 2388 printed Nov 22, 2024@17:30:53 Page 2
NURCRL0 ;HIRMFO/RM,RTK-CARE PLAN RANK ORDER PRINT ;8/29/96
+1 ;;4.0;NURSING SERVICE;;Apr 25, 1997
EN1 ; ENTRY FROM OPTION 'NURCRP-CP RANK LISTING' TO PRINT RANK ORDER
+1 ; LISTING OF CARE PLAN
+2 ;
+3 ; Select Date/Time range for report
+4 SET %DT("A")="Start with Date (Time Optional): "
SET %DT="AET"
SET %DT(0)="-NOW"
DO ^%DT
IF +Y'>0
GOTO EXIT
+5 SET NURCBGDT=+Y
ENDT SET %DT("A")="Go to Date (Time Optional): "
SET %DT="AET"
SET %DT(0)=NURCBGDT
DO ^%DT
IF +Y>0
SET X=+Y
SET %DT="T"
SET %DT(0)="-NOW"
DO ^%DT
if +Y'>0
WRITE $CHAR(7)," ??"
if +Y'>0
GOTO ENDT
IF +Y>0
SET NURCENDT=+Y_$SELECT(Y[".":"",1:".24")
+1 IF '$TEST
GOTO EXIT
+2 ;
+3 ; Select Ward(s) for report :Use Nursing utility
+4 WRITE !
IF $$MDIC^NURCRL3'>0
GOTO EXIT
+5 SET X=""
FOR
SET X=$ORDER(NURSNLOC(X))
if X=""
QUIT
FOR Y=0:0
SET Y=$ORDER(NURSNLOC(X,Y))
if Y'>0
QUIT
FOR NURC=0:0
SET NURC=$ORDER(^NURSF(211.4,Y,3,NURC))
if NURC'>0
QUIT
Begin DoDot:1
+6 SET NURSMAS=+$GET(^NURSF(211.4,Y,3,NURC,0))
IF NURSMAS>0
SET NURSMAS(0)=$PIECE($GET(^DIC(42,NURSMAS,0)),"^")
IF $LENGTH(NURSMAS(0))
SET NURSMAS(NURSMAS(0),NURSMAS)=""
End DoDot:1
+7 ;
+8 ; Select the Ward/Group Report ID for the header
+9 KILL DIRUT
SET NURCLID=$$RPRTID^NURCROP2
if $DATA(DIRUT)
GOTO EXIT
+10 ;
+11 ; Select whether report is for Admitting location or all locations
+12 WRITE !
SET NURCSORT=$$SORTYP^NURCROP2
if NURCSORT'>0
GOTO EXIT
+13 ;
+14 ; Select if want to display Dx only, Dx/Int or Int only
+15 WRITE !
KILL DIR
SET DIR(0)="SOM^1:Nursing Diagnoses Only;2:Combination Nursing Diagnoses/Interventions;3:Interventions Only;"
SET DIR("A")="Select which data is to be displayed in this report"
SET DIR("?")="ENTER A CODE FROM THE LIST."
+16 DO ^DIR
KILL DIR
IF "^^"[Y
GOTO EXIT
+17 SET NURCRTYP=Y
+18 ;
DEV ; Ask device and allow to queue
+1 ; If QUEUE then call ^%ZTLOAD and exit
+2 WRITE !
SET %ZIS="Q"
DO ^%ZIS
IF POP
KILL IO("Q")
GOTO EXIT
+3 IF $EXTRACT(IOST)="P"
IF '$DATA(IO("Q"))
IF '$DATA(IO("S"))
DO ^%ZISC
SET XQH="NURS-PRINTER QUEUE"
WRITE $CHAR(7)
DO EN^XQH
KILL XQH
GOTO DEV
+4 IF $DATA(IO("Q"))
Begin DoDot:1
+5 KILL IO("Q")
+6 SET ZTIO=ION
SET ZTRTN="PRINT^NURCRL0"
SET ZTDESC="Nursing Care Plan Statistics - Rank Order Print"
SET ZTSAVE("NURSMAS*")=""
SET ZTSAVE("NURCBGDT")=""
SET ZTSAVE("NURCENDT")=""
SET ZTSAVE("NURCRTYP")=""
SET ZTSAVE("NURCSORT")=""
SET ZTSAVE("NURCLID")=""
+7 DO ^%ZTLOAD
KILL ZTSK
+8 QUIT
End DoDot:1
GOTO EXIT
+9 ;
PRINT ; ENTRY FROM TASK TO PRINT RANK ORDER PRINT IF QUEUED TO DEVICE
+1 ;
+2 ; Call print routine
+3 DO PRINT^NURCRL4
+4 ;
+5 ; If terminal don't let last page scroll off of screen
+6 ; I 'NURCOUT S NURCPAGE=$$HEADER^NURCRL1(-1)
EXIT ;
+1 ; Clean up variables
+2 KILL ^TMP($JOB)
SET NUROUT=$SELECT('$DATA(NURCOUT):1,1:NURCOUT)
DO CLOSE^NURSUT1
DO ^NURCKILL
+3 QUIT