BQIPLLAY ;VNGT/HS/ALA-Panel Layouts ; 20 Jul 2009 10:41 AM
;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
;
GET(DATA,OWNR,PLIEN) ; EP - BQI GET PANEL LAYOUTS
NEW UID,II,IENS,DA,YEAR,GIEN,DISPLAY,SORT,SDIR,SD,SR,GVALUE,STVCD,SVALUE,DVALUE
NEW RIEN,CARE,CRN,DEF,TIEN,TYP,TEMPL
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLLAY",UID))
K @DATA
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLLAY D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="I00010TEMPL_IEN^T00040TEMPLATE_NAME^T00001DEFAULT^T00001TYPE^T00120DISPLAY_ORDER^T00120SORT_ORDER^T00120SORT_DIRECTION^D00030LAST_EDIT"_$C(30)
;
S OWNR=$G(OWNR,$G(DUZ)),PLIEN=$G(PLIEN,"") ; If no owner supplied use DUZ
;
PT ; for Patient view
D
. ; If there is a template
. I $$TMPL^BQIPLVWC() Q
. ; If there is a customized view
. I $$CVW^BQIPLVWC() D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ; Get default
. S TIEN="",TEMPL="",DEF="",TYP="D"
. S DISPLAY=$$DFNC^BQIPLVW()
. S SORT=$$SFNC^BQIPLVW()
. S SDIR="A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
;
GP ; for Natl measures
D
. ; If there is a template
. I $$TMPL^BQIGPVW() Q
. ; If there is a customized view
. I $$CVW^BQIGPVW() D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ; Get default
. S TIEN="",TEMPL="",DEF="",TYP="G"
. S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$GDEF^BQIGPVW()
. S SORT=$$SFNC^BQIGPVW()
. S SDIR="A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
;
RM ; for Reminders
D
. ; If there is a template
. I $$TMPL^BQIPLRVW() Q
. ; If there is a customized view
. I $$CVW^BQIPLRVW() D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ;
. S TIEN="",TEMPL="",DEF="",TYP="R"
. S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$RDEF^BQIRMPL()
. S SORT=$$SFNC^BQIGPVW()
. S SDIR="A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
;
CN ; for Consults
D
. ; If there is a template
. I $$TMPL^BQIPLCNV() Q
. ; If there is a customized view
. I $$CVW^BQIPLCNV() D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ;
. S TIEN="",TEMPL="",DEF="",TYP="CN",CARE="Consults"
. S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$CDEF^BQICMVW()
. S SORT=$$SFNC^BQIGPVW()
. S SDIR="A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
;
RF ; for Referrals
D
. ; If there is a template
. I $$TMPL^BQIPLRFV() Q
. ; If there is a customized view
. I $$CVW^BQIPLRFV() D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ;
. S TIEN="",TEMPL="",DEF="",TYP="RF",CARE="Referrals"
. S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$CDEF^BQICMVW()
. S SORT=$$SFNC^BQIGPVW()
. S SDIR="A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
;
CM ; for Care Management
NEW TDATA
D TAB^BQIUTB(.TDATA,"CARE")
F CN=1:1 S CARE=$P(@TDATA@(CN),U,2) Q:CARE="" D
. ;
. N TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
. ;
. ;Check for a template
. I $$TMPL^BQICMVW(CARE) Q
. ;
. ;Check for a customized view
. I $$CVW^BQICMVW(CARE) D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ;
. ;System Default
. S TIEN="",TEMPL="",DEF=""
. S CRN=$O(^BQI(90506.5,"B",CARE,"")),TYP=$P(^BQI(90506.5,CRN,0),U,2)
. S DISPLAY=$$DFNC^BQICMVW()_$C(29)_$$CDEF^BQICMVW()
. S SORT=$$SFNC^BQICMVW()
. S SDIR="A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
;
K @TDATA
;
CE ; for Care Event (CMET)
N CARE
F CARE="Events","Tracked Events","Followup Events" D
. ;
. N TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
. ;
. ;Check for a template
. I $$TMPL^BQICEVW(CARE) Q
. ;
. ;Check for a customized view
. I $$CVW^BQICEVW(CARE) D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ;
. ;System Default
. S TIEN="",TEMPL="",DEF=""
. S CRN=$O(^BQI(90506.5,"B",CARE,"")),TYP=$P(^BQI(90506.5,CRN,0),U,2)
. S DISPLAY=$$DFNC^BQICEVW()_$C(29)_$$CDEF^BQICEVW()
. S SORT=$$SFNC^BQICEVW(CRN,TYP)
. I CARE="Followup Events" S SDIR="A"_$C(29)_"A"_$C(29)_"A",TEMPL="System Default"
. E S SDIR="A"_$C(29)_"D"_$C(29)_"A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
K CARE
;
DFD ; for Definition Detail
NEW CARE,BQCN
S BQCN=0
F S BQCN=$O(^BQI(90506.5,BQCN)) Q:'BQCN D
. I $P(^BQI(90506.5,BQCN,0),U,15)'=1 Q
. I $P(^BQI(90506.5,BQCN,0),U,10)=1 Q
. S CARE=$P(^BQI(90506.5,BQCN,0),U,1)
. N TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
. ;
. ;Check for a template
. I $$TMPL^BQICMVW(CARE) Q
. ;
. ;Check for a customized view
. I $$CVW^BQICMVW(CARE) D Q
.. S @DATA@(II)=$TR(@DATA@(II),$C(30))
.. S $P(@DATA@(II),U,8)=""
.. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
. ;
. ;System Default
. S TIEN="",TEMPL="",DEF=""
. S CRN=$O(^BQI(90506.5,"B",CARE,"")),TYP=$P(^BQI(90506.5,CRN,0),U,2)
. S DISPLAY=$$DFNC^BQICMVW()_$C(29)_$$CDEF^BQICMVW()
. S SORT=$$SFNC^BQICMVW()
. S SDIR="A",TEMPL="System Default"
. S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
;
DONE ;
S II=II+1,@DATA@(II)=$C(31)
Q
;
ERR ;
D ^%ZTER
NEW Y,ERRDTM
S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
S BMXSEC="Recording that an error occurred at "_ERRDTM
I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
Q
;
UPD(DATA,OWNR,PLIEN,TYPE,TEMPL,SOR,SDIR,DOR) ; EP - BQI SET PANEL LAYOUTS
NEW UID,II,IEN,LIST,BN
K ERROR
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLYUP",UID))
K @DATA
S II=0
S @DATA@(II)="I00010RESULT"_$C(30)
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLLAY D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S TEMPL=$G(TEMPL,""),SOR=$G(SOR,""),SDIR=$G(SDIR,""),DOR=$G(DOR,"")
I DOR="" D
. S LIST="",BN=""
. F S BN=$O(DOR(BN)) Q:BN="" S LIST=LIST_DOR(BN)
. K DOR
. S DOR=LIST
. K LIST
;
I TYPE="D" D FIL^BQIPLVWC(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
I TYPE="G" D FIL^BQIGPVW(OWNR,PLIEN,$G(YEAR),$G(TEMPL),SOR,SDIR,DOR) G FIN
I TYPE="R" D FIL^BQIPLRVW(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
I TYPE="CN" D FIL^BQIPLCNV(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
I TYPE="RF" D FIL^BQIPLRFV(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
S CRN=$O(^BQI(90506.5,"C",TYPE,""))
I CRN'="" D
. S CARE=$P(^BQI(90506.5,CRN,0),"^",1)
. I $P(^BQI(90506.5,CRN,0),U,10)=1 Q
. D FIL^BQICMVW(OWNR,PLIEN,CARE,$G(TEMPL),SOR,SDIR,DOR)
;
FIN ; Finish up
I $D(ERROR) S II=II+1,@DATA@(II)="-1"_$C(30)
I '$D(ERROR) S II=II+1,@DATA@(II)="1"_$C(30)
K ERROR
S II=II+1,@DATA@(II)=$C(31)
Q
BQIPLLAY ;VNGT/HS/ALA-Panel Layouts ; 20 Jul 2009 10:41 AM
+1 ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
+2 ;
GET(DATA,OWNR,PLIEN) ; EP - BQI GET PANEL LAYOUTS
+1 NEW UID,II,IENS,DA,YEAR,GIEN,DISPLAY,SORT,SDIR,SD,SR,GVALUE,STVCD,SVALUE,DVALUE
+2 NEW RIEN,CARE,CRN,DEF,TIEN,TYP,TEMPL
+3 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+4 SET DATA=$NAME(^TMP("BQIPLLAY",UID))
+5 KILL @DATA
+6 SET II=0
+7 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLLAY D UNWIND^%ZTER"
+8 ;
+9 SET @DATA@(II)="I00010TEMPL_IEN^T00040TEMPLATE_NAME^T00001DEFAULT^T00001TYPE^T00120DISPLAY_ORDER^T00120SORT_ORDER^T00120SORT_DIRECTION^D00030LAST_EDIT"_$CHAR(30)
+10 ;
+11 ; If no owner supplied use DUZ
SET OWNR=$GET(OWNR,$GET(DUZ))
SET PLIEN=$GET(PLIEN,"")
+12 ;
PT ; for Patient view
+1 Begin DoDot:1
+2 ; If there is a template
+3 IF $$TMPL^BQIPLVWC()
QUIT
+4 ; If there is a customized view
+5 IF $$CVW^BQIPLVWC()
Begin DoDot:2
+6 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+7 SET $PIECE(@DATA@(II),U,8)=""
+8 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+9 ; Get default
+10 SET TIEN=""
SET TEMPL=""
SET DEF=""
SET TYP="D"
+11 SET DISPLAY=$$DFNC^BQIPLVW()
+12 SET SORT=$$SFNC^BQIPLVW()
+13 SET SDIR="A"
SET TEMPL="System Default"
+14 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+15 ;
GP ; for Natl measures
+1 Begin DoDot:1
+2 ; If there is a template
+3 IF $$TMPL^BQIGPVW()
QUIT
+4 ; If there is a customized view
+5 IF $$CVW^BQIGPVW()
Begin DoDot:2
+6 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+7 SET $PIECE(@DATA@(II),U,8)=""
+8 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+9 ; Get default
+10 SET TIEN=""
SET TEMPL=""
SET DEF=""
SET TYP="G"
+11 SET DISPLAY=$$DFNC^BQIGPVW()_$CHAR(29)_$$GDEF^BQIGPVW()
+12 SET SORT=$$SFNC^BQIGPVW()
+13 SET SDIR="A"
SET TEMPL="System Default"
+14 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+15 ;
RM ; for Reminders
+1 Begin DoDot:1
+2 ; If there is a template
+3 IF $$TMPL^BQIPLRVW()
QUIT
+4 ; If there is a customized view
+5 IF $$CVW^BQIPLRVW()
Begin DoDot:2
+6 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+7 SET $PIECE(@DATA@(II),U,8)=""
+8 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+9 ;
+10 SET TIEN=""
SET TEMPL=""
SET DEF=""
SET TYP="R"
+11 SET DISPLAY=$$DFNC^BQIGPVW()_$CHAR(29)_$$RDEF^BQIRMPL()
+12 SET SORT=$$SFNC^BQIGPVW()
+13 SET SDIR="A"
SET TEMPL="System Default"
+14 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+15 ;
CN ; for Consults
+1 Begin DoDot:1
+2 ; If there is a template
+3 IF $$TMPL^BQIPLCNV()
QUIT
+4 ; If there is a customized view
+5 IF $$CVW^BQIPLCNV()
Begin DoDot:2
+6 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+7 SET $PIECE(@DATA@(II),U,8)=""
+8 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+9 ;
+10 SET TIEN=""
SET TEMPL=""
SET DEF=""
SET TYP="CN"
SET CARE="Consults"
+11 SET DISPLAY=$$DFNC^BQIGPVW()_$CHAR(29)_$$CDEF^BQICMVW()
+12 SET SORT=$$SFNC^BQIGPVW()
+13 SET SDIR="A"
SET TEMPL="System Default"
+14 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+15 ;
RF ; for Referrals
+1 Begin DoDot:1
+2 ; If there is a template
+3 IF $$TMPL^BQIPLRFV()
QUIT
+4 ; If there is a customized view
+5 IF $$CVW^BQIPLRFV()
Begin DoDot:2
+6 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+7 SET $PIECE(@DATA@(II),U,8)=""
+8 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+9 ;
+10 SET TIEN=""
SET TEMPL=""
SET DEF=""
SET TYP="RF"
SET CARE="Referrals"
+11 SET DISPLAY=$$DFNC^BQIGPVW()_$CHAR(29)_$$CDEF^BQICMVW()
+12 SET SORT=$$SFNC^BQIGPVW()
+13 SET SDIR="A"
SET TEMPL="System Default"
+14 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+15 ;
CM ; for Care Management
+1 NEW TDATA
+2 DO TAB^BQIUTB(.TDATA,"CARE")
+3 FOR CN=1:1
SET CARE=$PIECE(@TDATA@(CN),U,2)
IF CARE=""
QUIT
Begin DoDot:1
+4 ;
+5 NEW TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
+6 ;
+7 ;Check for a template
+8 IF $$TMPL^BQICMVW(CARE)
QUIT
+9 ;
+10 ;Check for a customized view
+11 IF $$CVW^BQICMVW(CARE)
Begin DoDot:2
+12 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+13 SET $PIECE(@DATA@(II),U,8)=""
+14 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+15 ;
+16 ;System Default
+17 SET TIEN=""
SET TEMPL=""
SET DEF=""
+18 SET CRN=$ORDER(^BQI(90506.5,"B",CARE,""))
SET TYP=$PIECE(^BQI(90506.5,CRN,0),U,2)
+19 SET DISPLAY=$$DFNC^BQICMVW()_$CHAR(29)_$$CDEF^BQICMVW()
+20 SET SORT=$$SFNC^BQICMVW()
+21 SET SDIR="A"
SET TEMPL="System Default"
+22 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+23 ;
+24 KILL @TDATA
+25 ;
CE ; for Care Event (CMET)
+1 NEW CARE
+2 FOR CARE="Events","Tracked Events","Followup Events"
Begin DoDot:1
+3 ;
+4 NEW TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
+5 ;
+6 ;Check for a template
+7 IF $$TMPL^BQICEVW(CARE)
QUIT
+8 ;
+9 ;Check for a customized view
+10 IF $$CVW^BQICEVW(CARE)
Begin DoDot:2
+11 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+12 SET $PIECE(@DATA@(II),U,8)=""
+13 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+14 ;
+15 ;System Default
+16 SET TIEN=""
SET TEMPL=""
SET DEF=""
+17 SET CRN=$ORDER(^BQI(90506.5,"B",CARE,""))
SET TYP=$PIECE(^BQI(90506.5,CRN,0),U,2)
+18 SET DISPLAY=$$DFNC^BQICEVW()_$CHAR(29)_$$CDEF^BQICEVW()
+19 SET SORT=$$SFNC^BQICEVW(CRN,TYP)
+20 IF CARE="Followup Events"
SET SDIR="A"_$CHAR(29)_"A"_$CHAR(29)_"A"
SET TEMPL="System Default"
+21 IF '$TEST
SET SDIR="A"_$CHAR(29)_"D"_$CHAR(29)_"A"
SET TEMPL="System Default"
+22 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+23 KILL CARE
+24 ;
DFD ; for Definition Detail
+1 NEW CARE,BQCN
+2 SET BQCN=0
+3 FOR
SET BQCN=$ORDER(^BQI(90506.5,BQCN))
IF 'BQCN
QUIT
Begin DoDot:1
+4 IF $PIECE(^BQI(90506.5,BQCN,0),U,15)'=1
QUIT
+5 IF $PIECE(^BQI(90506.5,BQCN,0),U,10)=1
QUIT
+6 SET CARE=$PIECE(^BQI(90506.5,BQCN,0),U,1)
+7 NEW TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
+8 ;
+9 ;Check for a template
+10 IF $$TMPL^BQICMVW(CARE)
QUIT
+11 ;
+12 ;Check for a customized view
+13 IF $$CVW^BQICMVW(CARE)
Begin DoDot:2
+14 SET @DATA@(II)=$TRANSLATE(@DATA@(II),$CHAR(30))
+15 SET $PIECE(@DATA@(II),U,8)=""
+16 IF $EXTRACT(@DATA@(II),$LENGTH(@DATA@(II)))'=$CHAR(30)
SET @DATA@(II)=@DATA@(II)_$CHAR(30)
End DoDot:2
QUIT
+17 ;
+18 ;System Default
+19 SET TIEN=""
SET TEMPL=""
SET DEF=""
+20 SET CRN=$ORDER(^BQI(90506.5,"B",CARE,""))
SET TYP=$PIECE(^BQI(90506.5,CRN,0),U,2)
+21 SET DISPLAY=$$DFNC^BQICMVW()_$CHAR(29)_$$CDEF^BQICMVW()
+22 SET SORT=$$SFNC^BQICMVW()
+23 SET SDIR="A"
SET TEMPL="System Default"
+24 SET II=II+1
SET @DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$CHAR(30)
End DoDot:1
+25 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
ERR ;
+1 DO ^%ZTER
+2 NEW Y,ERRDTM
+3 SET Y=$$NOW^XLFDT()
XECUTE ^DD("DD")
SET ERRDTM=Y
+4 SET BMXSEC="Recording that an error occurred at "_ERRDTM
+5 IF $DATA(II)
IF $DATA(DATA)
SET II=II+1
SET @DATA@(II)=$CHAR(31)
+6 QUIT
+7 ;
UPD(DATA,OWNR,PLIEN,TYPE,TEMPL,SOR,SDIR,DOR) ; EP - BQI SET PANEL LAYOUTS
+1 NEW UID,II,IEN,LIST,BN
+2 KILL ERROR
+3 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+4 SET DATA=$NAME(^TMP("BQIPLYUP",UID))
+5 KILL @DATA
+6 SET II=0
+7 SET @DATA@(II)="I00010RESULT"_$CHAR(30)
+8 ;
+9 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLLAY D UNWIND^%ZTER"
+10 ;
+11 SET TEMPL=$GET(TEMPL,"")
SET SOR=$GET(SOR,"")
SET SDIR=$GET(SDIR,"")
SET DOR=$GET(DOR,"")
+12 IF DOR=""
Begin DoDot:1
+13 SET LIST=""
SET BN=""
+14 FOR
SET BN=$ORDER(DOR(BN))
IF BN=""
QUIT
SET LIST=LIST_DOR(BN)
+15 KILL DOR
+16 SET DOR=LIST
+17 KILL LIST
End DoDot:1
+18 ;
+19 IF TYPE="D"
DO FIL^BQIPLVWC(OWNR,PLIEN,$GET(TEMPL),SOR,SDIR,DOR)
GOTO FIN
+20 IF TYPE="G"
DO FIL^BQIGPVW(OWNR,PLIEN,$GET(YEAR),$GET(TEMPL),SOR,SDIR,DOR)
GOTO FIN
+21 IF TYPE="R"
DO FIL^BQIPLRVW(OWNR,PLIEN,$GET(TEMPL),SOR,SDIR,DOR)
GOTO FIN
+22 IF TYPE="CN"
DO FIL^BQIPLCNV(OWNR,PLIEN,$GET(TEMPL),SOR,SDIR,DOR)
GOTO FIN
+23 IF TYPE="RF"
DO FIL^BQIPLRFV(OWNR,PLIEN,$GET(TEMPL),SOR,SDIR,DOR)
GOTO FIN
+24 SET CRN=$ORDER(^BQI(90506.5,"C",TYPE,""))
+25 IF CRN'=""
Begin DoDot:1
+26 SET CARE=$PIECE(^BQI(90506.5,CRN,0),"^",1)
+27 IF $PIECE(^BQI(90506.5,CRN,0),U,10)=1
QUIT
+28 DO FIL^BQICMVW(OWNR,PLIEN,CARE,$GET(TEMPL),SOR,SDIR,DOR)
End DoDot:1
+29 ;
FIN ; Finish up
+1 IF $DATA(ERROR)
SET II=II+1
SET @DATA@(II)="-1"_$CHAR(30)
+2 IF '$DATA(ERROR)
SET II=II+1
SET @DATA@(II)="1"_$CHAR(30)
+3 KILL ERROR
+4 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+5 QUIT