ORWTIU ; slc/REV - Functions for GUI PARAMETER ACTIONS ; 08 Feb 2001 09:02AM
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,109,132,195,243**;Dec 17, 1997;Build 242
;
GTTIUCTX(Y,ORUSER) ; Returns current Notes view context for user
N OCCLIM,SHOWSUB
S Y=$$GET^XPAR("ALL","ORCH CONTEXT NOTES",1)
I +$P(Y,";",5)=0 D
. S OCCLIM=$P($$PERSPRF^TIULE(DUZ),U,10)
. S:+OCCLIM>0 $P(Y,";",5)=OCCLIM
S SHOWSUB=$P(Y,";",6)
S $P(Y,";",6)=$S(SHOWSUB'="":SHOWSUB,1:0)
Q
SVTIUCTX(Y,ORCTXT) ; Save new Notes view preferences for user
N TMP
S TMP=$$GET^XPAR(DUZ_";VA(200,","ORCH CONTEXT NOTES",1)
I TMP'="" D Q
. D CHG^XPAR(DUZ_";VA(200,","ORCH CONTEXT NOTES",1,ORCTXT)
D ADD^XPAR(DUZ_";VA(200,","ORCH CONTEXT NOTES",1,ORCTXT)
Q
;
GTDCCTX(Y,ORUSER) ; Returns current DC Summary view context for user
N OCCLIM,SHOWSUB
S Y=$$GET^XPAR("ALL","ORCH CONTEXT SUMMRIES",1)
I +$P(Y,";",5)=0 D
. S OCCLIM=$P($$PERSPRF^TIULE(DUZ),U,10)
. S:+OCCLIM>0 $P(Y,";",5)=OCCLIM
S SHOWSUB=$P(Y,";",6)
S $P(Y,";",6)=$S(SHOWSUB'="":SHOWSUB,1:0)
Q
SVDCCTX(Y,ORCTXT) ; Save new DC Summary view preferences for user
N TMP
S TMP=$$GET^XPAR(DUZ_";VA(200,","ORCH CONTEXT SUMMRIES",1)
I TMP'="" D Q
. D CHG^XPAR(DUZ_";VA(200,","ORCH CONTEXT SUMMRIES",1,ORCTXT)
D ADD^XPAR(DUZ_";VA(200,","ORCH CONTEXT SUMMRIES",1,ORCTXT)
Q
;
PRINTW(ORY,ORDA,ORFLG) ;TIU print to windows printer
N ZTQUEUED,ORHFS,ORSUB,ORIO,ORSTATUS,ROOT,ORERR,ORWIN,ORHANDLE
N IOM,IOSL,IOST,IOF,IOT,IOS
S (ORSUB,ROOT)="ORDATA",ORIO="OR WINDOWS HFS",ORWIN=1,ORHANDLE="ORWTIU"
S ORY=$NA(^TMP(ORSUB,$J,1))
S ORHFS=$$HFS^ORWRP()
D HFSOPEN^ORWRP(ORHANDLE,ORHFS,"W")
I POP D Q
. I $D(ROOT) D SETITEM^ORWRP(.ROOT,"ERROR: Unable to open HFS file for TIU print")
D IOVAR^ORWRP(.ORIO,,,"P-WINHFS80")
N $ETRAP,$ESTACK
S $ETRAP="D ERR^ORWRP Q"
U IO
D RPC^TIUPD(.ORERR,ORDA,ORIO,ORFLG,ORWIN)
D HFSCLOSE^ORWRP(ORHANDLE,ORHFS)
Q
GTLSTITM(ORY,ORTIUDA) ; Return single listbox item for document
Q:+$G(ORTIUDA)=0
S ORY=ORTIUDA_U_$$RESOLVE^TIUSRVLO(ORTIUDA)
Q
IDNOTES(ORY) ; Is ID Notes installed?
S ORY=$$PATCH^XPDUTL("TIU*1.0*100")
Q
CANLINK(ORY,ORTITLE) ;Can the title be an ID child?
; DBIA #2322
S ORY=$$CANLINK^TIULP(ORTITLE)
Q
GETCP(ORY,ORTIUDA) ; Checks required CP fields before signature
S ORY=""
N ORTITLE,ORAUTH,ORCOS,ORPSUMCD,ORPROCDT,ORROOT,ORERR,ORREFDT
S ORERR="",ORROOT=$NA(^TMP("ORTIU",$J))
D EXTRACT^TIULQ(ORTIUDA,.ORROOT,.ORERR,".01;1202;1208;70201;70202;1301",,,"I")
S ORTITLE=@ORROOT@(ORTIUDA,".01","I")
S ORAUTH=@ORROOT@(ORTIUDA,"1202","I")
S ORCOS=@ORROOT@(ORTIUDA,"1208","I")
S ORPSUMCD=@ORROOT@(ORTIUDA,"70201","I")
S ORPROCDT=@ORROOT@(ORTIUDA,"70202","I")
S ORREFDT=@ORROOT@(ORTIUDA,"1301","I")
S ORY=ORAUTH_U_ORCOS_U_ORPSUMCD_U_ORPROCDT_U_ORTITLE_U_ORREFDT
K @ORROOT
Q
CHKTXT(ORY,ORTIUDA) ; Checks for presence of text before signature
S ORY='$$EMPTYDOC^TIULF(ORTIUDA) ;DBIA #4426
Q
ORWTIU ; slc/REV - Functions for GUI PARAMETER ACTIONS ; 08 Feb 2001 09:02AM
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,109,132,195,243**;Dec 17, 1997;Build 242
+2 ;
GTTIUCTX(Y,ORUSER) ; Returns current Notes view context for user
+1 NEW OCCLIM,SHOWSUB
+2 SET Y=$$GET^XPAR("ALL","ORCH CONTEXT NOTES",1)
+3 IF +$PIECE(Y,";",5)=0
Begin DoDot:1
+4 SET OCCLIM=$PIECE($$PERSPRF^TIULE(DUZ),U,10)
+5 IF +OCCLIM>0
SET $PIECE(Y,";",5)=OCCLIM
End DoDot:1
+6 SET SHOWSUB=$PIECE(Y,";",6)
+7 SET $PIECE(Y,";",6)=$SELECT(SHOWSUB'="":SHOWSUB,1:0)
+8 QUIT
SVTIUCTX(Y,ORCTXT) ; Save new Notes view preferences for user
+1 NEW TMP
+2 SET TMP=$$GET^XPAR(DUZ_";VA(200,","ORCH CONTEXT NOTES",1)
+3 IF TMP'=""
Begin DoDot:1
+4 DO CHG^XPAR(DUZ_";VA(200,","ORCH CONTEXT NOTES",1,ORCTXT)
End DoDot:1
QUIT
+5 DO ADD^XPAR(DUZ_";VA(200,","ORCH CONTEXT NOTES",1,ORCTXT)
+6 QUIT
+7 ;
GTDCCTX(Y,ORUSER) ; Returns current DC Summary view context for user
+1 NEW OCCLIM,SHOWSUB
+2 SET Y=$$GET^XPAR("ALL","ORCH CONTEXT SUMMRIES",1)
+3 IF +$PIECE(Y,";",5)=0
Begin DoDot:1
+4 SET OCCLIM=$PIECE($$PERSPRF^TIULE(DUZ),U,10)
+5 IF +OCCLIM>0
SET $PIECE(Y,";",5)=OCCLIM
End DoDot:1
+6 SET SHOWSUB=$PIECE(Y,";",6)
+7 SET $PIECE(Y,";",6)=$SELECT(SHOWSUB'="":SHOWSUB,1:0)
+8 QUIT
SVDCCTX(Y,ORCTXT) ; Save new DC Summary view preferences for user
+1 NEW TMP
+2 SET TMP=$$GET^XPAR(DUZ_";VA(200,","ORCH CONTEXT SUMMRIES",1)
+3 IF TMP'=""
Begin DoDot:1
+4 DO CHG^XPAR(DUZ_";VA(200,","ORCH CONTEXT SUMMRIES",1,ORCTXT)
End DoDot:1
QUIT
+5 DO ADD^XPAR(DUZ_";VA(200,","ORCH CONTEXT SUMMRIES",1,ORCTXT)
+6 QUIT
+7 ;
PRINTW(ORY,ORDA,ORFLG) ;TIU print to windows printer
+1 NEW ZTQUEUED,ORHFS,ORSUB,ORIO,ORSTATUS,ROOT,ORERR,ORWIN,ORHANDLE
+2 NEW IOM,IOSL,IOST,IOF,IOT,IOS
+3 SET (ORSUB,ROOT)="ORDATA"
SET ORIO="OR WINDOWS HFS"
SET ORWIN=1
SET ORHANDLE="ORWTIU"
+4 SET ORY=$NAME(^TMP(ORSUB,$JOB,1))
+5 SET ORHFS=$$HFS^ORWRP()
+6 DO HFSOPEN^ORWRP(ORHANDLE,ORHFS,"W")
+7 IF POP
Begin DoDot:1
+8 IF $DATA(ROOT)
DO SETITEM^ORWRP(.ROOT,"ERROR: Unable to open HFS file for TIU print")
End DoDot:1
QUIT
+9 DO IOVAR^ORWRP(.ORIO,,,"P-WINHFS80")
+10 NEW $ETRAP,$ESTACK
+11 SET $ETRAP="D ERR^ORWRP Q"
+12 USE IO
+13 DO RPC^TIUPD(.ORERR,ORDA,ORIO,ORFLG,ORWIN)
+14 DO HFSCLOSE^ORWRP(ORHANDLE,ORHFS)
+15 QUIT
GTLSTITM(ORY,ORTIUDA) ; Return single listbox item for document
+1 IF +$GET(ORTIUDA)=0
QUIT
+2 SET ORY=ORTIUDA_U_$$RESOLVE^TIUSRVLO(ORTIUDA)
+3 QUIT
IDNOTES(ORY) ; Is ID Notes installed?
+1 SET ORY=$$PATCH^XPDUTL("TIU*1.0*100")
+2 QUIT
CANLINK(ORY,ORTITLE) ;Can the title be an ID child?
+1 ; DBIA #2322
+2 SET ORY=$$CANLINK^TIULP(ORTITLE)
+3 QUIT
GETCP(ORY,ORTIUDA) ; Checks required CP fields before signature
+1 SET ORY=""
+2 NEW ORTITLE,ORAUTH,ORCOS,ORPSUMCD,ORPROCDT,ORROOT,ORERR,ORREFDT
+3 SET ORERR=""
SET ORROOT=$NAME(^TMP("ORTIU",$JOB))
+4 DO EXTRACT^TIULQ(ORTIUDA,.ORROOT,.ORERR,".01;1202;1208;70201;70202;1301",,,"I")
+5 SET ORTITLE=@ORROOT@(ORTIUDA,".01","I")
+6 SET ORAUTH=@ORROOT@(ORTIUDA,"1202","I")
+7 SET ORCOS=@ORROOT@(ORTIUDA,"1208","I")
+8 SET ORPSUMCD=@ORROOT@(ORTIUDA,"70201","I")
+9 SET ORPROCDT=@ORROOT@(ORTIUDA,"70202","I")
+10 SET ORREFDT=@ORROOT@(ORTIUDA,"1301","I")
+11 SET ORY=ORAUTH_U_ORCOS_U_ORPSUMCD_U_ORPROCDT_U_ORTITLE_U_ORREFDT
+12 KILL @ORROOT
+13 QUIT
CHKTXT(ORY,ORTIUDA) ; Checks for presence of text before signature
+1 ;DBIA #4426
SET ORY='$$EMPTYDOC^TIULF(ORTIUDA)
+2 QUIT