BQIPLRT ;PRXM/HC/DLS - Panel List Displays ; 26 Oct 2005 9:24 AM
;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
;
Q
;
; NOTE: There are three types of lists you can generate here.
; You can run:
; LISTS - to get a combined list (both owned & shared).
; OWNED - to get Panels owned by the user.
; SHARED - to get Panels shared by the user (owned by someone else).
;
LISTS(DATA,OWNR) ; PEP -- BQI GET PANEL LIST
;Description
; Returns a list of panels owned by the user and shared by the user with another owner.
;
;Input
; OWNR - DUZ of the panel list owner (if not the current user)
; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
;
;Output
; ^TMP("BQIPLRT") - name of global (passed by reference) in which the data is stored.
;
;Variables Used
; UID - Unique TMP global subscript.
;
N UID,X,BQII,DA,OWNRNM,OWNRIEN,PLMSG,PLNME,PLIEN,IENS,PLDEFUPD,PCAT
N PLAUTO,PLLSTPOP,PLLSTUPD,PLCNT,PLDESC,PLRTS,PLCRBY,PLDATA,PLID,PLSTAT
N SHSTDT,SHENDT,SHAXCS,AUTOSTAT,PLCRDT,PLDFUPBY,PLPOPBY,PLUPBY,IPCPL
N BQIPREF,BQIFLAG
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S BQII=0
S DATA=$NA(^TMP("BQIPLRT",UID))
K @DATA
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLRT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
;Default to DUZ if OWNR is not passed in
S:$G(OWNR)="" OWNR=DUZ
;
D HDR
;
; If there are no owned or shared panels, don't do anything.
I '$D(^BQICARE(OWNR,1,"B")),'$D(^BQICARE("C",OWNR)) G DONE
;
; Get Panels Owned by User
S OWNRNM=$$GET1^DIQ(90505,OWNR,.01,"E")
D RET^BQIFLAG(OWNR,.BQIPREF)
S PLIEN=0,DA(1)=OWNR
F S PLIEN=$O(^BQICARE(OWNR,1,PLIEN)) Q:'PLIEN D
. I $G(^BQICARE(OWNR,1,PLIEN,0))="" K ^BQICARE(OWNR,1,PLIEN) Q
. S DA=PLIEN,IENS=$$IENS^DILF(.DA)
. S PLID=$$PLID^BQIUG1(OWNR,PLIEN)
. D GETDATA(OWNR,PLIEN)
. S BQII=BQII+1,@DATA@(BQII)=OWNR_PLDATA_$C(30)
. I $O(^BQICARE(OWNR,1,PLIEN,30,0))'="" D
.. S @DATA@(BQII)=OWNR_PLDATA_"Y"_$C(30)
;
; Get Panels Shared with Another Owner
S (OWNRIEN,PLIEN)=""
F S OWNRIEN=$O(^BQICARE("C",OWNR,OWNRIEN)) Q:'OWNRIEN D
. F S PLIEN=$O(^BQICARE("C",OWNR,OWNRIEN,PLIEN)) Q:'PLIEN D
.. N DA
.. S DA(2)=OWNRIEN,DA(1)=PLIEN,DA=OWNR
.. S IENS=$$IENS^DILF(.DA)
.. S SHAXCS=$$GET1^DIQ(90505.03,IENS,.02,"I")
.. S SHSTDT=$$GET1^DIQ(90505.03,IENS,.03,"I")
.. S SHENDT=$$GET1^DIQ(90505.03,IENS,.04,"I")
.. ; IF shared user start date is not after today (or null) AND
.. ; IF shared user end date is after today (or null) AND
.. ; IF shared user access is not 'I'nactive, THEN proceed.
.. I SHSTDT'>DT,((SHENDT'<DT)!(SHENDT="")),SHAXCS'="I" D
... N DA
... S DA=PLIEN,DA(1)=OWNRIEN,IENS=$$IENS^DILF(.DA)
... S OWNRNM=$$GET1^DIQ(90505,OWNRIEN,.01,"E")
... S PLID=$$PLID^BQIUG1(OWNRIEN,PLIEN)
... NEW PLDEFUPD,PLDFUPBY,PLLSTPOP,PLLSTUPD,PLPOPBY,PLUPBY
... D GETDATA(OWNRIEN,PLIEN)
... S BQII=BQII+1,@DATA@(BQII)=OWNRIEN_PLDATA_SHAXCS_$C(30)
G DONE
;
OWNED(DATA,FAKE) ;EP - BQI LIST OF OWNED PANELS OF A USER
;Description
; Returns a list of panels owned by the user.
;
;Input
; DUZ - User internal entry number
;
;Output
; ^TMP("BQIPLRT") - Name of global (passed by reference) in which the data is stored.
;
;Variables Used
; UID - Unique TMP global subscript.
;
N UID,X,BQII,DA,OWNRNM,OWNRIEN,PLMSG,PLNME,PLIEN,IENS,PLDEFUPD,PLAUTO,PLLSTPOP,PLLSTUPD
N PLCNT,PLDESC,PLRTS,PLCRBY,PLDATA,PLID
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLRT",UID))
K ^TMP("BQIPLRT",UID)
;
S BQII=0
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLRT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
D HDR
;
I '$D(^BQICARE(DUZ,1,"B")) G DONE
;
S OWNRNM=$$GET1^DIQ(90505,DUZ,.01,"E")
S PLIEN=0,DA(1)=DUZ
F S PLIEN=$O(^BQICARE(DUZ,1,PLIEN)) Q:'PLIEN D
. S DA=PLIEN,IENS=$$IENS^DILF(.DA)
. S PLID=$$PLID^BQIUG1(DUZ,PLIEN)
. D GETDATA(DUZ,PLIEN)
. S BQII=BQII+1,@DATA@(BQII)=DUZ_PLDATA_$C(30)
G DONE
;
SHARED(DATA,FAKE) ;EP - BQI LIST OF SHARED PANELS OF A USER
;Description
; Returns a list of panels shared by the user with another owner.
;
;Input
; DUZ - User internal entry number
;
;Output
; ^TMP("BQIPLRT") - Name of global (passed by reference) in which the data is stored.
;
;Variables Used
; UID - Unique TMP global subscript.
;
N UID,X,BQII,DA,OWNRNM,OWNRIEN,PLMSG,PLNME,PLIEN,IENS,PLDEFUPD,PLAUTO,PLLSTPOP,PLLSTUPD
N PLCNT,PLDESC,PLRTS,PLCRBY,PLDATA,PLID
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLRT",UID))
K @DATA
;
S BQII=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLRT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
D HDR
;
I '$D(^BQICARE("C",DUZ)) G DONE
;
S (OWNRIEN,PLIEN)=""
F S OWNRIEN=$O(^BQICARE("C",DUZ,OWNRIEN)) Q:'OWNRIEN D
. F S PLIEN=$O(^BQICARE("C",DUZ,OWNRIEN,PLIEN)) Q:'PLIEN D
.. S DA=PLIEN,DA(1)=OWNRIEN,IENS=$$IENS^DILF(.DA)
.. I $G(^BQICARE(OWNRIEN,1,PLIEN,0))="" Q
.. S OWNRNM=$$GET1^DIQ(90505,OWNRIEN,.01,"E")
.. S PLID=$$PLID^BQIUG1(OWNRIEN,PLIEN)
.. D GETDATA(OWNRIEN,PLIEN)
.. S BQII=BQII+1,@DATA@(BQII)=OWNRIEN_PLDATA_$C(30)
G DONE
;
HDR ;
NEW HDR
S HDR="I00010OWNER^T00035OWNER_NAME^I00010PANEL_IEN^T00015PANEL_ID^T00120PANEL_NAME^T00250PANEL_DESCRIPTION^"
S HDR=HDR_"T00003FLAGS^I00006TOTAL_PATIENTS^D00021DT_DEF_LAST_UPDATED^D00021DT_LAST_POPULATED^D00021DT_PATIENT_LIST_LAST_UPDATED^"
S HDR=HDR_"T00009AUTOPOPULATE_FLAG^T00035CREATED_BY^T00001STATUS^T00035DEF_LAST_UPDATED_BY^T00035PAT_LIST_UPDATED_BY^"
S HDR=HDR_"T00035LAST_POPULATED_BY^T00001AUTO_STATUS^T00001SOURCE_TYPE^T00003IPC_PANEL^T00030PANEL_CATEGORY^T00002SHARE_ACCESS"
S @DATA@(BQII)=HDR_$C(30)
Q
;
GETDATA(OWNR,PLIEN) ;EP
;Parameters
; PLNME - Panel Name
; PLDEFUPD - Date/time panel definition last updated
; PLAUTO - Autorefresh flag
; PLLSTPOP - Date/time panel last populated
; PLLSTUPD - Date/time patient list last updated
; PLUPBY - Definition last updated by
; PLDFUPBY - Patient list last updated by
; PLCRDT - Date/time panel created
; PLSTAT - Status of panel while editing
; PLCNT - Number of patients in panel
; PLDESC - Panel description
; PLRTS - Panel contains patients with flags
; PLCRBY - Panel created by (owner)
; AUTOSTAT - Autopopulate status
; IPCPL - IPC Panel flag
; PCAT - Panel Category
NEW BQITMP,PCAT,IPCPL
NEW PLNME,PLDEFUPD,PLAUTO,PLLSTPOP,PLLSTUPD,PLUPBY,PLDFUPBY,PLPOPBY,PLCRDT,PLSTAT,PLCNT
NEW PLDESC,PLRTS,PLCRBY,AUTOSTAT,SRCTYP
D GETS^DIQ(90505.01,IENS,".01;.02;.03;.04;.05;.06;.07;.08;.09;.1;.12;.13;1;2.1;2.2;3.4;3.5;3.6","IE","BQITMP")
S PLNME=$G(BQITMP(90505.01,IENS,.01,"E"))
S SRCTYP=$G(BQITMP(90505.01,IENS,.03,"I"))
S PLDEFUPD=$$FMTE^BQIUL1($G(BQITMP(90505.01,IENS,.05,"I")))
S PLAUTO=$G(BQITMP(90505.01,IENS,.06,"I"))
I $G(BQITMP(90505.01,IENS,.07,"I"))'="" S PLLSTPOP=$$FMTE^BQIUL1(BQITMP(90505.01,IENS,.07,"I"))
I $G(BQITMP(90505.01,IENS,.09,"I"))'="" S PLLSTUPD=$$FMTE^BQIUL1(BQITMP(90505.01,IENS,.09,"I"))
S PLUPBY=$G(BQITMP(90505.01,IENS,.04,"E"))
S PLDFUPBY=$G(BQITMP(90505.01,IENS,.08,"E"))
S PLPOPBY=$G(BQITMP(90505.01,IENS,3.5,"E"))
I $G(BQITMP(90505.01,IENS,.02,"I"))'="" S PLCRDT=$$FMTE^BQIUL1(BQITMP(90505.01,IENS,.02,"I"))
S PLSTAT=$G(BQITMP(90505.01,IENS,.13,"I"))
S PLCNT=$G(BQITMP(90505.01,IENS,.1,"E"))
I PLCNT="" S PLCNT=0
S PLDESC=$G(BQITMP(90505.01,IENS,1,"E"))
S PLRTS=$G(BQITMP(90505.01,IENS,.12,"E"))
;
NEW DFN
S DFN=0,BQIFLAG=0
F S DFN=$O(^BQICARE(OWNR,1,PLIEN,40,DFN)) Q:'DFN D Q:BQIFLAG
. I $P(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,2)="R" Q
. S BQIFLAG=$$FPAT^BQIFLAG(DFN,DUZ,.BQIPREF)
S PLRTS=$S(BQIFLAG:"YES",1:"")
S PLCRBY=OWNRNM
S AUTOSTAT=$G(BQITMP(90505.01,IENS,3.4,"I"))
S IPCPL=$S($G(BQITMP(90505.01,IENS,2.1,"E"))="IPC Panel":"YES",1:"")
S PCAT=$$PCAT^BQIPLDF(OWNR,PLIEN)
S PLDATA="^"_OWNRNM_"^"_PLIEN_"^"_PLID_"^"_PLNME_"^"_PLDESC_"^"_PLRTS_"^"_PLCNT_"^"_PLDEFUPD_"^"
S PLDATA=PLDATA_$G(PLLSTPOP)_"^"_$G(PLLSTUPD)_"^"_PLAUTO_"^"_PLCRBY_"^"_PLSTAT_"^"_PLUPBY_"^"
S PLDATA=PLDATA_PLDFUPBY_"^"_PLPOPBY_"^"_AUTOSTAT_"^"_SRCTYP_"^"_IPCPL_"^"_PCAT_"^"
Q
;
DONE ;
S BQII=BQII+1,@DATA@(BQII)=$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(BQII),$D(DATA) S BQII=BQII+1,@DATA@(BQII)=$C(31)
Q
BQIPLRT ;PRXM/HC/DLS - Panel List Displays ; 26 Oct 2005 9:24 AM
+1 ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
+2 ;
+3 QUIT
+4 ;
+5 ; NOTE: There are three types of lists you can generate here.
+6 ; You can run:
+7 ; LISTS - to get a combined list (both owned & shared).
+8 ; OWNED - to get Panels owned by the user.
+9 ; SHARED - to get Panels shared by the user (owned by someone else).
+10 ;
LISTS(DATA,OWNR) ; PEP -- BQI GET PANEL LIST
+1 ;Description
+2 ; Returns a list of panels owned by the user and shared by the user with another owner.
+3 ;
+4 ;Input
+5 ; OWNR - DUZ of the panel list owner (if not the current user)
+6 ; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
+7 ;
+8 ;Output
+9 ; ^TMP("BQIPLRT") - name of global (passed by reference) in which the data is stored.
+10 ;
+11 ;Variables Used
+12 ; UID - Unique TMP global subscript.
+13 ;
+14 NEW UID,X,BQII,DA,OWNRNM,OWNRIEN,PLMSG,PLNME,PLIEN,IENS,PLDEFUPD,PCAT
+15 NEW PLAUTO,PLLSTPOP,PLLSTUPD,PLCNT,PLDESC,PLRTS,PLCRBY,PLDATA,PLID,PLSTAT
+16 NEW SHSTDT,SHENDT,SHAXCS,AUTOSTAT,PLCRDT,PLDFUPBY,PLPOPBY,PLUPBY,IPCPL
+17 NEW BQIPREF,BQIFLAG
+18 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+19 SET BQII=0
+20 SET DATA=$NAME(^TMP("BQIPLRT",UID))
+21 KILL @DATA
+22 ;
+23 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLRT D UNWIND^%ZTER"
+24 ;
+25 ;Default to DUZ if OWNR is not passed in
+26 IF $GET(OWNR)=""
SET OWNR=DUZ
+27 ;
+28 DO HDR
+29 ;
+30 ; If there are no owned or shared panels, don't do anything.
+31 IF '$DATA(^BQICARE(OWNR,1,"B"))
IF '$DATA(^BQICARE("C",OWNR))
GOTO DONE
+32 ;
+33 ; Get Panels Owned by User
+34 SET OWNRNM=$$GET1^DIQ(90505,OWNR,.01,"E")
+35 DO RET^BQIFLAG(OWNR,.BQIPREF)
+36 SET PLIEN=0
SET DA(1)=OWNR
+37 FOR
SET PLIEN=$ORDER(^BQICARE(OWNR,1,PLIEN))
IF 'PLIEN
QUIT
Begin DoDot:1
+38 IF $GET(^BQICARE(OWNR,1,PLIEN,0))=""
KILL ^BQICARE(OWNR,1,PLIEN)
QUIT
+39 SET DA=PLIEN
SET IENS=$$IENS^DILF(.DA)
+40 SET PLID=$$PLID^BQIUG1(OWNR,PLIEN)
+41 DO GETDATA(OWNR,PLIEN)
+42 SET BQII=BQII+1
SET @DATA@(BQII)=OWNR_PLDATA_$CHAR(30)
+43 IF $ORDER(^BQICARE(OWNR,1,PLIEN,30,0))'=""
Begin DoDot:2
+44 SET @DATA@(BQII)=OWNR_PLDATA_"Y"_$CHAR(30)
End DoDot:2
End DoDot:1
+45 ;
+46 ; Get Panels Shared with Another Owner
+47 SET (OWNRIEN,PLIEN)=""
+48 FOR
SET OWNRIEN=$ORDER(^BQICARE("C",OWNR,OWNRIEN))
IF 'OWNRIEN
QUIT
Begin DoDot:1
+49 FOR
SET PLIEN=$ORDER(^BQICARE("C",OWNR,OWNRIEN,PLIEN))
IF 'PLIEN
QUIT
Begin DoDot:2
+50 NEW DA
+51 SET DA(2)=OWNRIEN
SET DA(1)=PLIEN
SET DA=OWNR
+52 SET IENS=$$IENS^DILF(.DA)
+53 SET SHAXCS=$$GET1^DIQ(90505.03,IENS,.02,"I")
+54 SET SHSTDT=$$GET1^DIQ(90505.03,IENS,.03,"I")
+55 SET SHENDT=$$GET1^DIQ(90505.03,IENS,.04,"I")
+56 ; IF shared user start date is not after today (or null) AND
+57 ; IF shared user end date is after today (or null) AND
+58 ; IF shared user access is not 'I'nactive, THEN proceed.
+59 IF SHSTDT'>DT
IF ((SHENDT'<DT)!(SHENDT=""))
IF SHAXCS'="I"
Begin DoDot:3
+60 NEW DA
+61 SET DA=PLIEN
SET DA(1)=OWNRIEN
SET IENS=$$IENS^DILF(.DA)
+62 SET OWNRNM=$$GET1^DIQ(90505,OWNRIEN,.01,"E")
+63 SET PLID=$$PLID^BQIUG1(OWNRIEN,PLIEN)
+64 NEW PLDEFUPD,PLDFUPBY,PLLSTPOP,PLLSTUPD,PLPOPBY,PLUPBY
+65 DO GETDATA(OWNRIEN,PLIEN)
+66 SET BQII=BQII+1
SET @DATA@(BQII)=OWNRIEN_PLDATA_SHAXCS_$CHAR(30)
End DoDot:3
End DoDot:2
End DoDot:1
+67 GOTO DONE
+68 ;
OWNED(DATA,FAKE) ;EP - BQI LIST OF OWNED PANELS OF A USER
+1 ;Description
+2 ; Returns a list of panels owned by the user.
+3 ;
+4 ;Input
+5 ; DUZ - User internal entry number
+6 ;
+7 ;Output
+8 ; ^TMP("BQIPLRT") - Name of global (passed by reference) in which the data is stored.
+9 ;
+10 ;Variables Used
+11 ; UID - Unique TMP global subscript.
+12 ;
+13 NEW UID,X,BQII,DA,OWNRNM,OWNRIEN,PLMSG,PLNME,PLIEN,IENS,PLDEFUPD,PLAUTO,PLLSTPOP,PLLSTUPD
+14 NEW PLCNT,PLDESC,PLRTS,PLCRBY,PLDATA,PLID
+15 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+16 SET DATA=$NAME(^TMP("BQIPLRT",UID))
+17 KILL ^TMP("BQIPLRT",UID)
+18 ;
+19 SET BQII=0
+20 ;
+21 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLRT D UNWIND^%ZTER"
+22 ;
+23 DO HDR
+24 ;
+25 IF '$DATA(^BQICARE(DUZ,1,"B"))
GOTO DONE
+26 ;
+27 SET OWNRNM=$$GET1^DIQ(90505,DUZ,.01,"E")
+28 SET PLIEN=0
SET DA(1)=DUZ
+29 FOR
SET PLIEN=$ORDER(^BQICARE(DUZ,1,PLIEN))
IF 'PLIEN
QUIT
Begin DoDot:1
+30 SET DA=PLIEN
SET IENS=$$IENS^DILF(.DA)
+31 SET PLID=$$PLID^BQIUG1(DUZ,PLIEN)
+32 DO GETDATA(DUZ,PLIEN)
+33 SET BQII=BQII+1
SET @DATA@(BQII)=DUZ_PLDATA_$CHAR(30)
End DoDot:1
+34 GOTO DONE
+35 ;
SHARED(DATA,FAKE) ;EP - BQI LIST OF SHARED PANELS OF A USER
+1 ;Description
+2 ; Returns a list of panels shared by the user with another owner.
+3 ;
+4 ;Input
+5 ; DUZ - User internal entry number
+6 ;
+7 ;Output
+8 ; ^TMP("BQIPLRT") - Name of global (passed by reference) in which the data is stored.
+9 ;
+10 ;Variables Used
+11 ; UID - Unique TMP global subscript.
+12 ;
+13 NEW UID,X,BQII,DA,OWNRNM,OWNRIEN,PLMSG,PLNME,PLIEN,IENS,PLDEFUPD,PLAUTO,PLLSTPOP,PLLSTUPD
+14 NEW PLCNT,PLDESC,PLRTS,PLCRBY,PLDATA,PLID
+15 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+16 SET DATA=$NAME(^TMP("BQIPLRT",UID))
+17 KILL @DATA
+18 ;
+19 SET BQII=0
+20 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLRT D UNWIND^%ZTER"
+21 ;
+22 DO HDR
+23 ;
+24 IF '$DATA(^BQICARE("C",DUZ))
GOTO DONE
+25 ;
+26 SET (OWNRIEN,PLIEN)=""
+27 FOR
SET OWNRIEN=$ORDER(^BQICARE("C",DUZ,OWNRIEN))
IF 'OWNRIEN
QUIT
Begin DoDot:1
+28 FOR
SET PLIEN=$ORDER(^BQICARE("C",DUZ,OWNRIEN,PLIEN))
IF 'PLIEN
QUIT
Begin DoDot:2
+29 SET DA=PLIEN
SET DA(1)=OWNRIEN
SET IENS=$$IENS^DILF(.DA)
+30 IF $GET(^BQICARE(OWNRIEN,1,PLIEN,0))=""
QUIT
+31 SET OWNRNM=$$GET1^DIQ(90505,OWNRIEN,.01,"E")
+32 SET PLID=$$PLID^BQIUG1(OWNRIEN,PLIEN)
+33 DO GETDATA(OWNRIEN,PLIEN)
+34 SET BQII=BQII+1
SET @DATA@(BQII)=OWNRIEN_PLDATA_$CHAR(30)
End DoDot:2
End DoDot:1
+35 GOTO DONE
+36 ;
HDR ;
+1 NEW HDR
+2 SET HDR="I00010OWNER^T00035OWNER_NAME^I00010PANEL_IEN^T00015PANEL_ID^T00120PANEL_NAME^T00250PANEL_DESCRIPTION^"
+3 SET HDR=HDR_"T00003FLAGS^I00006TOTAL_PATIENTS^D00021DT_DEF_LAST_UPDATED^D00021DT_LAST_POPULATED^D00021DT_PATIENT_LIST_LAST_UPDATED^"
+4 SET HDR=HDR_"T00009AUTOPOPULATE_FLAG^T00035CREATED_BY^T00001STATUS^T00035DEF_LAST_UPDATED_BY^T00035PAT_LIST_UPDATED_BY^"
+5 SET HDR=HDR_"T00035LAST_POPULATED_BY^T00001AUTO_STATUS^T00001SOURCE_TYPE^T00003IPC_PANEL^T00030PANEL_CATEGORY^T00002SHARE_ACCESS"
+6 SET @DATA@(BQII)=HDR_$CHAR(30)
+7 QUIT
+8 ;
GETDATA(OWNR,PLIEN) ;EP
+1 ;Parameters
+2 ; PLNME - Panel Name
+3 ; PLDEFUPD - Date/time panel definition last updated
+4 ; PLAUTO - Autorefresh flag
+5 ; PLLSTPOP - Date/time panel last populated
+6 ; PLLSTUPD - Date/time patient list last updated
+7 ; PLUPBY - Definition last updated by
+8 ; PLDFUPBY - Patient list last updated by
+9 ; PLCRDT - Date/time panel created
+10 ; PLSTAT - Status of panel while editing
+11 ; PLCNT - Number of patients in panel
+12 ; PLDESC - Panel description
+13 ; PLRTS - Panel contains patients with flags
+14 ; PLCRBY - Panel created by (owner)
+15 ; AUTOSTAT - Autopopulate status
+16 ; IPCPL - IPC Panel flag
+17 ; PCAT - Panel Category
+18 NEW BQITMP,PCAT,IPCPL
+19 NEW PLNME,PLDEFUPD,PLAUTO,PLLSTPOP,PLLSTUPD,PLUPBY,PLDFUPBY,PLPOPBY,PLCRDT,PLSTAT,PLCNT
+20 NEW PLDESC,PLRTS,PLCRBY,AUTOSTAT,SRCTYP
+21 DO GETS^DIQ(90505.01,IENS,".01;.02;.03;.04;.05;.06;.07;.08;.09;.1;.12;.13;1;2.1;2.2;3.4;3.5;3.6","IE","BQITMP")
+22 SET PLNME=$GET(BQITMP(90505.01,IENS,.01,"E"))
+23 SET SRCTYP=$GET(BQITMP(90505.01,IENS,.03,"I"))
+24 SET PLDEFUPD=$$FMTE^BQIUL1($GET(BQITMP(90505.01,IENS,.05,"I")))
+25 SET PLAUTO=$GET(BQITMP(90505.01,IENS,.06,"I"))
+26 IF $GET(BQITMP(90505.01,IENS,.07,"I"))'=""
SET PLLSTPOP=$$FMTE^BQIUL1(BQITMP(90505.01,IENS,.07,"I"))
+27 IF $GET(BQITMP(90505.01,IENS,.09,"I"))'=""
SET PLLSTUPD=$$FMTE^BQIUL1(BQITMP(90505.01,IENS,.09,"I"))
+28 SET PLUPBY=$GET(BQITMP(90505.01,IENS,.04,"E"))
+29 SET PLDFUPBY=$GET(BQITMP(90505.01,IENS,.08,"E"))
+30 SET PLPOPBY=$GET(BQITMP(90505.01,IENS,3.5,"E"))
+31 IF $GET(BQITMP(90505.01,IENS,.02,"I"))'=""
SET PLCRDT=$$FMTE^BQIUL1(BQITMP(90505.01,IENS,.02,"I"))
+32 SET PLSTAT=$GET(BQITMP(90505.01,IENS,.13,"I"))
+33 SET PLCNT=$GET(BQITMP(90505.01,IENS,.1,"E"))
+34 IF PLCNT=""
SET PLCNT=0
+35 SET PLDESC=$GET(BQITMP(90505.01,IENS,1,"E"))
+36 SET PLRTS=$GET(BQITMP(90505.01,IENS,.12,"E"))
+37 ;
+38 NEW DFN
+39 SET DFN=0
SET BQIFLAG=0
+40 FOR
SET DFN=$ORDER(^BQICARE(OWNR,1,PLIEN,40,DFN))
IF 'DFN
QUIT
Begin DoDot:1
+41 IF $PIECE(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,2)="R"
QUIT
+42 SET BQIFLAG=$$FPAT^BQIFLAG(DFN,DUZ,.BQIPREF)
End DoDot:1
IF BQIFLAG
QUIT
+43 SET PLRTS=$SELECT(BQIFLAG:"YES",1:"")
+44 SET PLCRBY=OWNRNM
+45 SET AUTOSTAT=$GET(BQITMP(90505.01,IENS,3.4,"I"))
+46 SET IPCPL=$SELECT($GET(BQITMP(90505.01,IENS,2.1,"E"))="IPC Panel":"YES",1:"")
+47 SET PCAT=$$PCAT^BQIPLDF(OWNR,PLIEN)
+48 SET PLDATA="^"_OWNRNM_"^"_PLIEN_"^"_PLID_"^"_PLNME_"^"_PLDESC_"^"_PLRTS_"^"_PLCNT_"^"_PLDEFUPD_"^"
+49 SET PLDATA=PLDATA_$GET(PLLSTPOP)_"^"_$GET(PLLSTUPD)_"^"_PLAUTO_"^"_PLCRBY_"^"_PLSTAT_"^"_PLUPBY_"^"
+50 SET PLDATA=PLDATA_PLDFUPBY_"^"_PLPOPBY_"^"_AUTOSTAT_"^"_SRCTYP_"^"_IPCPL_"^"_PCAT_"^"
+51 QUIT
+52 ;
DONE ;
+1 SET BQII=BQII+1
SET @DATA@(BQII)=$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(BQII)
IF $DATA(DATA)
SET BQII=BQII+1
SET @DATA@(BQII)=$CHAR(31)
+6 QUIT