BQIPTHLP ;GDHS/HCD/ALA-Patient Help Text ; 16 Nov 2016 1:40 PM
;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
;;
;
EN(DATA,CODE) ;EP -- BQI GET PATIENT HELP TEXT
; Input
; CODE - A field CODE if wanting the help text for a specific patient field
; otherwise if it is null, then retrieves the help text for all patient fields
;
NEW UID,II,RIEN
;
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPTHLP",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPTHLP D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S CODE=$G(CODE,"")
;
S @DATA@(II)="T00015CODE^T00050DISPLAY_NAME^T01024REPORT_TEXT"_$C(30)
;
I CODE="" D
. S RIEN=""
. F S RIEN=$O(^BQI(90506.1,"AC","D",RIEN)) Q:RIEN="" D
.. S CODE=$P(^BQI(90506.1,RIEN,0),"^",1) D GETDATA(RIEN)
;
I CODE'="" D
. S RIEN=$O(^BQI(90506.1,"B",CODE,"")) I RIEN="" Q
. D GETDATA(RIEN)
;
DONE ;
S II=II+1,@DATA@(II)=$C(31)
Q
;
ERR ;
D ^%ZTER
NEW Y,ERRDTM
S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
S BMXSEC="Recording that an error occurred at "_ERRDTM
I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
Q
;
GETDATA(RIEN) ;EP - Get the help text
NEW VHELP,NAME,VN
I $$GET1^DIQ(90506.1,RIEN_",",.1,"I")=1 Q
S NAME=$P(^BQI(90506.1,RIEN,0),U,3)
S VHELP="",VN=0
F S VN=$O(^BQI(90506.1,RIEN,4,VN)) Q:'VN D
. S VHELP=VHELP_^BQI(90506.1,RIEN,4,VN,0)_$C(10)
S VHELP=$$TKO^BQIUL1(VHELP,$C(10))
I $G(AVHELP)'="" S VHELP=AVHELP
;
S II=II+1,@DATA@(II)=CODE_U_NAME_U_VHELP_$C(30)
Q
BQIPTHLP ;GDHS/HCD/ALA-Patient Help Text ; 16 Nov 2016 1:40 PM
+1 ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
+2 ;;
+3 ;
EN(DATA,CODE) ;EP -- BQI GET PATIENT HELP TEXT
+1 ; Input
+2 ; CODE - A field CODE if wanting the help text for a specific patient field
+3 ; otherwise if it is null, then retrieves the help text for all patient fields
+4 ;
+5 NEW UID,II,RIEN
+6 ;
+7 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+8 SET DATA=$NAME(^TMP("BQIPTHLP",UID))
+9 KILL @DATA
+10 ;
+11 SET II=0
+12 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPTHLP D UNWIND^%ZTER"
+13 ;
+14 SET CODE=$GET(CODE,"")
+15 ;
+16 SET @DATA@(II)="T00015CODE^T00050DISPLAY_NAME^T01024REPORT_TEXT"_$CHAR(30)
+17 ;
+18 IF CODE=""
Begin DoDot:1
+19 SET RIEN=""
+20 FOR
SET RIEN=$ORDER(^BQI(90506.1,"AC","D",RIEN))
IF RIEN=""
QUIT
Begin DoDot:2
+21 SET CODE=$PIECE(^BQI(90506.1,RIEN,0),"^",1)
DO GETDATA(RIEN)
End DoDot:2
End DoDot:1
+22 ;
+23 IF CODE'=""
Begin DoDot:1
+24 SET RIEN=$ORDER(^BQI(90506.1,"B",CODE,""))
IF RIEN=""
QUIT
+25 DO GETDATA(RIEN)
End DoDot:1
+26 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
ERR ;
+1 DO ^%ZTER
+2 NEW Y,ERRDTM
+3 SET Y=$$NOW^XLFDT()
XECUTE ^DD("DD")
SET ERRDTM=Y
+4 SET BMXSEC="Recording that an error occurred at "_ERRDTM
+5 IF $DATA(II)
IF $DATA(DATA)
SET II=II+1
SET @DATA@(II)=$CHAR(31)
+6 QUIT
+7 ;
GETDATA(RIEN) ;EP - Get the help text
+1 NEW VHELP,NAME,VN
+2 IF $$GET1^DIQ(90506.1,RIEN_",",.1,"I")=1
QUIT
+3 SET NAME=$PIECE(^BQI(90506.1,RIEN,0),U,3)
+4 SET VHELP=""
SET VN=0
+5 FOR
SET VN=$ORDER(^BQI(90506.1,RIEN,4,VN))
IF 'VN
QUIT
Begin DoDot:1
+6 SET VHELP=VHELP_^BQI(90506.1,RIEN,4,VN,0)_$CHAR(10)
End DoDot:1
+7 SET VHELP=$$TKO^BQIUL1(VHELP,$CHAR(10))
+8 IF $GET(AVHELP)'=""
SET VHELP=AVHELP
+9 ;
+10 SET II=II+1
SET @DATA@(II)=CODE_U_NAME_U_VHELP_$CHAR(30)
+11 QUIT