BQIPLPU ;GDIT/HCSD/ALA-Panel Autopopulate Utility ; 29 Sep 2015 1:06 PM
;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
;
SXRF ;EP - Set cross-reference
I $G(D0)="" S ^BQICARE("AF",X,DA(1),DA)="" Q
S ^BQICARE("AF",X,D0,D1)=""
Q
;
KXRF ; EP - Kill cross-reference
I $G(D0)="" K ^BQICARE("AF",X,DA(1),DA) Q
I $G(D1)="" K ^BQICARE("AF",X,DA(1),DA) Q
K ^BQICARE("AF",X,D0,D1)
Q
;
ORD ; EP - Order the Nightly Autopopulate panels
NEW USR,PNL,BQPB,BQPE,BQDIF,BQIORD,BQIUP,ORD,ORN,IENS,DA
K ^BQICARE("AF")
S USR=""
F S USR=$O(^BQICARE("AC","N",USR)) Q:'USR D
. S PNL=""
. F S PNL=$O(^BQICARE("AC","N",USR,PNL)) Q:'PNL D
.. S BQPB=$P($G(^BQICARE(USR,1,PNL,3)),"^",8)
.. S BQPE=$P($G(^BQICARE(USR,1,PNL,3)),"^",9)
.. S BQDIF=$$FMDIFF^XLFDT(BQPE,BQPB,2)
.. S BQIORD(BQDIF,USR,PNL)=""
.. S DA(1)=USR,DA=PNL,IENS=$$IENS^DILF(.DA)
.. S BQIUP(90505.01,IENS,3.1)="@"
D FILE^DIE("","BQIUP","ERROR")
;
S ORD="",ORN=0
F S ORD=$O(BQIORD(ORD),-1) Q:ORD="" D
. S USR="" F S USR=$O(BQIORD(ORD,USR)) Q:USR="" D
.. S PNL="" F S PNL=$O(BQIORD(ORD,USR,PNL)) Q:PNL="" D
... S ORN=ORN+1,DA(1)=USR,DA=PNL,IENS=$$IENS^DILF(.DA)
... S BQIUP(90505.01,IENS,3.1)=ORN
D FILE^DIE("","BQIUP","ERROR")
Q
BQIPLPU ;GDIT/HCSD/ALA-Panel Autopopulate Utility ; 29 Sep 2015 1:06 PM
+1 ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
+2 ;
SXRF ;EP - Set cross-reference
+1 IF $GET(D0)=""
SET ^BQICARE("AF",X,DA(1),DA)=""
QUIT
+2 SET ^BQICARE("AF",X,D0,D1)=""
+3 QUIT
+4 ;
KXRF ; EP - Kill cross-reference
+1 IF $GET(D0)=""
KILL ^BQICARE("AF",X,DA(1),DA)
QUIT
+2 IF $GET(D1)=""
KILL ^BQICARE("AF",X,DA(1),DA)
QUIT
+3 KILL ^BQICARE("AF",X,D0,D1)
+4 QUIT
+5 ;
ORD ; EP - Order the Nightly Autopopulate panels
+1 NEW USR,PNL,BQPB,BQPE,BQDIF,BQIORD,BQIUP,ORD,ORN,IENS,DA
+2 KILL ^BQICARE("AF")
+3 SET USR=""
+4 FOR
SET USR=$ORDER(^BQICARE("AC","N",USR))
IF 'USR
QUIT
Begin DoDot:1
+5 SET PNL=""
+6 FOR
SET PNL=$ORDER(^BQICARE("AC","N",USR,PNL))
IF 'PNL
QUIT
Begin DoDot:2
+7 SET BQPB=$PIECE($GET(^BQICARE(USR,1,PNL,3)),"^",8)
+8 SET BQPE=$PIECE($GET(^BQICARE(USR,1,PNL,3)),"^",9)
+9 SET BQDIF=$$FMDIFF^XLFDT(BQPE,BQPB,2)
+10 SET BQIORD(BQDIF,USR,PNL)=""
+11 SET DA(1)=USR
SET DA=PNL
SET IENS=$$IENS^DILF(.DA)
+12 SET BQIUP(90505.01,IENS,3.1)="@"
End DoDot:2
End DoDot:1
+13 DO FILE^DIE("","BQIUP","ERROR")
+14 ;
+15 SET ORD=""
SET ORN=0
+16 FOR
SET ORD=$ORDER(BQIORD(ORD),-1)
IF ORD=""
QUIT
Begin DoDot:1
+17 SET USR=""
FOR
SET USR=$ORDER(BQIORD(ORD,USR))
IF USR=""
QUIT
Begin DoDot:2
+18 SET PNL=""
FOR
SET PNL=$ORDER(BQIORD(ORD,USR,PNL))
IF PNL=""
QUIT
Begin DoDot:3
+19 SET ORN=ORN+1
SET DA(1)=USR
SET DA=PNL
SET IENS=$$IENS^DILF(.DA)
+20 SET BQIUP(90505.01,IENS,3.1)=ORN
End DoDot:3
End DoDot:2
End DoDot:1
+21 DO FILE^DIE("","BQIUP","ERROR")
+22 QUIT