BQIPTVST ;PRXM/HC/ALA-Visit Record ; 14 Jun 2006 5:41 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
GET(DATA,VISIT) ; EP -- BQI GET VISIT RECORD
;
;Description
; Returns a visit record for a patient's visit
;Input
; DFN - Patient internal entry number
;
NEW UID,II,JJ,LJ,FJ,KK,BQITEMP,X
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S BQITEMP=$NA(^TMP("BQIVISIT",UID))
S DATA=$NA(^TMP("BQIPTVST",UID))
K @BQITEMP,@DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPTVST D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
I $G(VISIT)="" S BMXSEC="No visit record sent" Q
;
D EN^APCDVDSG(VISIT,BQITEMP,1)
S @DATA@(II)="T00120REPORT_TEXT"_$C(30)
;
S JJ=0
F S JJ=$O(@BQITEMP@(JJ)) Q:'JJ S II=II+1,@DATA@(II)=@BQITEMP@(JJ,0)_$C(13)_$C(10)
S II=II+1,@DATA@(II)=$C(30)
S II=II+1,@DATA@(II)=$C(31)
;
K @BQITEMP
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
BQIPTVST ;PRXM/HC/ALA-Visit Record ; 14 Jun 2006 5:41 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
GET(DATA,VISIT) ; EP -- BQI GET VISIT RECORD
+1 ;
+2 ;Description
+3 ; Returns a visit record for a patient's visit
+4 ;Input
+5 ; DFN - Patient internal entry number
+6 ;
+7 NEW UID,II,JJ,LJ,FJ,KK,BQITEMP,X
+8 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+9 SET BQITEMP=$NAME(^TMP("BQIVISIT",UID))
+10 SET DATA=$NAME(^TMP("BQIPTVST",UID))
+11 KILL @BQITEMP,@DATA
+12 ;
+13 SET II=0
+14 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPTVST D UNWIND^%ZTER"
+15 ;
+16 IF $GET(VISIT)=""
SET BMXSEC="No visit record sent"
QUIT
+17 ;
+18 DO EN^APCDVDSG(VISIT,BQITEMP,1)
+19 SET @DATA@(II)="T00120REPORT_TEXT"_$CHAR(30)
+20 ;
+21 SET JJ=0
+22 FOR
SET JJ=$ORDER(@BQITEMP@(JJ))
IF 'JJ
QUIT
SET II=II+1
SET @DATA@(II)=@BQITEMP@(JJ,0)_$CHAR(13)_$CHAR(10)
+23 SET II=II+1
SET @DATA@(II)=$CHAR(30)
+24 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+25 ;
+26 KILL @BQITEMP
+27 QUIT
+28 ;
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