BQIRMCHK ;GDIT/HCSD/ALA-Check duplicate reminders ; 22 Sep 2015 6:41 AM
;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
;
;
EN ; EP
I $G(TJOB)'="Weekly" Q
NEW IEN,NAME,CODE,ARRAY,CT
S IEN=""
F S IEN=$O(^BQI(90506.1,"AC","R",IEN)) Q:IEN="" D
. I $P(^BQI(90506.1,IEN,0),"^",10)=1 Q
. S NAME=$P(^BQI(90506.1,IEN,0),"^",3),CODE=$P(^(0),"^",1)
. I $P(CODE,"_",1)'="EHR" Q
. S ARRAY(NAME,IEN)=CODE
;
S NAME=""
F S NAME=$O(ARRAY(NAME)) Q:NAME="" D
. S CT=0,IEN=""
. F S IEN=$O(ARRAY(NAME,IEN)) Q:IEN="" S CT=CT+1
. I CT<2 K ARRAY(NAME)
;
I '$D(ARRAY) Q
;
; Send notification message
NEW OWNR,PLIEN,SUBJECT,BODY,RIEN
S OWNR=0
F S OWNR=$O(^BQICARE(OWNR)) Q:'OWNR D
. I '$$KEYCHK^BQIULSC("BQIZMGR",OWNR) Q
. S SUBJECT="Duplicate EHR reminders found"
. S BODY(1)="The following duplicate EHR reminders are active. Please contact the EHR"_$C(10)_$C(13)
. S BODY(2)="Reminder CAC to go to the Reminder Definition Management menu and inactivate"_$C(10)_$C(13)
. S BODY(3)="the incorrect duplicate reminders."_$C(10)_$C(13)
. S BODY(4)=" ",CT=4
. S NAME=""
. F S NAME=$O(ARRAY(NAME)) Q:NAME="" D
.. S IEN=""
.. F S IEN=$O(ARRAY(NAME,IEN)) Q:IEN="" D
... S CODE=ARRAY(NAME,IEN),RIEN=$P(CODE,"_",2)
... S CT=CT+1,BODY(CT)=" "_NAME_" ["_$P(^PXD(811.9,RIEN,0),"^",1)_"]"_$C(10)_$C(13)
. D ADD^BQINOTF("",OWNR,SUBJECT,.BODY,1)
;
Q
BQIRMCHK ;GDIT/HCSD/ALA-Check duplicate reminders ; 22 Sep 2015 6:41 AM
+1 ;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
+2 ;
+3 ;
EN ; EP
+1 IF $GET(TJOB)'="Weekly"
QUIT
+2 NEW IEN,NAME,CODE,ARRAY,CT
+3 SET IEN=""
+4 FOR
SET IEN=$ORDER(^BQI(90506.1,"AC","R",IEN))
IF IEN=""
QUIT
Begin DoDot:1
+5 IF $PIECE(^BQI(90506.1,IEN,0),"^",10)=1
QUIT
+6 SET NAME=$PIECE(^BQI(90506.1,IEN,0),"^",3)
SET CODE=$PIECE(^(0),"^",1)
+7 IF $PIECE(CODE,"_",1)'="EHR"
QUIT
+8 SET ARRAY(NAME,IEN)=CODE
End DoDot:1
+9 ;
+10 SET NAME=""
+11 FOR
SET NAME=$ORDER(ARRAY(NAME))
IF NAME=""
QUIT
Begin DoDot:1
+12 SET CT=0
SET IEN=""
+13 FOR
SET IEN=$ORDER(ARRAY(NAME,IEN))
IF IEN=""
QUIT
SET CT=CT+1
+14 IF CT<2
KILL ARRAY(NAME)
End DoDot:1
+15 ;
+16 IF '$DATA(ARRAY)
QUIT
+17 ;
+18 ; Send notification message
+19 NEW OWNR,PLIEN,SUBJECT,BODY,RIEN
+20 SET OWNR=0
+21 FOR
SET OWNR=$ORDER(^BQICARE(OWNR))
IF 'OWNR
QUIT
Begin DoDot:1
+22 IF '$$KEYCHK^BQIULSC("BQIZMGR",OWNR)
QUIT
+23 SET SUBJECT="Duplicate EHR reminders found"
+24 SET BODY(1)="The following duplicate EHR reminders are active. Please contact the EHR"_$CHAR(10)_$CHAR(13)
+25 SET BODY(2)="Reminder CAC to go to the Reminder Definition Management menu and inactivate"_$CHAR(10)_$CHAR(13)
+26 SET BODY(3)="the incorrect duplicate reminders."_$CHAR(10)_$CHAR(13)
+27 SET BODY(4)=" "
SET CT=4
+28 SET NAME=""
+29 FOR
SET NAME=$ORDER(ARRAY(NAME))
IF NAME=""
QUIT
Begin DoDot:2
+30 SET IEN=""
+31 FOR
SET IEN=$ORDER(ARRAY(NAME,IEN))
IF IEN=""
QUIT
Begin DoDot:3
+32 SET CODE=ARRAY(NAME,IEN)
SET RIEN=$PIECE(CODE,"_",2)
+33 SET CT=CT+1
SET BODY(CT)=" "_NAME_" ["_$PIECE(^PXD(811.9,RIEN,0),"^",1)_"]"_$CHAR(10)_$CHAR(13)
End DoDot:3
End DoDot:2
+34 DO ADD^BQINOTF("",OWNR,SUBJECT,.BODY,1)
End DoDot:1
+35 ;
+36 QUIT