BQIULAY ;GDHD/HS/ALA-Update Layout ; 15 Jun 2016 2:23 PM
;;2.7;ICARE MANAGEMENT SYSTEM;**1**;Dec 19, 2017;Build 12
;
LAY ; Add new patient entries to 90506.1
NEW BI,BJ,BK,BN,BQIUPD,ERROR,IEN,ND,NDATA,TEXT,VAL,TTEXT,BJJ
F BI=1:1 S TEXT=$P($T(ARR+BI),";;",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=1 S BQIUPD(90506.1,IEN_",",1)=VAL Q
.. I ND=5 S BQIUPD(90506.1,IEN_",",5)=VAL Q
.. F BK=1:1:$L(VAL,"^") D
... S BN=$O(^DD(90506.1,"GL",ND,BK,"")) I BN="" Q
... I $P(VAL,"^",BK)'="" S BQIUPD(90506.1,IEN_",",BN)=$P(VAL,"^",BK) Q
... I $P(VAL,"^",BK)="" S BQIUPD(90506.1,IEN_",",BN)="@"
... ;
... S TTEXT=$T(TIP+BI) Q:TTEXT=" Q" D
.... S TTEXT=$P(TTEXT,";;",2) I TTEXT="" Q
.... F BJJ=1:1:$L(TTEXT,"~") D
..... S NDATA=$P(TTEXT,"~",BJJ) I NDATA="" Q
..... S ^BQI(90506.1,IEN,4,BJJ,0)=NDATA
..... S ^BQI(90506.1,IEN,4,0)="^^"_BJJ_"^"_BJJ
. D FILE^DIE("","BQIUPD","ERROR")
;
; Re-Index File
K ^BQI(90506.1,"AC"),^BQI(90506.1,"AD")
NEW DIK
S DIK="^BQI(90506.1,",DIK(1)=3.01
D ENALL^DIK
;
Q
;
TIP ; Tooltips
;;The visit that meets the IPC Influenza Immunization Status encounter ~criteria.~
;;The last office visit per IPC requirements which is usually a visit CPT ~code.~
;;IPC Office Visit for Depression remission. Must have a PHQ9 score ~greater than 9.~
;;If patient was not 13 years old during the report period, patient is N/A. ~Otherwise patient should have had immunization during the date range ~listed.~
Q
;
ARR ; Array
;;0|IPCFOV^^IPC Flu Office Visit^^^^^T00015IPCFOV~1|S VAL=$$FLV^BQIIPUT1(DFN)~3|1^^Visit Related^O^79~5|
;;0|IPCLOV^^IPC Last Office Visit^^^^^T00015IPCLOV~1|S VAL=$$OFV^BQIIPUT1(DFN)~3|1^^Visit Related^O^78~5|
;;0|IPCPSV^^IPC Depress Office Visit^^^^^T00015IPCPSV~1|S VAL=$$PSV^BQIIPUT1(DFN)~3|1^^Visit Related^O^80~5|
;;0|IPCADZ^^IPC Adolescent Qualify Dates^^^^^T00025IPCADZ~1|S VAL=$$ADZ^BQIIPUT1(DFN)~3|1^^Visit Related^O^81~5|
Q
BQIULAY ;GDHD/HS/ALA-Update Layout ; 15 Jun 2016 2:23 PM
+1 ;;2.7;ICARE MANAGEMENT SYSTEM;**1**;Dec 19, 2017;Build 12
+2 ;
LAY ; Add new patient entries to 90506.1
+1 NEW BI,BJ,BK,BN,BQIUPD,ERROR,IEN,ND,NDATA,TEXT,VAL,TTEXT,BJJ
+2 FOR BI=1:1
SET TEXT=$PIECE($TEXT(ARR+BI),";;",2)
IF TEXT=""
QUIT
Begin DoDot:1
+3 FOR BJ=1:1:$LENGTH(TEXT,"~")
Begin DoDot:2
+4 SET NDATA=$PIECE(TEXT,"~",BJ)
+5 SET ND=$PIECE(NDATA,"|",1)
SET VAL=$PIECE(NDATA,"|",2)
+6 IF ND=0
Begin DoDot:3
+7 NEW DIC,X,Y
+8 SET DIC(0)="LQZ"
SET DIC="^BQI(90506.1,"
SET X=$PIECE(VAL,U,1)
+9 DO ^DIC
+10 SET IEN=+Y
+11 IF IEN=-1
KILL DO,DD
DO FILE^DICN
SET IEN=+Y
End DoDot:3
+12 IF ND=1
SET BQIUPD(90506.1,IEN_",",1)=VAL
QUIT
+13 IF ND=5
SET BQIUPD(90506.1,IEN_",",5)=VAL
QUIT
+14 FOR BK=1:1:$LENGTH(VAL,"^")
Begin DoDot:3
+15 SET BN=$ORDER(^DD(90506.1,"GL",ND,BK,""))
IF BN=""
QUIT
+16 IF $PIECE(VAL,"^",BK)'=""
SET BQIUPD(90506.1,IEN_",",BN)=$PIECE(VAL,"^",BK)
QUIT
+17 IF $PIECE(VAL,"^",BK)=""
SET BQIUPD(90506.1,IEN_",",BN)="@"
+18 ;
+19 SET TTEXT=$TEXT(TIP+BI)
IF TTEXT=" Q"
QUIT
Begin DoDot:4
+20 SET TTEXT=$PIECE(TTEXT,";;",2)
IF TTEXT=""
QUIT
+21 FOR BJJ=1:1:$LENGTH(TTEXT,"~")
Begin DoDot:5
+22 SET NDATA=$PIECE(TTEXT,"~",BJJ)
IF NDATA=""
QUIT
+23 SET ^BQI(90506.1,IEN,4,BJJ,0)=NDATA
+24 SET ^BQI(90506.1,IEN,4,0)="^^"_BJJ_"^"_BJJ
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
+25 DO FILE^DIE("","BQIUPD","ERROR")
End DoDot:1
+26 ;
+27 ; Re-Index File
+28 KILL ^BQI(90506.1,"AC"),^BQI(90506.1,"AD")
+29 NEW DIK
+30 SET DIK="^BQI(90506.1,"
SET DIK(1)=3.01
+31 DO ENALL^DIK
+32 ;
+33 QUIT
+34 ;
TIP ; Tooltips
+1 ;;The visit that meets the IPC Influenza Immunization Status encounter ~criteria.~
+2 ;;The last office visit per IPC requirements which is usually a visit CPT ~code.~
+3 ;;IPC Office Visit for Depression remission. Must have a PHQ9 score ~greater than 9.~
+4 ;;If patient was not 13 years old during the report period, patient is N/A. ~Otherwise patient should have had immunization during the date range ~listed.~
+5 QUIT
+6 ;
ARR ; Array
+1 ;;0|IPCFOV^^IPC Flu Office Visit^^^^^T00015IPCFOV~1|S VAL=$$FLV^BQIIPUT1(DFN)~3|1^^Visit Related^O^79~5|
+2 ;;0|IPCLOV^^IPC Last Office Visit^^^^^T00015IPCLOV~1|S VAL=$$OFV^BQIIPUT1(DFN)~3|1^^Visit Related^O^78~5|
+3 ;;0|IPCPSV^^IPC Depress Office Visit^^^^^T00015IPCPSV~1|S VAL=$$PSV^BQIIPUT1(DFN)~3|1^^Visit Related^O^80~5|
+4 ;;0|IPCADZ^^IPC Adolescent Qualify Dates^^^^^T00025IPCADZ~1|S VAL=$$ADZ^BQIIPUT1(DFN)~3|1^^Visit Related^O^81~5|
+5 QUIT