BQI24PU1 ;GDIT/HS/ALA-2.4 Patch 3 Install ; 03 Nov 2015 4:37 PM
;;2.4;ICARE MANAGEMENT SYSTEM;**3**;Apr 01, 2015;Build 5
;
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
;;NO = Not a current tobacco user. YES = Current tobacco user.~
Q
;
ARR ; Array
;;0|BDMTOB^^Tobacco User^^^^^T00030BDMTOB~1|S VAL=$$DSP^BQIRGASU(DFN,STVW)~3|7^^^D^6~5|S VAL=$$TOB^BQIRGDMS(DFN),OTHER="",VISIT="",DATE="",VAL=$P(VAL,U,2)
Q
BQI24PU1 ;GDIT/HS/ALA-2.4 Patch 3 Install ; 03 Nov 2015 4:37 PM
+1 ;;2.4;ICARE MANAGEMENT SYSTEM;**3**;Apr 01, 2015;Build 5
+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 ;;NO = Not a current tobacco user. YES = Current tobacco user.~
+2 QUIT
+3 ;
ARR ; Array
+1 ;;0|BDMTOB^^Tobacco User^^^^^T00030BDMTOB~1|S VAL=$$DSP^BQIRGASU(DFN,STVW)~3|7^^^D^6~5|S VAL=$$TOB^BQIRGDMS(DFN),OTHER="",VISIT="",DATE="",VAL=$P(VAL,U,2)
+2 QUIT