Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BQITIUTX

BQITIUTX.m

Go to the documentation of this file.
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