Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSIVARH

PSIVARH.m

Go to the documentation of this file.
  1. PSIVARH ;AAC/JLS - DISPLAY RECENTLY DC'D IV ORDERS ; 17 Nov 2015 1:53 PM
  1. ;;5.0;INPATIENT MEDICATIONS;**325**;;Build 37
  1. ;
  1. EN101(PSIVMSG) ;Entry from protocol PSIVARH PHARMACY
  1. ;
  1. N ORIFN,PSJORD,ORVP
  1. D DECODE^PSIVARH1
  1. I $G(PSIVPKG(2),"")="" Q
  1. I PSIVPKG(2)'["PHARMACY" Q
  1. I ";DC;XO;"'[(";"_$G(PSIVSTS)_";") Q
  1. ;
  1. I PSIVSTS="DC" D
  1. . S ORIFN=+PSIVIFNF
  1. . S PSJORD=$P(PSIVIFNP,U,1)
  1. . I PSJORD'["V" Q ;only IV
  1. . S ORVP=DFN
  1. . D STORE1(ORIFN,PSJORD,ORVP)
  1. ;
  1. I PSIVSTS="XO" D
  1. . I PSIVIFNP'="" Q ;placer # exists so this is not a dc/edit
  1. . S ORIFN=$$GET1^DIQ(100,+PSIVIFNF,9,"I") ;prior orifn
  1. . I 'ORIFN Q
  1. . S PSIVSTS0=$$GET1^DIQ(100,+ORIFN,5,"I") ;prior status
  1. . I PSIVSTS0'=12 Q ;only dc/edit
  1. . S PSJORD=$$GET1^DIQ(100,+ORIFN,33,"I") ;prior pkg ref
  1. . I PSJORD'["V" Q ;ONLY IV
  1. . S ORVP=DFN
  1. . D STORE1(ORIFN,PSJORD,ORVP)
  1. K PSIV42,PSIV44,PSIVDUZ,PSIVEDT,PSIVFLD,PSIVIFNF,PSIVIFNP,PSIVLOC,PSIVMSG,PSIVPKG,PSIVRDT
  1. K PSIVRDUZ,PSIVRM,PSIVSTS,PSIVSTS0
  1. Q
  1. STORE1(ORIFN,PSJORD,ORVP) ;Get common info
  1. ;;ORVP
  1. N QNOW,LOCIEN,LOCNAME,WRDIEN,WG,PSIVF,PHORD,X,Y,%
  1. S QNOW=$$NOW^XLFDT
  1. S LOCIEN=$P($G(^OR(100,+ORIFN,0)),U,10) ; p44
  1. S LOCNAME=$P($G(^SC(+LOCIEN,0)),"^",1) ;name
  1. I LOCNAME="" S LOCNAME="NO WARD"
  1. Q:'LOCIEN
  1. S WRDIEN=$P($G(^SC(+LOCIEN,42)),U)
  1. S WG=0
  1. S:+WRDIEN WG=$O(^PS(57.5,"AB",WRDIEN,WG))
  1. S PHORD=$$OI(+ORIFN) ;;ORDER NUMBER
  1. I PSJORD["P" S PSIVF=$NA(^PS(53.1,+PSJORD))
  1. E S PSIVF=$NA(^PS(55,+ORVP,$S(PSJORD["V":"IV",1:5),+PSJORD))
  1. ;STORE IF AN IV ORDER AND THE PARAMETER NOT SET TO 0 (FEATURE TURNED OFF)
  1. I $$IVROFF(ORVP,PSJORD)'=0 D STOREIV
  1. Q
  1. IVROFF(ORVP,PSJORD) ;
  1. ;FUNCTION RETURNS IVROOM'S DC'D ORDERS SETTING
  1. N IVR,IVHRS
  1. S IVR=$$IVROOM(ORVP,+PSJORD)
  1. S IVHRS=$P($$GETHRS^PSIVARH1($P(IVR,U,1)),U,3)
  1. Q IVHRS
  1. ;
  1. OI(Q) ;Get pharmacy orderable item
  1. N QQ,PHORD,PSIVOI,PSIVOID
  1. S QQ=0,PHORD=0
  1. F S QQ=$O(^OR(100,Q,.1,QQ)) Q:'QQ D
  1. . S PSIVOI=$P(^OR(100,Q,.1,QQ,0),U)
  1. . S PSIVOID=$P(^ORD(101.43,PSIVOI,0),U,2)
  1. . I PSIVOID'["PSP" Q
  1. . S PHORD=$P(PSIVOID,";")
  1. Q PHORD
  1. STOREIV ;Store IV info
  1. N PSIVMR,PSIVSCH,PSIVDO,DIC,DD,DO,X,Y,%
  1. S PSIVMR=$P($G(@PSIVF@(.2)),U,3)
  1. S PSIVMR=$$GET1^DIQ(51.2,PSIVMR,1) ;abbrev
  1. I PSIVMR="" S PSIVMR=$$GET1^DIQ(51.2,PSIVMR,.01) ;long name
  1. S PSIVMR=$E(PSIVMR,1,5)
  1. S PSIVSCH=$P($G(@PSIVF@(0)),U,8)
  1. I +LOCIEN D
  1. .K DIC S DIC="^PS(52.75,",DIC(0)="LQ",X=QNOW
  1. .S DIC("DR")="2////"_+ORVP_";3////"_PHORD_";4////"_$G(^DPT(+ORVP,.101),9999)_";5////"_LOCNAME_";7////"_+LOCIEN_";8////"_PSJORD_";9////"_WG_";10////"_$G(PSIVSTS)
  1. .S DIC("DR")=DIC("DR")_";.662////"_"Give: "_PSIVMR_" "_$TR(PSIVSCH,";",",")
  1. .D FILE^DICN
  1. .K DD,DO
  1. Q
  1. ;
  1. ;==========================================================
  1. ;
  1. START ;Called from PSGVBW to display orders; Input: PSGSS,WD,WG
  1. Q:'$D(PSGSS)!("^G^W^"'[(U_$G(PSGSS)_U))
  1. N PSIVDA,PSIVRI,PSIVWG,PSIVWDI,PSIVWN,WRDIEN,WDSETUP,GRSETUP
  1. N PSIVXREF,DIC,DR,DIR,WARD,X,HRSFILT,TDNODE,TPNODE
  1. ;
  1. ;
  1. ; global to determine if the user elected to queue the print
  1. ; if so we don't touch ^TMP( that holds the data that will print
  1. ;
  1. ; global to note the IV room the user is signed into.
  1. ; this is used to screen out orders from the report that
  1. ; are associated with other IV rooms
  1. ;
  1. N SIGNONIV
  1. S SIGNONIV=+$G(^TMP("PSJUSER",$J,"PSIV","PSIVSN"))
  1. S SIGNONIV=SIGNONIV_U_$P($G(^PS(59.5,SIGNONIV,0)),U)
  1. ;
  1. ;
  1. N ZTSK,RPTITLE,RPTITLE1,RPTITLE2
  1. S RPTITLE="IV ORDER D/Cs and EDITS Thru CPRS"
  1. ;
  1. ; get the iv room parameter for how far back
  1. ; to look at IV orders (# of hours--integer)
  1. ;
  1. S HRSFILT=$$GETHRS^PSIVARH1(PSIVSN)
  1. ;
  1. ; don't display the report if HOURS FILTER parameter
  1. ; is set to zero.
  1. ;
  1. Q:$P(HRSFILT,U,3)=0
  1. ;
  1. S RPTITLE1=RPTITLE_" Since "_$$FMTE^XLFDT($P(HRSFILT,U,1),"5M")_" (past "_$P(HRSFILT,U,3)_" hrs)"
  1. ;
  1. ;
  1. ; display DC'd or Edited orders within HRSFILT
  1. ;
  1. S (GRSETUP,WDSETUP)=0
  1. ;
  1. ;if group or ward selected initialize selection specific vars and check for data
  1. ; quit if there is no data
  1. ;
  1. S:PSGSS="G" GRSETUP=$$GRSETUP(WG)
  1. Q:GRSETUP<0
  1. ;
  1. S:PSGSS="W" WDSETUP=$$WDSETUP(WD)
  1. Q:WDSETUP<0
  1. ;
  1. ; continue display and action loop until user wants to quit
  1. D ORDLOOP
  1. D EXIT
  1. Q
  1. ORDLOOP ; Loop through orders for each ward or each ward in a group
  1. ;
  1. ; PAUSE is set to true if the user up arrowed during the display
  1. ; so they can be prompted to take action on records that they have
  1. ; viewed so far
  1. ;
  1. N ACTION,PAUSE,PSIVQT,NORECS
  1. S (NORECS,PAUSE)=0,PSIVQT=""
  1. F D Q:($G(PSIVQT)=1)!(PAUSE)!(NORECS)
  1. .
  1. .; global counts records that displayed (DISP subroutine)
  1. .; from the signon IV room. If none then give user a message.
  1. .;
  1. .N RECCNT S RECCNT=0
  1. .;
  1. .; Node setup for ^TMP arrays to hold data to be printed or deleted
  1. .; Print array needs to be unique ($H) for case where user queues print
  1. .; and same user then could review or delete entries included in queued print job.
  1. .;
  1. . I $D(TDNODE) D TMPCLEAN^PSIVARH1(TDNODE)
  1. . S TDNODE="PSI52.75 DELETE"
  1. . I $D(TPNODE) D TMPCLEAN^PSIVARH1(TPNODE)
  1. . S TPNODE="PSI52.75 PRINT"_" "_$P($H,",")_$P($H,",",2)
  1. .;
  1. . N PSIVLN
  1. . D HEADER(.PSIVLN)
  1. . D:PSGSS="G" GLOOP
  1. . D:PSGSS="W" WLOOP(WRDIEN)
  1. . I RECCNT=0 D Q
  1. .. D NODCD^PSIVARH1("IV room "_$P(SIGNONIV,U,2),$P(HRSFILT,U,3))
  1. .. N X S X=$$ASK(1)
  1. .. S NORECS=1
  1. . Q:PAUSE
  1. . S ACTION=$$ACTION^PSIVARH1()
  1. .;
  1. . Q:"R"[ACTION
  1. . I "P"[ACTION D PRINT Q
  1. . I "D"[ACTION I $$YOURSURE^PSIVARH1() D DELETE(TDNODE) Q
  1. . I "I^"[ACTION S PSIVQT=1 Q
  1. ;
  1. Q
  1. GRSETUP(WG) ; setup vars for group and return -1 if no data
  1. ;
  1. N RETURN,WGRPNM
  1. S RETURN=0
  1. S WGRPNM=$P($G(^PS(57.5,$G(WG),0)),U)
  1. ;
  1. ;quit if the data check reveals that there are no records within the last HRSFILT
  1. ;
  1. I '$$ISDATAG^PSIVARH1(WG) D Q RETURN
  1. . D NODCD^PSIVARH1("ward group "_WGRPNM,$P(HRSFILT,U,3)) S HOLD=$$ASK(1)
  1. . S RETURN=-1
  1. ;
  1. S PSIVWG=WG
  1. S RPTITLE2="IV ROOM: "_$P(SIGNONIV,U,2)_" GROUP: "_$P(^PS(57.5,PSIVWG,0),U)
  1. Q RETURN
  1. WDSETUP(WD) ;
  1. N RETURN
  1. S RETURN=0
  1. S WARD=$P($G(^DIC(42,WD,0)),U)
  1. ;
  1. ; find ward ien its a pointer from file 42
  1. S WRDIEN=+$G(^DIC(42,WD,44))
  1. ;
  1. I '$$ISDATAW^PSIVARH1(WRDIEN) D Q RETURN
  1. . D NODCD^PSIVARH1("ward "_WARD,$P(HRSFILT,U,3))
  1. . S HOLD=$$ASK(1)
  1. . S RETURN=-1
  1. S RPTITLE2="IV ROOM: "_$P(SIGNONIV,U,2)_" WARD: "_WARD
  1. Q RETURN
  1. ;
  1. GLOOP ;Loop through each ward in the group to display records.
  1. ;
  1. N WARD,VWDI
  1. ;
  1. S VWDI=0
  1. F S VWDI=$O(^PS(57.5,WG,1,"B",VWDI)) Q:'VWDI!PSIVQT D
  1. . S WRDIEN=+$G(^DIC(42,VWDI,44))
  1. . I $G(WRDIEN)>0 D
  1. .. S WARD=$P($G(^SC(+WRDIEN,0)),U)
  1. .. D WLOOP(WRDIEN)
  1. Q
  1. WLOOP(WRDIEN) ;
  1. ;ADDED AW NEW COMPOUND INDEX EG
  1. ; ^PS(52.75,"AW","C MEDICINE",3160510.11443,5)=""
  1. ; WARD ROOM DT IEN
  1. N PSIVDA,THISHR
  1. S THISHR=$P(HRSFILT,U,1)
  1. F S THISHR=$O(^PS(52.75,"AW",WRDIEN,THISHR)) Q:'THISHR!PSIVQT D
  1. .S PSIVDA=""
  1. .F S PSIVDA=$O(^PS(52.75,"AW",WRDIEN,THISHR,PSIVDA)) Q:'PSIVDA!PSIVQT D
  1. ..; quit if the data is not there
  1. .. Q:'$D(^PS(52.75,PSIVDA,0))
  1. .. D DISP(.PSIVLN)
  1. .. D PAUSE(.PSIVLN)
  1. Q
  1. DISP(PSIVLN) ;Display data
  1. N PSIVND,PSIVDT,PSIVPN,PSIVPID,PSIVDRN,PSIVRB,PSIVWN,PSIVSIG
  1. N PSIVSS,INTDCDT,ORDERNUM
  1. S PSIVND=^PS(52.75,PSIVDA,0)
  1. S INTDCDT=$P(PSIVND,U) ; fileman internal discontinue/edit date/time
  1. S PSIVDT=$$FMTE^XLFDT($P(PSIVND,U),"5MZP")
  1. N PSIDT,PSITM
  1. ;
  1. S PSIDT=$P(PSIVDT," ",1)
  1. S PSITM=$P(PSIVDT," ",2,3)
  1. S PSIVPN=$P(PSIVND,U,2)
  1. S PSIVPID=$E($P($G(^DPT(PSIVPN,0)),U,9),6,9)
  1. S PSIPNAME=$P($G(^DPT(PSIVPN,0)),U)
  1. S PSIVDRN=$P(PSIVND,U,3)
  1. S PSIVSS=$P(PSIVND,U,10)
  1. S PSIVRB=$P(PSIVND,U,4)
  1. S PSIVSIG=$G(^PS(52.75,PSIVDA,.662))
  1. ;
  1. ; look for IV Room for this order and exclude if not current IV Room
  1. ;
  1. N IVROOM,ROOMIEN
  1. S ORDERNUM=+$P(PSIVND,U,8)
  1. S IVROOM=$$IVROOM(PSIVPN,ORDERNUM)
  1. S ROOMIEN=+IVROOM
  1. Q:(+SIGNONIV'=ROOMIEN)
  1. ;
  1. ; count the records that match current IV room. In case there are
  1. ; none RECORD=0, then don't display action prompt and give user
  1. ; message that there aren't any records for the signed on IV Room
  1. ;
  1. S RECCNT=RECCNT+1
  1. ;
  1. ;count display lines for pagination
  1. ;
  1. S PSIVLN=PSIVLN+2
  1. ;
  1. ; display the data and save a ^TMP version of entries to Print and entries to delete.
  1. ;
  1. D DISPLINE(WARD,PSIVRB,PSIVDRN,PSIPNAME,PSIVPID,PSIDT,PSIVSIG,PSITM,PSIVSS)
  1. D SAVELINE(WRDIEN,WARD,PSIVRB,PSIVDRN,PSIPNAME,PSIVPID,PSIDT,PSIVSIG,PSITM,THISHR,PSIVDA,PSIVSS)
  1. ;
  1. Q
  1. ;
  1. IVROOM(PHPTIEN,ORDERNUM) ;
  1. ; return IV Room for this dc or edit order
  1. ; returns 2 piece--IEN of IV Room ^ display name of IV room
  1. ;
  1. N IVROOMEX,IVRMIEN
  1. S (IVROOMEX,IVRMIEN)=""
  1. I $G(PHPTIEN)>0&($G(ORDERNUM)>0) S IVRMIEN=$P($G(^PS(55,PHPTIEN,"IV",ORDERNUM,2)),U,2)
  1. I IVRMIEN>0 S IVROOMEX=$P($G(^PS(59.5,IVRMIEN,0)),U)
  1. Q IVRMIEN_U_IVROOMEX
  1. ;
  1. DISPLINE(WARD,PSIVRB,PSIVDRN,PSIPNAME,PSIVPID,PSIDT,PSIVSIG,PSITM,PSIVSS) ;
  1. ;Display a single line of the data
  1. ;
  1. W !?1,$E(WARD,1,9) ; ward name
  1. W ?12,$E(PSIVRB,1,8) ; room-bed
  1. I $G(PSIVDRN)>0 W ?21,$E($P(^PS(50.7,PSIVDRN,0),U),1,18)
  1. W ?42,$E(PSIPNAME,1,15) ; patient name
  1. W ?59,PSIVPID ; patient L4
  1. W ?64,PSIDT ; date/time .01
  1. S PSIVSS=$S(PSIVSS="XO":"Edited",PSIVSS="DC":"Discontinued",1:"")
  1. W !?3,$G(PSIVSS),?22,$E(PSIVSIG,1,42),?65,"@",PSITM
  1. Q
  1. ;
  1. ;
  1. SAVELINE(WRDIEN,WARD,PSIVRB,PSIVDRN,PSIPNAME,PSIVPID,PSIDT,PSIVSIG,PSITM,THISHR,PSIVDA,PSIVSTS) ;
  1. ;save last displayed record in case we need to protect remaining records from deletion
  1. ;
  1. S ^TMP(TDNODE,$J,WRDIEN,THISHR,PSIVDA)=""
  1. ;
  1. S ^TMP(TPNODE,$J,WRDIEN,THISHR,PSIVDA)=WARD_U_PSIVRB_U_PSIVDRN_U_PSIPNAME_U_PSIVPID_U_PSIDT_U_PSIVSIG_U_PSITM_U_PSIVSTS
  1. Q
  1. ;
  1. PRINT ;
  1. ;
  1. N PFLAGDEL ; flag based on users response to whether they want to delete or retain after printing
  1. S PFLAGDEL=$$PFLAGDEL() Q:PFLAGDEL<0
  1. ;
  1. N HOLD W !!,"Only data that you have viewed will be printed." S HOLD=$$ASK(1)
  1. N %ZIS,POP,IOP
  1. S %ZIS="MQ"
  1. D ^%ZIS
  1. Q:POP
  1. I $D(IO("Q")) D
  1. . K IO("Q")
  1. . N ZTDESC,ZTRTN,ZTSAVE
  1. . S ZTDESC=RPTITLE1_"-"_RPTITLE2
  1. . S ZTRTN="PRINT1^PSIVARH"
  1. . S ZTSAVE("^TMP(TPNODE,$J,")=""
  1. . S ZTSAVE("TPNODE")=""
  1. . S ZTSAVE("RPTITLE1")=""
  1. . S ZTSAVE("RPTITLE2")=""
  1. . D ^%ZTLOAD
  1. . I $D(ZTSK) D
  1. .. S ZTREQ="@"
  1. .. W !,"Your task number is ",ZTSK," and it has been queued."
  1. . E D
  1. .. W !,"Your task was NOT queued."
  1. E D
  1. . U IO
  1. . D PRINT1
  1. D ^%ZISC K %ZIS,IOP
  1. S HOLD=$$ASK(1)
  1. I PFLAGDEL D DELETE(TDNODE)
  1. Q
  1. ;
  1. PRINT1 ;
  1. ;
  1. ;print records that were viewed and stored in the TMP global
  1. ;
  1. ; S ^TMP("PSI DEL ENTRIES 52.75",1756,77,3160512.143021,9)=
  1. ; => "C MEDICINE^9999^2032^AAADTSXY,QLYJH U^M^2470203^E^2^^PASTOR
  1. ; => ^25^101074507^RCD RCVD FM ROSEBURG OR, 072790-JWR^WOLVINGTON
  1. ; => ^27^^3^331^2900712^^^^1^4507^05/12/2016^Give: IV 4 ml/hr^2:30 pm"
  1. ;
  1. N WDIEN,ODATA,WARD,PSIVRB,PSIVDRN,PSIPNAME,PSIVPID,PSIDT,PSIVSIG,PSITM,LCNT,PSIVSS
  1. S LCNT=0
  1. D HEADER(.LCNT)
  1. ;
  1. S (PSIVQT,WDIEN)=0
  1. F S WDIEN=$O(^TMP(TPNODE,$J,WDIEN)) Q:(WDIEN'>0)!PSIVQT D
  1. . S ODT=0
  1. . F S ODT=$O(^TMP(TPNODE,$J,WDIEN,ODT)) Q:(ODT'>0)!PSIVQT D
  1. .. S OIEN=0
  1. .. F S OIEN=$O(^TMP(TPNODE,$J,WDIEN,ODT,OIEN)) Q:(OIEN'>0)!PSIVQT D
  1. ... I OIEN>0 D
  1. .... S ODATA=$G(^TMP(TPNODE,$J,WDIEN,ODT,OIEN))
  1. .... S WARD=$P(ODATA,U)
  1. .... S PSIVRB=$P(ODATA,U,2)
  1. .... S PSIVDRN=$P(ODATA,U,3)
  1. .... S PSIPNAME=$P(ODATA,U,4)
  1. .... S PSIVPID=$P(ODATA,U,5)
  1. .... S PSIDT=$P(ODATA,U,6)
  1. .... S PSIVSIG=$P(ODATA,U,7)
  1. .... S PSITM=$P(ODATA,U,8)
  1. .... S PSIVSS=$P(ODATA,U,9)
  1. .... D DISPLINE(WARD,PSIVRB,PSIVDRN,PSIPNAME,PSIVPID,PSIDT,PSIVSIG,PSITM,PSIVSS)
  1. .... S LCNT=LCNT+2
  1. .... D PAUSE(.LCNT)
  1. W !,"END OF REPORT.",!
  1. ;
  1. ;clean up print node if the print job was queued
  1. ;
  1. D:$D(ZTSK) TMPCLEAN^PSIVARH1(TPNODE)
  1. Q
  1. ;
  1. PFLAGDEL() ; ask user whether to delete after printing.
  1. N DIR,DUOUT,DTOUT,DIROUT,DIRUT,X,Y
  1. S DIR("B")="N"
  1. S DIR(0)="Y",DIR("A")="Do you also want to delete the records that you are printing"
  1. S DIR("?")="Answer yes to remove the discontinued orders tracking entries after printing."
  1. S DIR("?",1)="The records you have viewed are from a temporary tracking file"
  1. S DIR("?",2)="and they can be deleted without any impact to the orders file."
  1. D ^DIR
  1. I $D(DIRUT) Q -1
  1. Q Y
  1. ;
  1. DELETE(NODE) ;
  1. ;
  1. N DIK,WDIEN,ODT,OIEN,DA,HOLD
  1. S DIK="^PS(52.75,"
  1. S WDIEN=0
  1. F S WDIEN=$O(^TMP(NODE,$J,WDIEN)) Q:(WDIEN'>0)!PSIVQT D
  1. . S ODT=0
  1. . F S ODT=$O(^TMP(NODE,$J,WDIEN,ODT)) Q:(ODT'>0)!PSIVQT D
  1. .. S OIEN=0
  1. .. F S OIEN=$O(^TMP(NODE,$J,WDIEN,ODT,OIEN)) Q:OIEN'>0 D
  1. ... S DA=OIEN D ^DIK
  1. ... I $E(IOST,1,2)="C-" W "."
  1. I $E(IOST,1,2)="C-" D
  1. . W !," Records which you have viewed or printed from"
  1. . W !," the temporary file--IV MEDICATION ORDERS DC'D (#52.75)"
  1. . W !," have been removed."
  1. . S HOLD=$$ASK(1)
  1. Q
  1. N PSIVI
  1. S $P(PSIVI,"-",80)=""
  1. S PSIVLN=4
  1. W @IOF,!,?(IOM-$L(RPTITLE1))\2,RPTITLE1
  1. W !,?(IOM-$L(RPTITLE2))\2,RPTITLE2
  1. W !?1,"WARD - ROOM/BED",?22,"DRUG",?42,"PATIENT",?59,"PID",?65,"DT/TM",!,PSIVI,!
  1. Q
  1. ;
  1. ASK(HOLD) ;ask user 2 continue function
  1. ;return true (1) if user want's 2 stop, false (0) 2 continue.
  1. ;If HOLD defined, use prompt 2 hold display until user hits return.
  1. ;If not terminal then, do nothing, return FALSE.
  1. ;
  1. N STOP S STOP=0
  1. I $E(IOST,1,2)="C-" D
  1. .;
  1. . N RESP,DIR S RESP=0
  1. . I $G(HOLD) S DIR(0)="EA",DIR("A")="Enter return to continue. "
  1. . E S DIR(0)="E"
  1. . D ^DIR I Y="" S STOP=0
  1. . I $D(DIRUT) S STOP=1
  1. Q STOP
  1. ;
  1. PAUSE(PSIVLN) ;Btw screens
  1. ;not to bottom of page yet so don't do anything
  1. Q:'(($G(PSIVLN)+4)>$G(IOSL))
  1. ;
  1. I $E(IOST,1,2)="C-" D
  1. . S PSIVQT=$$ASK()
  1. Q:PSIVQT
  1. D HEADER(.PSIVLN)
  1. Q
  1. ;
  1. TURNOFF(VALUE) ;entry point called from IV room Input transform field 21
  1. ;
  1. Q:$G(VALUE)>0 0
  1. N SURE,Y,X
  1. S SURE=$$SURE^PSIVARH1()
  1. I SURE D CLEAN^PSIVARH1
  1. Q 'SURE
  1. ;
  1. EXIT D ^%ZISC
  1. K PSIVRM,PSIVWD,WARD
  1. ;
  1. ; user can print, delete, or print and delete. if the print is queued,
  1. ; then the print logic cleans up TMP, otherwise we need to clean it up
  1. ; now.
  1. ;
  1. D TMPCLEAN^PSIVARH1(TDNODE)
  1. D TMPCLEAN^PSIVARH1(TPNODE)
  1. Q
  1. ;