BQIAAP ;VNGT/HS/BEE - Print Asthma Action Plan ; 19 Jul 2006 10:35 AM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
EN(DATA,DFN) ; EP - BQI ASTHMA ACTION PLAN
;Description
; Generates an Asthma Action Plan for a given DFN
;
;Input
; DFN - Patient Internal ID
;
;Output
; DATA - Name of global in which data is stored(^TMP("BQIAAP"))
;
NEW UID,BQII,HSTEXT,X
NEW APCHB,APCHC,APCHCONT,APCHF,APCHG,APCHL,APCHQ,APCHREL,F ;Used by called routine
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIAAP",UID))
K @DATA
;
S BQII=0
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIAAP D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
D HDR
;
I $$VERSION^XPDUTL("BJPC")<2.0 D G DONE
. S BMXSEC="RPC Call Failed: Patient Asthma Action Plan does not exist in RPMS" Q
;
I $$TMPFL^BQIUL1("W",UID,DFN) G DONE
;
NEW APCHRELM,APCHRESM,IOSL,IOM,IOST
S (APCHRELM,APCHRESM)=""
S IOSL=999,IOM=80,IOST="P-OTHER80"
U IO D PRINT^APCHAAP1
U IO W $C(9)
;
I $$TMPFL^BQIUL1("C") G DONE
I $$TMPFL^BQIUL1("R",UID,DFN) 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,DFN) 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
I $D(BQII),$D(DATA) S BQII=BQII+1,@DATA@(BQII)=$C(31)
I $$TMPFL^BQIUL1("C")
Q
BQIAAP ;VNGT/HS/BEE - Print Asthma Action Plan ; 19 Jul 2006 10:35 AM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
EN(DATA,DFN) ; EP - BQI ASTHMA ACTION PLAN
+1 ;Description
+2 ; Generates an Asthma Action Plan for a given DFN
+3 ;
+4 ;Input
+5 ; DFN - Patient Internal ID
+6 ;
+7 ;Output
+8 ; DATA - Name of global in which data is stored(^TMP("BQIAAP"))
+9 ;
+10 NEW UID,BQII,HSTEXT,X
+11 ;Used by called routine
NEW APCHB,APCHC,APCHCONT,APCHF,APCHG,APCHL,APCHQ,APCHREL,F
+12 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+13 SET DATA=$NAME(^TMP("BQIAAP",UID))
+14 KILL @DATA
+15 ;
+16 SET BQII=0
+17 ;
+18 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIAAP D UNWIND^%ZTER"
+19 ;
+20 DO HDR
+21 ;
+22 IF $$VERSION^XPDUTL("BJPC")<2.0
Begin DoDot:1
+23 SET BMXSEC="RPC Call Failed: Patient Asthma Action Plan does not exist in RPMS"
QUIT
End DoDot:1
GOTO DONE
+24 ;
+25 IF $$TMPFL^BQIUL1("W",UID,DFN)
GOTO DONE
+26 ;
+27 NEW APCHRELM,APCHRESM,IOSL,IOM,IOST
+28 SET (APCHRELM,APCHRESM)=""
+29 SET IOSL=999
SET IOM=80
SET IOST="P-OTHER80"
+30 USE IO
DO PRINT^APCHAAP1
+31 USE IO
WRITE $CHAR(9)
+32 ;
+33 IF $$TMPFL^BQIUL1("C")
GOTO DONE
+34 IF $$TMPFL^BQIUL1("R",UID,DFN)
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 IF $$TMPFL^BQIUL1("D",UID,DFN)
GOTO DONE
+44 ;
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 IF $DATA(BQII)
IF $DATA(DATA)
SET BQII=BQII+1
SET @DATA@(BQII)=$CHAR(31)
+6 IF $$TMPFL^BQIUL1("C")
+7 QUIT