BQITIUTX ;VNGT/HS/ALA-Get TIU Document Text ; 27 Jan 2009 2:37 PM
;;2.4;ICARE MANAGEMENT SYSTEM;;Apr 01, 2015;Build 41
;
GET(TDATA,TIUDA) ; EP - BQI GET TIU DOC TEXT
;Input
; TIUDA - Internal entry number of the document
;
NEW UID,II,BI,TEMP,VALMCNT,TIUDPRM,D0,HDR,TIUREC,DATA
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S TDATA=$NA(^TMP("BQITIUTX",UID))
S TIUDA=$G(TIUDA,"")
K @TDATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQITIUTX D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S HDR="T01024REPORT_TEXT"
S @TDATA@(0)=HDR_$C(30)
I $P($G(^TIU(8925,TIUDA,16)),"^",13)="S" D G DONE
. S II=II+1,@TDATA@(II)="You cannot open a scanned document from iCare. You must open it from EHR."_$C(30)
;
; Call the TIU RPC - TIU GET RECORD TEXT
D TGET^TIUSRVR1(.DATA,TIUDA)
;
NEW HSTEXT
S N=0
F S N=$O(@DATA@(N)) Q:N="" D
. S HSTEXT=@DATA@(N)
. S HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
. S II=II+1,@TDATA@(II)=HSTEXT_$C(13)_$C(10)
K @DATA
S DR="1202;1301"
D GET4EDIT^TIUSRVR(.TIUREC,TIUDA,DR)
NEW HSTEXT
S N=0
F S N=$O(@TIUREC@("TEXT",N)) Q:N="" D
. S HSTEXT=@TIUREC@("TEXT",N)
. S HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
. S II=II+1,@TDATA@(II)=HSTEXT_$C(13)_$C(10)
S @TDATA@(II)=@TDATA@(II)_$C(30)
;
DONE ;
S II=II+1,@TDATA@(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
BQITIUTX ;VNGT/HS/ALA-Get TIU Document Text ; 27 Jan 2009 2:37 PM
+1 ;;2.4;ICARE MANAGEMENT SYSTEM;;Apr 01, 2015;Build 41
+2 ;
GET(TDATA,TIUDA) ; EP - BQI GET TIU DOC TEXT
+1 ;Input
+2 ; TIUDA - Internal entry number of the document
+3 ;
+4 NEW UID,II,BI,TEMP,VALMCNT,TIUDPRM,D0,HDR,TIUREC,DATA
+5 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+6 SET TDATA=$NAME(^TMP("BQITIUTX",UID))
+7 SET TIUDA=$GET(TIUDA,"")
+8 KILL @TDATA
+9 ;
+10 SET II=0
+11 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQITIUTX D UNWIND^%ZTER"
+12 ;
+13 SET HDR="T01024REPORT_TEXT"
+14 SET @TDATA@(0)=HDR_$CHAR(30)
+15 IF $PIECE($GET(^TIU(8925,TIUDA,16)),"^",13)="S"
Begin DoDot:1
+16 SET II=II+1
SET @TDATA@(II)="You cannot open a scanned document from iCare. You must open it from EHR."_$CHAR(30)
End DoDot:1
GOTO DONE
+17 ;
+18 ; Call the TIU RPC - TIU GET RECORD TEXT
+19 DO TGET^TIUSRVR1(.DATA,TIUDA)
+20 ;
+21 NEW HSTEXT
+22 SET N=0
+23 FOR
SET N=$ORDER(@DATA@(N))
IF N=""
QUIT
Begin DoDot:1
+24 SET HSTEXT=@DATA@(N)
+25 SET HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
+26 SET II=II+1
SET @TDATA@(II)=HSTEXT_$CHAR(13)_$CHAR(10)
End DoDot:1
+27 KILL @DATA
+28 SET DR="1202;1301"
+29 DO GET4EDIT^TIUSRVR(.TIUREC,TIUDA,DR)
+30 NEW HSTEXT
+31 SET N=0
+32 FOR
SET N=$ORDER(@TIUREC@("TEXT",N))
IF N=""
QUIT
Begin DoDot:1
+33 SET HSTEXT=@TIUREC@("TEXT",N)
+34 SET HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
+35 SET II=II+1
SET @TDATA@(II)=HSTEXT_$CHAR(13)_$CHAR(10)
End DoDot:1
+36 SET @TDATA@(II)=@TDATA@(II)_$CHAR(30)
+37 ;
DONE ;
+1 SET II=II+1
SET @TDATA@(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