VENPCCOH ; IHS/OIT/GIS - DISPLAY VEN OPTION HEADER ;
;;2.6;PCC+;;NOV 12, 2007
;
; DON'S LAST CODE
;
START ;
;
NEW VENZLINE,VENZTITL,VENZUNL,VENZUSR,VENZVER
I '$D(IORVON) S X="IORVON;IORVOFF" D ENDR^%ZISS
S VENZTITL=$E($P($G(XQY0),U,2),1,45) S:VENZTITL="" VENZTITL="* NO TITLE AVAILABLE *"
S VENZVER=$P($P($T(VENPCCOH+1),";;",2),";")
;I $G(^RA("VERSION"))'=VENZVER S ^RA("VERSION")=VENZVER ;keep them in sync
S VENZUSR=$E($$USR(),1,20)
S VENZLINE="ILC ENC FORM/HLTH SUMMARY V"_VENZVER_": "_IORVON_VENZTITL_IORVOFF
W:$D(IOF) @IOF
W !,VENZLINE,!
W "LOCATION: "_$$LOC(),?50,"USER: "_VENZUSR,!
S VENZUNL="",$P(VENZUNL,"-",80)="-"
W VENZUNL,!
Q
;
;----------
CTR(X,Y) ;EP-Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
LJRF(X,Y,Z) ;EP-left justify X in a field Y wide, right filling with Z.
NEW L,M
I $L(X)'<Y Q $E(X,1,Y-1)_Z
S L=Y-$L(X)
S $P(M,Z,L)=Z
Q X_M
;----------
USR() ;EP-Return name of current user from ^VA(200.
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;----------
LOC() ;EP-Return location name from file 4 based on DUZ(2).
Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
;
VENPCCOH ; IHS/OIT/GIS - DISPLAY VEN OPTION HEADER ;
+1 ;;2.6;PCC+;;NOV 12, 2007
+2 ;
+3 ; DON'S LAST CODE
+4 ;
START ;
+1 ;
+2 NEW VENZLINE,VENZTITL,VENZUNL,VENZUSR,VENZVER
+3 IF '$DATA(IORVON)
SET X="IORVON;IORVOFF"
DO ENDR^%ZISS
+4 SET VENZTITL=$EXTRACT($PIECE($GET(XQY0),U,2),1,45)
IF VENZTITL=""
SET VENZTITL="* NO TITLE AVAILABLE *"
+5 SET VENZVER=$PIECE($PIECE($TEXT(VENPCCOH+1),";;",2),";")
+6 ;I $G(^RA("VERSION"))'=VENZVER S ^RA("VERSION")=VENZVER ;keep them in sync
+7 SET VENZUSR=$EXTRACT($$USR(),1,20)
+8 SET VENZLINE="ILC ENC FORM/HLTH SUMMARY V"_VENZVER_": "_IORVON_VENZTITL_IORVOFF
+9 IF $DATA(IOF)
WRITE @IOF
+10 WRITE !,VENZLINE,!
+11 WRITE "LOCATION: "_$$LOC(),?50,"USER: "_VENZUSR,!
+12 SET VENZUNL=""
SET $PIECE(VENZUNL,"-",80)="-"
+13 WRITE VENZUNL,!
+14 QUIT
+15 ;
+16 ;----------
CTR(X,Y) ;EP-Center X in a field Y wide.
+1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
+2 ;----------
LJRF(X,Y,Z) ;EP-left justify X in a field Y wide, right filling with Z.
+1 NEW L,M
+2 IF $LENGTH(X)'<Y
QUIT $EXTRACT(X,1,Y-1)_Z
+3 SET L=Y-$LENGTH(X)
+4 SET $PIECE(M,Z,L)=Z
+5 QUIT X_M
+6 ;----------
USR() ;EP-Return name of current user from ^VA(200.
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;----------
LOC() ;EP-Return location name from file 4 based on DUZ(2).
+1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
+2 ;