ORWGAPIP ; SLC/STAFF - Graph Parameters ;11/20/06 08:59
;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,260,243**;Dec 17, 1997;Build 242
;
ALLVIEWS(DATA,VTYPE,USER) ; from ORWGAPI
N CNT,ENT,NUM,NUM1,PARAM,PROF,RESULT,TEST,TG,TGNUM,TGNAME,TMP,VIEW,VNUM K PROF,VIEW
D RETURN^ORWGAPIW(.TMP,.DATA)
S CNT=0
I VTYPE=-2 D
. S ENT="SYS"
. S USER=0
I VTYPE=-1 D
. S ENT="USR"
. I USER S ENT="USR.`"_USER
I VTYPE=-3 D Q
. ;LAB GROUPS
. I 'USER S USER=DUZ
. D TG^ORWLRR(.PROF,USER)
. S NUM=0
. F S NUM=$O(PROF(NUM)) Q:NUM<1 D
.. S TG=PROF(NUM)
.. S TGNUM=+TG
.. S TGNAME=$P(TG,U,2)
.. ;I TGNAME[") " S TGNAME=$P(TGNAME,") ",2,99)
.. S VNUM=CNT+1
.. S RESULT="-3^V^"_VNUM_U_TGNAME_"^^^"_USER
.. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
.. K VIEW
.. D ATG^ORWLRR(.VIEW,TGNUM,USER)
.. S NUM1=0
.. F S NUM1=$O(VIEW(NUM1)) Q:NUM1<1 D
... S TEST=VIEW(NUM1)
... S RESULT="-3^C^"_VNUM_U_$P(TEST,U,2)_"^63^"_+TEST_U
... D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
D XGETLST^ORWGAPIX(.PROF,ENT,"ORWG GRAPH VIEW")
S NUM=0
F S NUM=$O(PROF(NUM)) Q:NUM<1 D
. S PARAM=$P(PROF(NUM),U)
. S VNUM=CNT+1
. S RESULT=VTYPE_"^V^"_VNUM_U_PARAM_"^^^"_USER
. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
. K VIEW
. D XGETWP^ORWGAPIX(.VIEW,ENT,"ORWG GRAPH VIEW",PARAM)
. D DEFVIEWS(.DATA,.VIEW,VTYPE,VNUM,TMP,.CNT)
Q
;
DATES(DAT,REPORTID) ; from ORWGAPI
N BEGIN,END,INFO,NEXT,PARAM1,PARAM2,RPT,START,STOP
S RPT=+$O(^ORD(101.24,"AC",+$G(REPORTID),0))
I 'RPT Q ; RPT=1150 is exported graph report
S PARAM1=$P($G(^ORD(101.24,RPT,2)),U)
S PARAM2=$P($G(^ORD(101.24,RPT,2)),U,2)
S INFO=$$XGET^ORWGAPIX("ALL","ORWRP TIME/OCC LIMITS INDV",RPT,"I")
S BEGIN=$P(INFO,";"),START=$$DATE^ORWGAPIX(BEGIN)
S END=$P(INFO,";",2),STOP=$$DATE^ORWGAPIX(END)
I START<1 Q
I STOP<1 Q
S NEXT=1+$O(DAT(""),-1)
S DAT(NEXT)=U_BEGIN_" to "_END_"^^^"_INFO_U_START_U_STOP_U_PARAM1_U_PARAM2
Q
;
DEFVIEWS(DATA,VIEW,VTYPE,VNUM,TMP,CNT) ;
N FIRST,NUM,PIECE,RESULT,RESULT1,SECOND,VALUE
S NUM=""
F S NUM=$O(VIEW(NUM)) Q:NUM="" D
. S RESULT=$G(VIEW(NUM,0))
. S PIECE=0
. F S PIECE=PIECE+1 S VALUE=$P(RESULT,"|",PIECE) D:$L(VALUE) Q:'$L($P(RESULT,"|",PIECE+1,999))
.. S FIRST=$P(VALUE,"~"),SECOND=$P(VALUE,"~",2)
.. I FIRST=0 D
... I $E(SECOND,1,5)="63AP;" S RESULT1=VTYPE_"^C^"_VNUM_U_"Anatomic Path: "_$$ITEMPRFX^ORWGAPIU($E(SECOND,3,6))_" <any>"_U_SECOND_"^0^" Q
... I $E(SECOND,1,5)="63MI;" S RESULT1=VTYPE_"^C^"_VNUM_U_"Microbiology: "_$$ITEMPRFX^ORWGAPIU($E(SECOND,3,6))_" <any>"_U_SECOND_"^0^" Q
... S RESULT1=VTYPE_"^C^"_VNUM_U_$$FILENAME^ORWGAPIT(SECOND)_" <any>"_U_SECOND_"^0^"
.. I FIRST'=0 S RESULT1=VTYPE_"^C^"_VNUM_U_$$EVALUE^ORWGAPIU(SECOND,FIRST)_U_FIRST_U_SECOND_U
.. D SETUP^ORWGAPIW(.DATA,RESULT1,TMP,.CNT)
Q
;
DELVIEWS(DATA,NAME,PUBLIC) ; from ORWGAPI
N ERR,TMP
D RETURN^ORWGAPIW(.TMP,.DATA)
S ERR=0
I '$L(NAME) S ERR=1
I 'ERR D
. S NAME=$$UP^ORWGAPIX(NAME)
. I PUBLIC D XDEL^ORWGAPIX("SYS","ORWG GRAPH VIEW",NAME,.ERR)
. I 'PUBLIC D XDEL^ORWGAPIX("USR","ORWG GRAPH VIEW",NAME,.ERR)
I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
I 'TMP S DATA=ERR,DATA(1)=ERR
Q
;
GETPREF(DATA) ; from ORWGAPI
N CNT,NUM,PROF,RESULT,TMP,VAL K PROF
I '$O(^PXRMINDX(63,"PI","")) Q ; graphing is not used if no indexes
S VAL=$$XGET^ORWGAPIX("PKG","ORWG GRAPH SETTING",1,"I")
I '$L(VAL) Q ; graphing not used if no pkg param on settings
D RETURN^ORWGAPIW(.TMP,.DATA)
S PROF(2)=1
I '$L($G(^XTMP("ORGRAPH",0))) S PROF(2)=-1
S VAL=$$XGET^ORWGAPIX("DIV^SYS^PKG","ORWG GRAPH SETTING",1,"I")
S PROF(1)=VAL
S VAL=$$XGET^ORWGAPIX("ALL","ORWG GRAPH SETTING",1,"I")
S PROF(0)=VAL
S CNT=0
S NUM=""
F S NUM=$O(PROF(NUM)) Q:NUM="" D
. S RESULT=$G(PROF(NUM))
. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
Q
;
GETSIZE(DATA) ; from ORWGAPI
N CNT,NUM,PROF,RESULT,TMP K PROF
D RETURN^ORWGAPIW(.TMP,.DATA)
D XGETLST^ORWGAPIX(.PROF,"USR","ORWG GRAPH SIZING")
S CNT=0
S NUM=""
F S NUM=$O(PROF(NUM)) Q:NUM="" D
. S RESULT=$G(PROF(NUM))
. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
Q
;
;GETVIEWS(DATA,ALL,PUBLIC,EXT,USER) ; from ORWGAPI
;N CNT,NUM,PROF,RESULT,TMP,USERPRM K PROF
;D RETURN^ORWGAPIW(.TMP,.DATA)
;I PUBLIC D
;. I ALL=1 D XGETLST^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW") ; get list of public views
;. I ALL'=1 D XGETWP^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW",ALL) ; get a public view definition
;I 'PUBLIC D
;. S USERPRM="USR"
;. I USER S USERPRM="USR.`"_USER
;. I ALL=1 D XGETLST^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW") ; get list of personal views
;. I ALL'=1 D XGETWP^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW",ALL) ; get a personal view definition
;S CNT=0
;I 'EXT D Q
;. S NUM=""
;. F S NUM=$O(PROF(NUM)) Q:NUM="" D
;.. I ALL=1 S RESULT=$P($G(PROF(NUM)),U)
;.. I ALL'=1 S RESULT=$G(PROF(NUM,0))
;.. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
;D DEFVIEWS(.DATA,.PROF,"",TMP,.CNT)
;Q
;
GETVIEWS(DATA,ALL,PUBLIC,EXT,USER) ; from ORWGAPI
N CNT,FIRST,NUM,PIECE,PROF,RESULT,RESULT1,SECOND,TMP,VALUE K PROF
D RETURN^ORWGAPIW(.TMP,.DATA)
I PUBLIC D
. I ALL=1 D XGETLST^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW") ; get list of public views
. I ALL'=1 D XGETWP^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW",ALL) ; get a public view definition
I 'PUBLIC D
. S USERPRM="USR"
. I USER S USERPRM="USR.`"_USER
. I ALL=1 D XGETLST^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW") ; get list of personal views
. I ALL'=1 D XGETWP^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW",ALL) ; get a personal view definition
S CNT=0
I 'EXT D Q
. S NUM=""
. F S NUM=$O(PROF(NUM)) Q:NUM="" D
.. I ALL=1 S RESULT=$P($G(PROF(NUM)),U)
.. I ALL'=1 S RESULT=$G(PROF(NUM,0))
.. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
S NUM=""
F S NUM=$O(PROF(NUM)) Q:NUM="" D
. S RESULT=$G(PROF(NUM,0))
. S PIECE=0
. F S PIECE=PIECE+1 S VALUE=$P(RESULT,"|",PIECE) D:$L(VALUE) Q:'$L($P(RESULT,"|",PIECE+1,999))
.. S FIRST=$P(VALUE,"~"),SECOND=$P(VALUE,"~",2)
.. I FIRST=0 S CNT=CNT+1,RESULT1="0^"_SECOND_U_$$FILENAME^ORWGAPIT(SECOND)_" <any>"
.. I FIRST'=0 S CNT=CNT+1,RESULT1=FIRST_U_SECOND_U_$$EVALUE^ORWGAPIU(SECOND,FIRST)
.. D SETUP^ORWGAPIW(.DATA,RESULT1,TMP,.CNT)
Q
;
INISET ; from ORWGAPIU initial setup of package parameters
N ERR,RPTNUM
S RPTNUM=1150
D SETPREF(.ERR,"63;53.79;55;55NVA;52;70;120.5|BCEFGHIKN|1|4|90|1|100||",9) ; default public settings
I '$D(^ORD(101.24,RPTNUM,0)) D ; make sure report has been added
. L +^ORD(101.24,0):20 I '$T Q
. S $P(^ORD(101.24,0),U,3)=RPTNUM,$P(^(0),U,4)=$P(^(0),U,4)+1
. S ^ORD(101.24,RPTNUM,0)="ORWG GRAPHING^OR_GRAPHS^^2^^^1^R^^^^G^^T"
. S ^ORD(101.24,RPTNUM,2)="^^Graphing (local only)^Graphing"
. L -^ORD(101.24,0)
. D INDEX^ORWGAPIX("^ORD(101.24,",RPTNUM)
D XEN^ORWGAPIX("PKG","ORWRP REPORT LIST",12,RPTNUM)
Q
;
PUBLIC(USER) ; from ORWGAPI
N ERR,IDX,ORSRV,USRCLASS,VAL K USRCLASS
S VAL=0
I '$G(USER) Q VAL
S ORSRV=$$GET1^DIQ(200,DUZ,29,"I")
D XGETLST1^ORWGAPIX(.USRCLASS,"SYS","ORWG GRAPH PUBLIC EDITOR CLASS","Q",.ERR)
I ERR Q VAL
S IDX=0
F S IDX=$O(USRCLASS(IDX)) Q:'IDX D Q:VAL
. I $$ISA^ORWGAPIA(USER,$P(USRCLASS(IDX),U,2),.ERR) S VAL=1
Q VAL
;
RPTPARAM(IEN) ; from ORWGAPI
N DATES,NODE,VAL
S IEN=+$G(IEN)
S VAL=""
S NODE=$$UP^XLFSTR($P($G(^ORD(101.24,IEN,2)),U,1,2))
I $L(NODE)<2 Q VAL
Q NODE
;
SETPREF(DATA,VAL,PUBLIC) ; from ORWGAPI
N ERR,TMP
D RETURN^ORWGAPIW(.TMP,.DATA)
S ERR=0
I '$L(VAL) S ERR=1
I 'ERR D
. S VAL=$$UP^ORWGAPIX(VAL)
. I PUBLIC=9 D XEN^ORWGAPIX("PKG","ORWG GRAPH SETTING",1,VAL,.ERR) ; only on postinit
. I PUBLIC D XEN^ORWGAPIX("SYS","ORWG GRAPH SETTING",1,VAL,.ERR)
. I 'PUBLIC D XEN^ORWGAPIX("USR","ORWG GRAPH SETTING",1,VAL,.ERR)
I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
I 'TMP S DATA=ERR,DATA(1)=ERR
Q
;
SETSIZE(DATA,VAL) ; from ORWGAPI
N ERR,NAME,NUM,VALUE,VALUES,TMP
D RETURN^ORWGAPIW(.TMP,.DATA)
S ERR=0
I '$L($O(VAL(0))) S ERR=1
I 'ERR D
. S NUM=0
. F S NUM=$O(VAL(NUM)) Q:NUM<1 D Q:ERR
.. S VALUES=VAL(NUM)
.. S VALUES=$$UP^ORWGAPIX(VALUES)
.. S NAME=$P(VALUES,U)
.. S VALUE=$P(VALUES,U,2)
.. D XEN^ORWGAPIX("USR","ORWG GRAPH SIZING",NAME,VALUE,.ERR)
I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
I 'TMP S DATA=ERR,DATA(1)=ERR
Q
;
SETVIEWS(DATA,NAME,PUBLIC,VAL) ; from ORWGAPI
N ERR,TMP
D RETURN^ORWGAPIW(.TMP,.DATA)
S ERR=0
I '$L(NAME) S ERR=1
I '$L($O(VAL(""))) S ERR=1
I 'ERR D
. S NAME=$$UP^ORWGAPIX(NAME)
. S VAL=NAME
. I PUBLIC D XEN^ORWGAPIX("SYS","ORWG GRAPH VIEW",NAME,.VAL,.ERR)
. I 'PUBLIC D XEN^ORWGAPIX("USR","ORWG GRAPH VIEW",NAME,.VAL,.ERR)
I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
I 'TMP S DATA=ERR,DATA(1)=ERR
Q
;
ORWGAPIP ; SLC/STAFF - Graph Parameters ;11/20/06 08:59
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,260,243**;Dec 17, 1997;Build 242
+2 ;
ALLVIEWS(DATA,VTYPE,USER) ; from ORWGAPI
+1 NEW CNT,ENT,NUM,NUM1,PARAM,PROF,RESULT,TEST,TG,TGNUM,TGNAME,TMP,VIEW,VNUM
KILL PROF,VIEW
+2 DO RETURN^ORWGAPIW(.TMP,.DATA)
+3 SET CNT=0
+4 IF VTYPE=-2
Begin DoDot:1
+5 SET ENT="SYS"
+6 SET USER=0
End DoDot:1
+7 IF VTYPE=-1
Begin DoDot:1
+8 SET ENT="USR"
+9 IF USER
SET ENT="USR.`"_USER
End DoDot:1
+10 IF VTYPE=-3
Begin DoDot:1
+11 ;LAB GROUPS
+12 IF 'USER
SET USER=DUZ
+13 DO TG^ORWLRR(.PROF,USER)
+14 SET NUM=0
+15 FOR
SET NUM=$ORDER(PROF(NUM))
IF NUM<1
QUIT
Begin DoDot:2
+16 SET TG=PROF(NUM)
+17 SET TGNUM=+TG
+18 SET TGNAME=$PIECE(TG,U,2)
+19 ;I TGNAME[") " S TGNAME=$P(TGNAME,") ",2,99)
+20 SET VNUM=CNT+1
+21 SET RESULT="-3^V^"_VNUM_U_TGNAME_"^^^"_USER
+22 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
+23 KILL VIEW
+24 DO ATG^ORWLRR(.VIEW,TGNUM,USER)
+25 SET NUM1=0
+26 FOR
SET NUM1=$ORDER(VIEW(NUM1))
IF NUM1<1
QUIT
Begin DoDot:3
+27 SET TEST=VIEW(NUM1)
+28 SET RESULT="-3^C^"_VNUM_U_$PIECE(TEST,U,2)_"^63^"_+TEST_U
+29 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
End DoDot:3
End DoDot:2
End DoDot:1
QUIT
+30 DO XGETLST^ORWGAPIX(.PROF,ENT,"ORWG GRAPH VIEW")
+31 SET NUM=0
+32 FOR
SET NUM=$ORDER(PROF(NUM))
IF NUM<1
QUIT
Begin DoDot:1
+33 SET PARAM=$PIECE(PROF(NUM),U)
+34 SET VNUM=CNT+1
+35 SET RESULT=VTYPE_"^V^"_VNUM_U_PARAM_"^^^"_USER
+36 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
+37 KILL VIEW
+38 DO XGETWP^ORWGAPIX(.VIEW,ENT,"ORWG GRAPH VIEW",PARAM)
+39 DO DEFVIEWS(.DATA,.VIEW,VTYPE,VNUM,TMP,.CNT)
End DoDot:1
+40 QUIT
+41 ;
DATES(DAT,REPORTID) ; from ORWGAPI
+1 NEW BEGIN,END,INFO,NEXT,PARAM1,PARAM2,RPT,START,STOP
+2 SET RPT=+$ORDER(^ORD(101.24,"AC",+$GET(REPORTID),0))
+3 ; RPT=1150 is exported graph report
IF 'RPT
QUIT
+4 SET PARAM1=$PIECE($GET(^ORD(101.24,RPT,2)),U)
+5 SET PARAM2=$PIECE($GET(^ORD(101.24,RPT,2)),U,2)
+6 SET INFO=$$XGET^ORWGAPIX("ALL","ORWRP TIME/OCC LIMITS INDV",RPT,"I")
+7 SET BEGIN=$PIECE(INFO,";")
SET START=$$DATE^ORWGAPIX(BEGIN)
+8 SET END=$PIECE(INFO,";",2)
SET STOP=$$DATE^ORWGAPIX(END)
+9 IF START<1
QUIT
+10 IF STOP<1
QUIT
+11 SET NEXT=1+$ORDER(DAT(""),-1)
+12 SET DAT(NEXT)=U_BEGIN_" to "_END_"^^^"_INFO_U_START_U_STOP_U_PARAM1_U_PARAM2
+13 QUIT
+14 ;
DEFVIEWS(DATA,VIEW,VTYPE,VNUM,TMP,CNT) ;
+1 NEW FIRST,NUM,PIECE,RESULT,RESULT1,SECOND,VALUE
+2 SET NUM=""
+3 FOR
SET NUM=$ORDER(VIEW(NUM))
IF NUM=""
QUIT
Begin DoDot:1
+4 SET RESULT=$GET(VIEW(NUM,0))
+5 SET PIECE=0
+6 FOR
SET PIECE=PIECE+1
SET VALUE=$PIECE(RESULT,"|",PIECE)
IF $LENGTH(VALUE)
Begin DoDot:2
+7 SET FIRST=$PIECE(VALUE,"~")
SET SECOND=$PIECE(VALUE,"~",2)
+8 IF FIRST=0
Begin DoDot:3
+9 IF $EXTRACT(SECOND,1,5)="63AP;"
SET RESULT1=VTYPE_"^C^"_VNUM_U_"Anatomic Path: "_$$ITEMPRFX^ORWGAPIU($EXTRACT(SECOND,3,6))_" <any>"_U_SECOND_"^0^"
QUIT
+10 IF $EXTRACT(SECOND,1,5)="63MI;"
SET RESULT1=VTYPE_"^C^"_VNUM_U_"Microbiology: "_$$ITEMPRFX^ORWGAPIU($EXTRACT(SECOND,3,6))_" <any>"_U_SECOND_"^0^"
QUIT
+11 SET RESULT1=VTYPE_"^C^"_VNUM_U_$$FILENAME^ORWGAPIT(SECOND)_" <any>"_U_SECOND_"^0^"
End DoDot:3
+12 IF FIRST'=0
SET RESULT1=VTYPE_"^C^"_VNUM_U_$$EVALUE^ORWGAPIU(SECOND,FIRST)_U_FIRST_U_SECOND_U
+13 DO SETUP^ORWGAPIW(.DATA,RESULT1,TMP,.CNT)
End DoDot:2
IF '$LENGTH($PIECE(RESULT,"|",PIECE+1,999))
QUIT
End DoDot:1
+14 QUIT
+15 ;
DELVIEWS(DATA,NAME,PUBLIC) ; from ORWGAPI
+1 NEW ERR,TMP
+2 DO RETURN^ORWGAPIW(.TMP,.DATA)
+3 SET ERR=0
+4 IF '$LENGTH(NAME)
SET ERR=1
+5 IF 'ERR
Begin DoDot:1
+6 SET NAME=$$UP^ORWGAPIX(NAME)
+7 IF PUBLIC
DO XDEL^ORWGAPIX("SYS","ORWG GRAPH VIEW",NAME,.ERR)
+8 IF 'PUBLIC
DO XDEL^ORWGAPIX("USR","ORWG GRAPH VIEW",NAME,.ERR)
End DoDot:1
+9 IF TMP
SET ^TMP(DATA,$JOB)=ERR
SET ^TMP(DATA,$JOB,1)=ERR
+10 IF 'TMP
SET DATA=ERR
SET DATA(1)=ERR
+11 QUIT
+12 ;
GETPREF(DATA) ; from ORWGAPI
+1 NEW CNT,NUM,PROF,RESULT,TMP,VAL
KILL PROF
+2 ; graphing is not used if no indexes
IF '$ORDER(^PXRMINDX(63,"PI",""))
QUIT
+3 SET VAL=$$XGET^ORWGAPIX("PKG","ORWG GRAPH SETTING",1,"I")
+4 ; graphing not used if no pkg param on settings
IF '$LENGTH(VAL)
QUIT
+5 DO RETURN^ORWGAPIW(.TMP,.DATA)
+6 SET PROF(2)=1
+7 IF '$LENGTH($GET(^XTMP("ORGRAPH",0)))
SET PROF(2)=-1
+8 SET VAL=$$XGET^ORWGAPIX("DIV^SYS^PKG","ORWG GRAPH SETTING",1,"I")
+9 SET PROF(1)=VAL
+10 SET VAL=$$XGET^ORWGAPIX("ALL","ORWG GRAPH SETTING",1,"I")
+11 SET PROF(0)=VAL
+12 SET CNT=0
+13 SET NUM=""
+14 FOR
SET NUM=$ORDER(PROF(NUM))
IF NUM=""
QUIT
Begin DoDot:1
+15 SET RESULT=$GET(PROF(NUM))
+16 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
End DoDot:1
+17 QUIT
+18 ;
GETSIZE(DATA) ; from ORWGAPI
+1 NEW CNT,NUM,PROF,RESULT,TMP
KILL PROF
+2 DO RETURN^ORWGAPIW(.TMP,.DATA)
+3 DO XGETLST^ORWGAPIX(.PROF,"USR","ORWG GRAPH SIZING")
+4 SET CNT=0
+5 SET NUM=""
+6 FOR
SET NUM=$ORDER(PROF(NUM))
IF NUM=""
QUIT
Begin DoDot:1
+7 SET RESULT=$GET(PROF(NUM))
+8 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
End DoDot:1
+9 QUIT
+10 ;
+11 ;GETVIEWS(DATA,ALL,PUBLIC,EXT,USER) ; from ORWGAPI
+12 ;N CNT,NUM,PROF,RESULT,TMP,USERPRM K PROF
+13 ;D RETURN^ORWGAPIW(.TMP,.DATA)
+14 ;I PUBLIC D
+15 ;. I ALL=1 D XGETLST^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW") ; get list of public views
+16 ;. I ALL'=1 D XGETWP^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW",ALL) ; get a public view definition
+17 ;I 'PUBLIC D
+18 ;. S USERPRM="USR"
+19 ;. I USER S USERPRM="USR.`"_USER
+20 ;. I ALL=1 D XGETLST^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW") ; get list of personal views
+21 ;. I ALL'=1 D XGETWP^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW",ALL) ; get a personal view definition
+22 ;S CNT=0
+23 ;I 'EXT D Q
+24 ;. S NUM=""
+25 ;. F S NUM=$O(PROF(NUM)) Q:NUM="" D
+26 ;.. I ALL=1 S RESULT=$P($G(PROF(NUM)),U)
+27 ;.. I ALL'=1 S RESULT=$G(PROF(NUM,0))
+28 ;.. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
+29 ;D DEFVIEWS(.DATA,.PROF,"",TMP,.CNT)
+30 ;Q
+31 ;
GETVIEWS(DATA,ALL,PUBLIC,EXT,USER) ; from ORWGAPI
+1 NEW CNT,FIRST,NUM,PIECE,PROF,RESULT,RESULT1,SECOND,TMP,VALUE
KILL PROF
+2 DO RETURN^ORWGAPIW(.TMP,.DATA)
+3 IF PUBLIC
Begin DoDot:1
+4 ; get list of public views
IF ALL=1
DO XGETLST^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW")
+5 ; get a public view definition
IF ALL'=1
DO XGETWP^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW",ALL)
End DoDot:1
+6 IF 'PUBLIC
Begin DoDot:1
+7 SET USERPRM="USR"
+8 IF USER
SET USERPRM="USR.`"_USER
+9 ; get list of personal views
IF ALL=1
DO XGETLST^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW")
+10 ; get a personal view definition
IF ALL'=1
DO XGETWP^ORWGAPIX(.PROF,USERPRM,"ORWG GRAPH VIEW",ALL)
End DoDot:1
+11 SET CNT=0
+12 IF 'EXT
Begin DoDot:1
+13 SET NUM=""
+14 FOR
SET NUM=$ORDER(PROF(NUM))
IF NUM=""
QUIT
Begin DoDot:2
+15 IF ALL=1
SET RESULT=$PIECE($GET(PROF(NUM)),U)
+16 IF ALL'=1
SET RESULT=$GET(PROF(NUM,0))
+17 DO SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
End DoDot:2
End DoDot:1
QUIT
+18 SET NUM=""
+19 FOR
SET NUM=$ORDER(PROF(NUM))
IF NUM=""
QUIT
Begin DoDot:1
+20 SET RESULT=$GET(PROF(NUM,0))
+21 SET PIECE=0
+22 FOR
SET PIECE=PIECE+1
SET VALUE=$PIECE(RESULT,"|",PIECE)
IF $LENGTH(VALUE)
Begin DoDot:2
+23 SET FIRST=$PIECE(VALUE,"~")
SET SECOND=$PIECE(VALUE,"~",2)
+24 IF FIRST=0
SET CNT=CNT+1
SET RESULT1="0^"_SECOND_U_$$FILENAME^ORWGAPIT(SECOND)_" <any>"
+25 IF FIRST'=0
SET CNT=CNT+1
SET RESULT1=FIRST_U_SECOND_U_$$EVALUE^ORWGAPIU(SECOND,FIRST)
+26 DO SETUP^ORWGAPIW(.DATA,RESULT1,TMP,.CNT)
End DoDot:2
IF '$LENGTH($PIECE(RESULT,"|",PIECE+1,999))
QUIT
End DoDot:1
+27 QUIT
+28 ;
INISET ; from ORWGAPIU initial setup of package parameters
+1 NEW ERR,RPTNUM
+2 SET RPTNUM=1150
+3 ; default public settings
DO SETPREF(.ERR,"63;53.79;55;55NVA;52;70;120.5|BCEFGHIKN|1|4|90|1|100||",9)
+4 ; make sure report has been added
IF '$DATA(^ORD(101.24,RPTNUM,0))
Begin DoDot:1
+5 LOCK +^ORD(101.24,0):20
IF '$TEST
QUIT
+6 SET $PIECE(^ORD(101.24,0),U,3)=RPTNUM
SET $PIECE(^(0),U,4)=$PIECE(^(0),U,4)+1
+7 SET ^ORD(101.24,RPTNUM,0)="ORWG GRAPHING^OR_GRAPHS^^2^^^1^R^^^^G^^T"
+8 SET ^ORD(101.24,RPTNUM,2)="^^Graphing (local only)^Graphing"
+9 LOCK -^ORD(101.24,0)
+10 DO INDEX^ORWGAPIX("^ORD(101.24,",RPTNUM)
End DoDot:1
+11 DO XEN^ORWGAPIX("PKG","ORWRP REPORT LIST",12,RPTNUM)
+12 QUIT
+13 ;
PUBLIC(USER) ; from ORWGAPI
+1 NEW ERR,IDX,ORSRV,USRCLASS,VAL
KILL USRCLASS
+2 SET VAL=0
+3 IF '$GET(USER)
QUIT VAL
+4 SET ORSRV=$$GET1^DIQ(200,DUZ,29,"I")
+5 DO XGETLST1^ORWGAPIX(.USRCLASS,"SYS","ORWG GRAPH PUBLIC EDITOR CLASS","Q",.ERR)
+6 IF ERR
QUIT VAL
+7 SET IDX=0
+8 FOR
SET IDX=$ORDER(USRCLASS(IDX))
IF 'IDX
QUIT
Begin DoDot:1
+9 IF $$ISA^ORWGAPIA(USER,$PIECE(USRCLASS(IDX),U,2),.ERR)
SET VAL=1
End DoDot:1
IF VAL
QUIT
+10 QUIT VAL
+11 ;
RPTPARAM(IEN) ; from ORWGAPI
+1 NEW DATES,NODE,VAL
+2 SET IEN=+$GET(IEN)
+3 SET VAL=""
+4 SET NODE=$$UP^XLFSTR($PIECE($GET(^ORD(101.24,IEN,2)),U,1,2))
+5 IF $LENGTH(NODE)<2
QUIT VAL
+6 QUIT NODE
+7 ;
SETPREF(DATA,VAL,PUBLIC) ; from ORWGAPI
+1 NEW ERR,TMP
+2 DO RETURN^ORWGAPIW(.TMP,.DATA)
+3 SET ERR=0
+4 IF '$LENGTH(VAL)
SET ERR=1
+5 IF 'ERR
Begin DoDot:1
+6 SET VAL=$$UP^ORWGAPIX(VAL)
+7 ; only on postinit
IF PUBLIC=9
DO XEN^ORWGAPIX("PKG","ORWG GRAPH SETTING",1,VAL,.ERR)
+8 IF PUBLIC
DO XEN^ORWGAPIX("SYS","ORWG GRAPH SETTING",1,VAL,.ERR)
+9 IF 'PUBLIC
DO XEN^ORWGAPIX("USR","ORWG GRAPH SETTING",1,VAL,.ERR)
End DoDot:1
+10 IF TMP
SET ^TMP(DATA,$JOB)=ERR
SET ^TMP(DATA,$JOB,1)=ERR
+11 IF 'TMP
SET DATA=ERR
SET DATA(1)=ERR
+12 QUIT
+13 ;
SETSIZE(DATA,VAL) ; from ORWGAPI
+1 NEW ERR,NAME,NUM,VALUE,VALUES,TMP
+2 DO RETURN^ORWGAPIW(.TMP,.DATA)
+3 SET ERR=0
+4 IF '$LENGTH($ORDER(VAL(0)))
SET ERR=1
+5 IF 'ERR
Begin DoDot:1
+6 SET NUM=0
+7 FOR
SET NUM=$ORDER(VAL(NUM))
IF NUM<1
QUIT
Begin DoDot:2
+8 SET VALUES=VAL(NUM)
+9 SET VALUES=$$UP^ORWGAPIX(VALUES)
+10 SET NAME=$PIECE(VALUES,U)
+11 SET VALUE=$PIECE(VALUES,U,2)
+12 DO XEN^ORWGAPIX("USR","ORWG GRAPH SIZING",NAME,VALUE,.ERR)
End DoDot:2
IF ERR
QUIT
End DoDot:1
+13 IF TMP
SET ^TMP(DATA,$JOB)=ERR
SET ^TMP(DATA,$JOB,1)=ERR
+14 IF 'TMP
SET DATA=ERR
SET DATA(1)=ERR
+15 QUIT
+16 ;
SETVIEWS(DATA,NAME,PUBLIC,VAL) ; from ORWGAPI
+1 NEW ERR,TMP
+2 DO RETURN^ORWGAPIW(.TMP,.DATA)
+3 SET ERR=0
+4 IF '$LENGTH(NAME)
SET ERR=1
+5 IF '$LENGTH($ORDER(VAL("")))
SET ERR=1
+6 IF 'ERR
Begin DoDot:1
+7 SET NAME=$$UP^ORWGAPIX(NAME)
+8 SET VAL=NAME
+9 IF PUBLIC
DO XEN^ORWGAPIX("SYS","ORWG GRAPH VIEW",NAME,.VAL,.ERR)
+10 IF 'PUBLIC
DO XEN^ORWGAPIX("USR","ORWG GRAPH VIEW",NAME,.VAL,.ERR)
End DoDot:1
+11 IF TMP
SET ^TMP(DATA,$JOB)=ERR
SET ^TMP(DATA,$JOB,1)=ERR
+12 IF 'TMP
SET DATA=ERR
SET DATA(1)=ERR
+13 QUIT
+14 ;