BTPWRWHP ;VNGT/HS/ALA - Women's Health Procedure Display ; 10 Jul 2008 5:51 PM
;;1.0;CARE MANAGEMENT EVENT TRACKING;;Feb 07, 2011
;
;
EN(DATA,WHIEN) ; EP -- BTPW WH DISPLAY
;Description
; Generates a Display of a Women's Health Procedure Record
;
;Input
; WHIEN - Procedure IEN
;
;Output
; DATA - Name of global in which data is stored(^TMP("BQIRSPMT"))
;
NEW UID,BQII
NEW HSTEXT,HSPATH,HSFN,Y,IOSL,IOST,IOM,I,N
NEW APCHSPAT,APCHSHDR,APCHSTIM
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BTPWRWHP",UID))
K @DATA
;
S BQII=0
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BTPWRWHP D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
D HDR
;
I $$TMPFL^BQIUL1("W",UID,WHIEN) G DONE
;
S IOSL=999,IOM=80,IOST="P-OTHER80"
;
U IO
S DIC="^BWPCD(",DA=WHIEN
D EN^DIQ
U IO W $C(9)
;
I $$TMPFL^BQIUL1("C") G DONE
;
I $$TMPFL^BQIUL1("R",UID,WHIEN) G DONE
;
F U IO R HSTEXT:.1 Q:HSTEXT[$C(9) D
. S HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
. I HSTEXT="" S HSTEXT=" "
. S BQII=BQII+1,@DATA@(BQII)=HSTEXT_$C(13)_$C(10)
S BQII=BQII+1,@DATA@(BQII)=$C(30)
;
I $$TMPFL^BQIUL1("C") G DONE
;
I $$TMPFL^BQIUL1("D",UID,WHIEN) G DONE
;
DONE ;
;
S BQII=BQII+1,@DATA@(BQII)=$C(31)
Q
;
HDR ;
S @DATA@(BQII)="T01024REPORT_TEXT"_$C(30)
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
S BQII=BQII+1,@DATA@(BQII)=$C(31)
I $$TMPFL^BQIUL1("C")
Q
BTPWRWHP ;VNGT/HS/ALA - Women's Health Procedure Display ; 10 Jul 2008 5:51 PM
+1 ;;1.0;CARE MANAGEMENT EVENT TRACKING;;Feb 07, 2011
+2 ;
+3 ;
EN(DATA,WHIEN) ; EP -- BTPW WH DISPLAY
+1 ;Description
+2 ; Generates a Display of a Women's Health Procedure Record
+3 ;
+4 ;Input
+5 ; WHIEN - Procedure IEN
+6 ;
+7 ;Output
+8 ; DATA - Name of global in which data is stored(^TMP("BQIRSPMT"))
+9 ;
+10 NEW UID,BQII
+11 NEW HSTEXT,HSPATH,HSFN,Y,IOSL,IOST,IOM,I,N
+12 NEW APCHSPAT,APCHSHDR,APCHSTIM
+13 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+14 SET DATA=$NAME(^TMP("BTPWRWHP",UID))
+15 KILL @DATA
+16 ;
+17 SET BQII=0
+18 ;
+19 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BTPWRWHP D UNWIND^%ZTER"
+20 ;
+21 DO HDR
+22 ;
+23 IF $$TMPFL^BQIUL1("W",UID,WHIEN)
GOTO DONE
+24 ;
+25 SET IOSL=999
SET IOM=80
SET IOST="P-OTHER80"
+26 ;
+27 USE IO
+28 SET DIC="^BWPCD("
SET DA=WHIEN
+29 DO EN^DIQ
+30 USE IO
WRITE $CHAR(9)
+31 ;
+32 IF $$TMPFL^BQIUL1("C")
GOTO DONE
+33 ;
+34 IF $$TMPFL^BQIUL1("R",UID,WHIEN)
GOTO DONE
+35 ;
+36 FOR
USE IO
READ HSTEXT:.1
IF HSTEXT[$CHAR(9)
QUIT
Begin DoDot:1
+37 SET HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
+38 IF HSTEXT=""
SET HSTEXT=" "
+39 SET BQII=BQII+1
SET @DATA@(BQII)=HSTEXT_$CHAR(13)_$CHAR(10)
End DoDot:1
+40 SET BQII=BQII+1
SET @DATA@(BQII)=$CHAR(30)
+41 ;
+42 IF $$TMPFL^BQIUL1("C")
GOTO DONE
+43 ;
+44 IF $$TMPFL^BQIUL1("D",UID,WHIEN)
GOTO DONE
+45 ;
DONE ;
+1 ;
+2 SET BQII=BQII+1
SET @DATA@(BQII)=$CHAR(31)
+3 QUIT
+4 ;
HDR ;
+1 SET @DATA@(BQII)="T01024REPORT_TEXT"_$CHAR(30)
+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 SET BQII=BQII+1
SET @DATA@(BQII)=$CHAR(31)
+6 IF $$TMPFL^BQIUL1("C")
+7 QUIT