BQIGPMSR ;GDHD/HS/ALA-GPRA Patient Demographic Measures ; 20 Apr 2016 2:55 PM
;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
;
EN ; EP
D INP^BQINIGHT
S BQIROU=$E(BQIROU,1,$L(BQIROU)-1)
F I=1:1:6 S TEXT=$P($T(MSR+I),";;",2) Q:TEXT="" D
. F BJ=1:1:$L(TEXT,"~") D
.. S NDATA=$P(TEXT,"~",BJ)
.. S ND=$P(NDATA,"|",1),VAL=$P(NDATA,"|",2)
.. I ND=0 D
... NEW DIC,X,Y
... S DIC(0)="LQZ",DIC="^BQI(90506.1,",X=$P(VAL,U,1)
... D ^DIC
... S IEN=+Y
... I IEN=-1 K DO,DD D FILE^DICN S IEN=+Y
.. I ND=0 S ^BQI(90506.1,IEN,0)=VAL
.. I ND=1 S BQIUPD(90506.1,IEN_",",1)="S VAL="_$P(VAL,"^",1)_"^"_BQIROU_$P(VAL,"^",2,99) Q
.. I ND=3 S ^BQI(90506.1,IEN,3)=VAL Q
.. I ND=4 S ^BQI(90506.1,IEN,4,0)="^^1^1^"_DT,^BQI(90506.1,IEN,4,1,0)=VAL
;
D FILE^DIE("","BQIUPD","ERROR")
Q
;
MSR ;EP - Measures
;;0|GPACTCL^^CRS Active Clinical^D^^^^T00003GPACTCL~1|$$ACTCL^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^58~4|Patient considered Active Clinical by CRS.
;;0|GPDMEV^^CRS DM DX Ever^D^^^^T00003GPDMEV~1|$$DM^(DFN,,END)~3|1^^CRS Flag^O^59~4|Did patient have a DM Diagnosis ever recorded in RPMS.
;;0|GPDMVYR^^CRS DM DX Report Period^D^^^^T00003GPDMVYR~1|$$DM^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^60~4|Patient had a DM Diagnosis in the Report Period.
;;0|GPDMFD^^CRS First DM Dx^D^^^^T00003GPDMFD~1|$$FIRSTDM^(DFN,$$DATE^BQIUL1("T-12M"))~3|1^^CRS Flag^O^61~4|Patient's First DM Diagnosis was before Report Period.
;;0|GPDMYV^^CRS One DM Visit^D^^^^T00003GPDMYV~1|$$V1DM^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^62~4|Patient had 1 DM Visit in Report Period.
;;0|GPDM2V^^CRS Two DM Visits^D^^^^T00003GPDM2V~1|$$V2DM^(DFN,$$DOB^AUPNPAT(DFN),DT)~3|1^^CRS Flag^O^63~4|Patient had 2 DM Visits Ever.
;;0|GP2V^^CRS Two Visits^D^^^T0003GP2V~1|$$V2^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^64~4|Patient had 2 Visits in Report Period.
BQIGPMSR ;GDHD/HS/ALA-GPRA Patient Demographic Measures ; 20 Apr 2016 2:55 PM
+1 ;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
+2 ;
EN ; EP
+1 DO INP^BQINIGHT
+2 SET BQIROU=$EXTRACT(BQIROU,1,$LENGTH(BQIROU)-1)
+3 FOR I=1:1:6
SET TEXT=$PIECE($TEXT(MSR+I),";;",2)
IF TEXT=""
QUIT
Begin DoDot:1
+4 FOR BJ=1:1:$LENGTH(TEXT,"~")
Begin DoDot:2
+5 SET NDATA=$PIECE(TEXT,"~",BJ)
+6 SET ND=$PIECE(NDATA,"|",1)
SET VAL=$PIECE(NDATA,"|",2)
+7 IF ND=0
Begin DoDot:3
+8 NEW DIC,X,Y
+9 SET DIC(0)="LQZ"
SET DIC="^BQI(90506.1,"
SET X=$PIECE(VAL,U,1)
+10 DO ^DIC
+11 SET IEN=+Y
+12 IF IEN=-1
KILL DO,DD
DO FILE^DICN
SET IEN=+Y
End DoDot:3
+13 IF ND=0
SET ^BQI(90506.1,IEN,0)=VAL
+14 IF ND=1
SET BQIUPD(90506.1,IEN_",",1)="S VAL="_$PIECE(VAL,"^",1)_"^"_BQIROU_$PIECE(VAL,"^",2,99)
QUIT
+15 IF ND=3
SET ^BQI(90506.1,IEN,3)=VAL
QUIT
+16 IF ND=4
SET ^BQI(90506.1,IEN,4,0)="^^1^1^"_DT
SET ^BQI(90506.1,IEN,4,1,0)=VAL
End DoDot:2
End DoDot:1
+17 ;
+18 DO FILE^DIE("","BQIUPD","ERROR")
+19 QUIT
+20 ;
MSR ;EP - Measures
+1 ;;0|GPACTCL^^CRS Active Clinical^D^^^^T00003GPACTCL~1|$$ACTCL^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^58~4|Patient considered Active Clinical by CRS.
+2 ;;0|GPDMEV^^CRS DM DX Ever^D^^^^T00003GPDMEV~1|$$DM^(DFN,,END)~3|1^^CRS Flag^O^59~4|Did patient have a DM Diagnosis ever recorded in RPMS.
+3 ;;0|GPDMVYR^^CRS DM DX Report Period^D^^^^T00003GPDMVYR~1|$$DM^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^60~4|Patient had a DM Diagnosis in the Report Period.
+4 ;;0|GPDMFD^^CRS First DM Dx^D^^^^T00003GPDMFD~1|$$FIRSTDM^(DFN,$$DATE^BQIUL1("T-12M"))~3|1^^CRS Flag^O^61~4|Patient's First DM Diagnosis was before Report Period.
+5 ;;0|GPDMYV^^CRS One DM Visit^D^^^^T00003GPDMYV~1|$$V1DM^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^62~4|Patient had 1 DM Visit in Report Period.
+6 ;;0|GPDM2V^^CRS Two DM Visits^D^^^^T00003GPDM2V~1|$$V2DM^(DFN,$$DOB^AUPNPAT(DFN),DT)~3|1^^CRS Flag^O^63~4|Patient had 2 DM Visits Ever.
+7 ;;0|GP2V^^CRS Two Visits^D^^^T0003GP2V~1|$$V2^(DFN,$$DATE^BQIUL1("T-12M"),DT)~3|1^^CRS Flag^O^64~4|Patient had 2 Visits in Report Period.