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

BQIPLLAY.m

Go to the documentation of this file.
  1. BQIPLLAY ;VNGT/HS/ALA-Panel Layouts ; 20 Jul 2009 10:41 AM
  1. ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
  1. ;
  1. 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
  1. NEW RIEN,CARE,CRN,DEF,TIEN,TYP,TEMPL
  1. S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
  1. S DATA=$NA(^TMP("BQIPLLAY",UID))
  1. K @DATA
  1. S II=0
  1. NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLLAY D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
  1. ;
  1. S @DATA@(II)="I00010TEMPL_IEN^T00040TEMPLATE_NAME^T00001DEFAULT^T00001TYPE^T00120DISPLAY_ORDER^T00120SORT_ORDER^T00120SORT_DIRECTION^D00030LAST_EDIT"_$C(30)
  1. ;
  1. S OWNR=$G(OWNR,$G(DUZ)),PLIEN=$G(PLIEN,"") ; If no owner supplied use DUZ
  1. ;
  1. PT ; for Patient view
  1. D
  1. . ; If there is a template
  1. . I $$TMPL^BQIPLVWC() Q
  1. . ; If there is a customized view
  1. . I $$CVW^BQIPLVWC() D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ; Get default
  1. . S TIEN="",TEMPL="",DEF="",TYP="D"
  1. . S DISPLAY=$$DFNC^BQIPLVW()
  1. . S SORT=$$SFNC^BQIPLVW()
  1. . S SDIR="A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. ;
  1. GP ; for Natl measures
  1. D
  1. . ; If there is a template
  1. . I $$TMPL^BQIGPVW() Q
  1. . ; If there is a customized view
  1. . I $$CVW^BQIGPVW() D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ; Get default
  1. . S TIEN="",TEMPL="",DEF="",TYP="G"
  1. . S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$GDEF^BQIGPVW()
  1. . S SORT=$$SFNC^BQIGPVW()
  1. . S SDIR="A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. ;
  1. RM ; for Reminders
  1. D
  1. . ; If there is a template
  1. . I $$TMPL^BQIPLRVW() Q
  1. . ; If there is a customized view
  1. . I $$CVW^BQIPLRVW() D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ;
  1. . S TIEN="",TEMPL="",DEF="",TYP="R"
  1. . S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$RDEF^BQIRMPL()
  1. . S SORT=$$SFNC^BQIGPVW()
  1. . S SDIR="A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. ;
  1. CN ; for Consults
  1. D
  1. . ; If there is a template
  1. . I $$TMPL^BQIPLCNV() Q
  1. . ; If there is a customized view
  1. . I $$CVW^BQIPLCNV() D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ;
  1. . S TIEN="",TEMPL="",DEF="",TYP="CN",CARE="Consults"
  1. . S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$CDEF^BQICMVW()
  1. . S SORT=$$SFNC^BQIGPVW()
  1. . S SDIR="A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. ;
  1. RF ; for Referrals
  1. D
  1. . ; If there is a template
  1. . I $$TMPL^BQIPLRFV() Q
  1. . ; If there is a customized view
  1. . I $$CVW^BQIPLRFV() D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ;
  1. . S TIEN="",TEMPL="",DEF="",TYP="RF",CARE="Referrals"
  1. . S DISPLAY=$$DFNC^BQIGPVW()_$C(29)_$$CDEF^BQICMVW()
  1. . S SORT=$$SFNC^BQIGPVW()
  1. . S SDIR="A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. ;
  1. CM ; for Care Management
  1. NEW TDATA
  1. D TAB^BQIUTB(.TDATA,"CARE")
  1. F CN=1:1 S CARE=$P(@TDATA@(CN),U,2) Q:CARE="" D
  1. . ;
  1. . N TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
  1. . ;
  1. . ;Check for a template
  1. . I $$TMPL^BQICMVW(CARE) Q
  1. . ;
  1. . ;Check for a customized view
  1. . I $$CVW^BQICMVW(CARE) D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ;
  1. . ;System Default
  1. . S TIEN="",TEMPL="",DEF=""
  1. . S CRN=$O(^BQI(90506.5,"B",CARE,"")),TYP=$P(^BQI(90506.5,CRN,0),U,2)
  1. . S DISPLAY=$$DFNC^BQICMVW()_$C(29)_$$CDEF^BQICMVW()
  1. . S SORT=$$SFNC^BQICMVW()
  1. . S SDIR="A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. ;
  1. K @TDATA
  1. ;
  1. CE ; for Care Event (CMET)
  1. N CARE
  1. F CARE="Events","Tracked Events","Followup Events" D
  1. . ;
  1. . N TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
  1. . ;
  1. . ;Check for a template
  1. . I $$TMPL^BQICEVW(CARE) Q
  1. . ;
  1. . ;Check for a customized view
  1. . I $$CVW^BQICEVW(CARE) D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ;
  1. . ;System Default
  1. . S TIEN="",TEMPL="",DEF=""
  1. . S CRN=$O(^BQI(90506.5,"B",CARE,"")),TYP=$P(^BQI(90506.5,CRN,0),U,2)
  1. . S DISPLAY=$$DFNC^BQICEVW()_$C(29)_$$CDEF^BQICEVW()
  1. . S SORT=$$SFNC^BQICEVW(CRN,TYP)
  1. . I CARE="Followup Events" S SDIR="A"_$C(29)_"A"_$C(29)_"A",TEMPL="System Default"
  1. . E S SDIR="A"_$C(29)_"D"_$C(29)_"A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. K CARE
  1. ;
  1. DFD ; for Definition Detail
  1. NEW CARE,BQCN
  1. S BQCN=0
  1. F S BQCN=$O(^BQI(90506.5,BQCN)) Q:'BQCN D
  1. . I $P(^BQI(90506.5,BQCN,0),U,15)'=1 Q
  1. . I $P(^BQI(90506.5,BQCN,0),U,10)=1 Q
  1. . S CARE=$P(^BQI(90506.5,BQCN,0),U,1)
  1. . N TIEN,TEMPL,DEF,CRN,TYP,DISPLAY,SORT,SDIR
  1. . ;
  1. . ;Check for a template
  1. . I $$TMPL^BQICMVW(CARE) Q
  1. . ;
  1. . ;Check for a customized view
  1. . I $$CVW^BQICMVW(CARE) D Q
  1. .. S @DATA@(II)=$TR(@DATA@(II),$C(30))
  1. .. S $P(@DATA@(II),U,8)=""
  1. .. I $E(@DATA@(II),$L(@DATA@(II)))'=$C(30) S @DATA@(II)=@DATA@(II)_$C(30)
  1. . ;
  1. . ;System Default
  1. . S TIEN="",TEMPL="",DEF=""
  1. . S CRN=$O(^BQI(90506.5,"B",CARE,"")),TYP=$P(^BQI(90506.5,CRN,0),U,2)
  1. . S DISPLAY=$$DFNC^BQICMVW()_$C(29)_$$CDEF^BQICMVW()
  1. . S SORT=$$SFNC^BQICMVW()
  1. . S SDIR="A",TEMPL="System Default"
  1. . S II=II+1,@DATA@(II)=TIEN_U_TEMPL_U_DEF_U_TYP_U_DISPLAY_U_SORT_U_SDIR_U_$C(30)
  1. ;
  1. DONE ;
  1. S II=II+1,@DATA@(II)=$C(31)
  1. Q
  1. ;
  1. ERR ;
  1. D ^%ZTER
  1. NEW Y,ERRDTM
  1. S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
  1. S BMXSEC="Recording that an error occurred at "_ERRDTM
  1. I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
  1. Q
  1. ;
  1. UPD(DATA,OWNR,PLIEN,TYPE,TEMPL,SOR,SDIR,DOR) ; EP - BQI SET PANEL LAYOUTS
  1. NEW UID,II,IEN,LIST,BN
  1. K ERROR
  1. S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
  1. S DATA=$NA(^TMP("BQIPLYUP",UID))
  1. K @DATA
  1. S II=0
  1. S @DATA@(II)="I00010RESULT"_$C(30)
  1. ;
  1. NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLLAY D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
  1. ;
  1. S TEMPL=$G(TEMPL,""),SOR=$G(SOR,""),SDIR=$G(SDIR,""),DOR=$G(DOR,"")
  1. I DOR="" D
  1. . S LIST="",BN=""
  1. . F S BN=$O(DOR(BN)) Q:BN="" S LIST=LIST_DOR(BN)
  1. . K DOR
  1. . S DOR=LIST
  1. . K LIST
  1. ;
  1. I TYPE="D" D FIL^BQIPLVWC(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
  1. I TYPE="G" D FIL^BQIGPVW(OWNR,PLIEN,$G(YEAR),$G(TEMPL),SOR,SDIR,DOR) G FIN
  1. I TYPE="R" D FIL^BQIPLRVW(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
  1. I TYPE="CN" D FIL^BQIPLCNV(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
  1. I TYPE="RF" D FIL^BQIPLRFV(OWNR,PLIEN,$G(TEMPL),SOR,SDIR,DOR) G FIN
  1. S CRN=$O(^BQI(90506.5,"C",TYPE,""))
  1. I CRN'="" D
  1. . S CARE=$P(^BQI(90506.5,CRN,0),"^",1)
  1. . I $P(^BQI(90506.5,CRN,0),U,10)=1 Q
  1. . D FIL^BQICMVW(OWNR,PLIEN,CARE,$G(TEMPL),SOR,SDIR,DOR)
  1. ;
  1. FIN ; Finish up
  1. I $D(ERROR) S II=II+1,@DATA@(II)="-1"_$C(30)
  1. I '$D(ERROR) S II=II+1,@DATA@(II)="1"_$C(30)
  1. K ERROR
  1. S II=II+1,@DATA@(II)=$C(31)
  1. Q