BQI25POS ;GDIT/HS/ALA-Post Install for Version 2.5 ; 05 Jan 2015 12:39 PM
;;2.5;ICARE MANAGEMENT SYSTEM;;May 24, 2016;Build 27
;
;
EN ;EP
;Set the version number
NEW DA
S DA=$O(^BQI(90508,0))
S BQIUPD(90508,DA_",",.08)="2.5.0.5"
S BQIUPD(90508,DA_",",.09)="2.5.0.5"
S BQIUPD(90508,DA_",",16.04)="T-12M"
S BQIUPD(90508,DA_",",16.05)="T-365"
D FILE^DIE("","BQIUPD","ERROR")
K BQIUPD
;
;Turn off Ordered field for CMET
NEW BTWN
S BTWN=$O(^BQI(90506.1,"B","BTPWFUOR","")) I BTWN'="" D
. S BQIUPD(90506.1,BTWN_",",.1)=1
. I $P(^BQI(90506.1,BTWN,0),U,11)="" S BQIUPD(90506.1,BTWN_",",.11)=DT
. D FILE^DIE("","BQIUPD","ERROR")
;
; Set BTPWRPC and BUSARPC into BQIRPC
NEW IEN,DA,X,DIC,Y
S DA(1)=$$FIND1^DIC(19,"","B","BQIRPC","","","ERROR"),DIC="^DIC(19,"_DA(1)_",10,",DIC(0)="LMNZ"
I $G(^DIC(19,DA(1),10,0))="" S ^DIC(19,DA(1),10,0)="^19.01IP^^"
S X="BTPWRPC"
D ^DIC I +Y<1 K DO,DD D FILE^DICN
NEW IEN,DA,X,DIC,Y
S DA(1)=$$FIND1^DIC(19,"","B","BQIRPC","","","ERROR"),DIC="^DIC(19,"_DA(1)_",10,",DIC(0)="LMNZ"
I $G(^DIC(19,DA(1),10,0))="" S ^DIC(19,DA(1),10,0)="^19.01IP^^"
S X="BUSARPC"
D ^DIC I +Y<1 K DO,DD D FILE^DICN
;
D ^BQI25PU1
D ^BQI25PU
;
NEW DA
F DA=4,7,26 S BQIUPD(90506.5,DA_",",.16)=1
D FILE^DIE("","BQIUPD","ERROR")
;
; Add Diabetes to Filter Source for Lab tests
S ^BQI(90506.3,2,7,0)="^90506.38P^2^2"
S ^BQI(90506.3,2,7,2,0)=7
S ^BQI(90506.3,2,7,"B",7,2)=""
S $P(^BQI(90507,6,0),"^",17)="Diabetes"
;
;DM Audit
S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT(),,,15)
S ZTDESC="Turn on DM Audit",ZTRTN="DMA^BQI25POS",ZTIO=""
D ^%ZTLOAD
K ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSK
;
;Turn on Immunization Forecaster as Reminders
S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT(),,,25)
S ZTDESC="IZ Forecaster",ZTRTN="IZF^BQI25POS",ZTIO=""
D ^%ZTLOAD
K ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSK
;
MC ;Add Matched Criteria type
NEW BI,TEXT,IEN
F BI=1:1 S TEXT=$P($T(MCT+BI),";;",2) Q:TEXT="" D
. S IEN=$P(TEXT,"|",1),VAL=$P(TEXT,"|",2)
. I $G(^BQI(90506.5,IEN,0))'="" S $P(^BQI(90506.5,IEN,0),"^",17)=VAL
;
;Check for bad records in CMET
NEW IEN,PREVT
S IEN=0
F S IEN=$O(^BTPWP(IEN)) Q:'IEN I $G(^BTPWP(IEN,0))="" K ^BTPWP(IEN)
;
S IEN=0
F S IEN=$O(^BTPWP(IEN)) Q:'IEN S PREVT=$P(^BTPWP(IEN,0),"^",14) I PREVT'="",$P(^BTPWP(IEN,0),"^",5)="" D
. S $P(^BTPWP(IEN,0),"^",5)=$P($G(^BTPWQ(PREVT,0)),"^",5)
Q
;
DMA ;EP - Turn on DM Audit
NEW CIEN
S CIEN=$O(^BQI(90506.5,"B","DM Audit","")) I CIEN="" Q
I $P(^BQI(90506.5,CIEN,0),"^",10)="" Q
S BQIUPD(90506.5,CIEN_",",.1)="@"
I $O(^ACM(41.1,"B","IHS DIABETES",""))'="" D
. S BQIUPD(90508,"1,",21.02)="IHS DIABETES"
I $O(^ACM(41.1,"B","IHS DIABETES",""))="" D
. NEW N,NAME,UNAME,FLG,RNAME
. S N=0,FLG=0 F S N=$O(^ACM(41.1,N)) Q:'N D
.. S NAME=$P(^ACM(41.1,N,0),"^",1),UNAME=$$UP^XLFSTR(NAME)
.. I UNAME'["DIABET" Q
.. I UNAME="IHS PRE-DIABETES" Q
.. S FLG=1,RNAME=NAME
. I FLG S BQIUPD(90508,"1,",21.02)=RNAME
D FILE^DIE("E","BQIUPD","ERROR")
D DMA^BQINIGH2
Q
;
IZF ;EP - Turn on Immunization Forecaster
NEW ITM,RVDT,PTNAM,BQDFN
S ITM=$O(^BQI(90506.1,"B","IZ_")) I $P(ITM,"_",1)="IZ" Q
S TJOB="Weekly",SOURCE="Reminders"
D IFR^BQIRMDR2
S RVDT=""
F S RVDT=$O(^TMP("BIDUL",$J,1,RVDT)) Q:RVDT="" D
. S PTNAM="" F S PTNAM=$O(^TMP("BIDUL",$J,1,RVDT,PTNAM)) Q:PTNAM="" D
.. S BQDFN="" F S BQDFN=$O(^TMP("BIDUL",$J,1,RVDT,PTNAM,BQDFN)) Q:BQDFN="" D IZ^BQIRMDR2(BQDFN)
K TJOB,SOURCE
Q
;
MCT ;EP
;;27|LAB
;;28|PROB
;;29|MED
;;30|ALGY
;;31|INP
;;32|CPT
;;33|ERV
;;34|EDUC
;;35|REM
;;42|REG
BQI25POS ;GDIT/HS/ALA-Post Install for Version 2.5 ; 05 Jan 2015 12:39 PM
+1 ;;2.5;ICARE MANAGEMENT SYSTEM;;May 24, 2016;Build 27
+2 ;
+3 ;
EN ;EP
+1 ;Set the version number
+2 NEW DA
+3 SET DA=$ORDER(^BQI(90508,0))
+4 SET BQIUPD(90508,DA_",",.08)="2.5.0.5"
+5 SET BQIUPD(90508,DA_",",.09)="2.5.0.5"
+6 SET BQIUPD(90508,DA_",",16.04)="T-12M"
+7 SET BQIUPD(90508,DA_",",16.05)="T-365"
+8 DO FILE^DIE("","BQIUPD","ERROR")
+9 KILL BQIUPD
+10 ;
+11 ;Turn off Ordered field for CMET
+12 NEW BTWN
+13 SET BTWN=$ORDER(^BQI(90506.1,"B","BTPWFUOR",""))
IF BTWN'=""
Begin DoDot:1
+14 SET BQIUPD(90506.1,BTWN_",",.1)=1
+15 IF $PIECE(^BQI(90506.1,BTWN,0),U,11)=""
SET BQIUPD(90506.1,BTWN_",",.11)=DT
+16 DO FILE^DIE("","BQIUPD","ERROR")
End DoDot:1
+17 ;
+18 ; Set BTPWRPC and BUSARPC into BQIRPC
+19 NEW IEN,DA,X,DIC,Y
+20 SET DA(1)=$$FIND1^DIC(19,"","B","BQIRPC","","","ERROR")
SET DIC="^DIC(19,"_DA(1)_",10,"
SET DIC(0)="LMNZ"
+21 IF $GET(^DIC(19,DA(1),10,0))=""
SET ^DIC(19,DA(1),10,0)="^19.01IP^^"
+22 SET X="BTPWRPC"
+23 DO ^DIC
IF +Y<1
KILL DO,DD
DO FILE^DICN
+24 NEW IEN,DA,X,DIC,Y
+25 SET DA(1)=$$FIND1^DIC(19,"","B","BQIRPC","","","ERROR")
SET DIC="^DIC(19,"_DA(1)_",10,"
SET DIC(0)="LMNZ"
+26 IF $GET(^DIC(19,DA(1),10,0))=""
SET ^DIC(19,DA(1),10,0)="^19.01IP^^"
+27 SET X="BUSARPC"
+28 DO ^DIC
IF +Y<1
KILL DO,DD
DO FILE^DICN
+29 ;
+30 DO ^BQI25PU1
+31 DO ^BQI25PU
+32 ;
+33 NEW DA
+34 FOR DA=4,7,26
SET BQIUPD(90506.5,DA_",",.16)=1
+35 DO FILE^DIE("","BQIUPD","ERROR")
+36 ;
+37 ; Add Diabetes to Filter Source for Lab tests
+38 SET ^BQI(90506.3,2,7,0)="^90506.38P^2^2"
+39 SET ^BQI(90506.3,2,7,2,0)=7
+40 SET ^BQI(90506.3,2,7,"B",7,2)=""
+41 SET $PIECE(^BQI(90507,6,0),"^",17)="Diabetes"
+42 ;
+43 ;DM Audit
+44 SET ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT(),,,15)
+45 SET ZTDESC="Turn on DM Audit"
SET ZTRTN="DMA^BQI25POS"
SET ZTIO=""
+46 DO ^%ZTLOAD
+47 KILL ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSK
+48 ;
+49 ;Turn on Immunization Forecaster as Reminders
+50 SET ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT(),,,25)
+51 SET ZTDESC="IZ Forecaster"
SET ZTRTN="IZF^BQI25POS"
SET ZTIO=""
+52 DO ^%ZTLOAD
+53 KILL ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSK
+54 ;
MC ;Add Matched Criteria type
+1 NEW BI,TEXT,IEN
+2 FOR BI=1:1
SET TEXT=$PIECE($TEXT(MCT+BI),";;",2)
IF TEXT=""
QUIT
Begin DoDot:1
+3 SET IEN=$PIECE(TEXT,"|",1)
SET VAL=$PIECE(TEXT,"|",2)
+4 IF $GET(^BQI(90506.5,IEN,0))'=""
SET $PIECE(^BQI(90506.5,IEN,0),"^",17)=VAL
End DoDot:1
+5 ;
+6 ;Check for bad records in CMET
+7 NEW IEN,PREVT
+8 SET IEN=0
+9 FOR
SET IEN=$ORDER(^BTPWP(IEN))
IF 'IEN
QUIT
IF $GET(^BTPWP(IEN,0))=""
KILL ^BTPWP(IEN)
+10 ;
+11 SET IEN=0
+12 FOR
SET IEN=$ORDER(^BTPWP(IEN))
IF 'IEN
QUIT
SET PREVT=$PIECE(^BTPWP(IEN,0),"^",14)
IF PREVT'=""
IF $PIECE(^BTPWP(IEN,0),"^",5)=""
Begin DoDot:1
+13 SET $PIECE(^BTPWP(IEN,0),"^",5)=$PIECE($GET(^BTPWQ(PREVT,0)),"^",5)
End DoDot:1
+14 QUIT
+15 ;
DMA ;EP - Turn on DM Audit
+1 NEW CIEN
+2 SET CIEN=$ORDER(^BQI(90506.5,"B","DM Audit",""))
IF CIEN=""
QUIT
+3 IF $PIECE(^BQI(90506.5,CIEN,0),"^",10)=""
QUIT
+4 SET BQIUPD(90506.5,CIEN_",",.1)="@"
+5 IF $ORDER(^ACM(41.1,"B","IHS DIABETES",""))'=""
Begin DoDot:1
+6 SET BQIUPD(90508,"1,",21.02)="IHS DIABETES"
End DoDot:1
+7 IF $ORDER(^ACM(41.1,"B","IHS DIABETES",""))=""
Begin DoDot:1
+8 NEW N,NAME,UNAME,FLG,RNAME
+9 SET N=0
SET FLG=0
FOR
SET N=$ORDER(^ACM(41.1,N))
IF 'N
QUIT
Begin DoDot:2
+10 SET NAME=$PIECE(^ACM(41.1,N,0),"^",1)
SET UNAME=$$UP^XLFSTR(NAME)
+11 IF UNAME'["DIABET"
QUIT
+12 IF UNAME="IHS PRE-DIABETES"
QUIT
+13 SET FLG=1
SET RNAME=NAME
End DoDot:2
+14 IF FLG
SET BQIUPD(90508,"1,",21.02)=RNAME
End DoDot:1
+15 DO FILE^DIE("E","BQIUPD","ERROR")
+16 DO DMA^BQINIGH2
+17 QUIT
+18 ;
IZF ;EP - Turn on Immunization Forecaster
+1 NEW ITM,RVDT,PTNAM,BQDFN
+2 SET ITM=$ORDER(^BQI(90506.1,"B","IZ_"))
IF $PIECE(ITM,"_",1)="IZ"
QUIT
+3 SET TJOB="Weekly"
SET SOURCE="Reminders"
+4 DO IFR^BQIRMDR2
+5 SET RVDT=""
+6 FOR
SET RVDT=$ORDER(^TMP("BIDUL",$JOB,1,RVDT))
IF RVDT=""
QUIT
Begin DoDot:1
+7 SET PTNAM=""
FOR
SET PTNAM=$ORDER(^TMP("BIDUL",$JOB,1,RVDT,PTNAM))
IF PTNAM=""
QUIT
Begin DoDot:2
+8 SET BQDFN=""
FOR
SET BQDFN=$ORDER(^TMP("BIDUL",$JOB,1,RVDT,PTNAM,BQDFN))
IF BQDFN=""
QUIT
DO IZ^BQIRMDR2(BQDFN)
End DoDot:2
End DoDot:1
+9 KILL TJOB,SOURCE
+10 QUIT
+11 ;
MCT ;EP
+1 ;;27|LAB
+2 ;;28|PROB
+3 ;;29|MED
+4 ;;30|ALGY
+5 ;;31|INP
+6 ;;32|CPT
+7 ;;33|ERV
+8 ;;34|EDUC
+9 ;;35|REM
+10 ;;42|REG