IBDF2F1 ;ALB/CJM - ENCOUNTER FORM - PRINT FORM(sends to printer) ;NOV 16,1992
;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
;
REGISTER(PAGE) ;registration for scanning, form # and patient at bottom
N PAGECHK,TYPECHK,IDCHK,VA
I IBDEVICE("PCL") D
.I IBFORM("SCAN") D
..;calculate the checksums
..S PAGECHK=(3*PAGE)#29,TYPECHK=(3*IBFORM("TYPE"))#997,IDCHK=(3*(+$G(IBPFID)))#997
.;set top margin to top of page
.W $C(27),"&l0E"
.;
.I IBFORM("SCAN") D ANCHORS
.;
.I $G(IBFORM("SCAN",PAGE)) D
..; -- black box used to determine if page has data for scanning
..; but not for sample forms
..I '$G(IBDSAMP) W $C(27),"&a7576v3400H",$C(27),"*c140h140v0P",$C(27)
.;
.;define font for OCR'd text
.W $C(27),")s1p10h14v0s0b3T"
.;define font for non-OCR' text
.W $C(27)_"(s0p16.67h8.5v0s0b0T"
.;print the form identifiers
.W $C(27),"&a330h300V",$C(15),"FORM:",$C(27),"&a650H",$C(14),IBFORM("TYPE")
.W $C(27),"&a1470H",$C(15),"ID:",$C(27),"&a1700H",$C(14),$G(IBPFID)
.W $C(27),"&a4830H",$C(15),"PAGE:",$C(27),"&a5150H",$C(14),PAGE
.;
.;is the page going to be scanned?
.I $G(IBFORM("SCAN",PAGE)),$G(IBPFID) D
..;Populating the scannable pages field in the forms tracking file
..;#357.96. This is used when scanning the EF to make sure all
..;scannable pages have been scanned before data is filed in PCE.
..I '$D(^IBD(357.96,IBPFID,9,PAGE,0)) D
...S DIC="^IBD(357.96,IBPFID,9,",DIC(0)="L",DIC("P")=$P(^DD(357.96,9,0),"^",2),DA(1)=IBPFID,X=PAGE,DLAYGO=357.96 K DD,DO D FILE^DICN K DIC,DA,DLAYGO,DD,DO
..;print the checksums
..W $C(14),$C(27),"&a3400H",TYPECHK,$C(27),"&a3900H",IDCHK,$C(27),"&a4400H",PAGECHK
.;
NAM .;print form id, etc. on bottom of form
.D
..W !,$C(15),$C(27),"&a300h7710V"
..I $G(IBDSAMP) W "Sample Form: ",$P($G(^IBE(357,+$G(IBFORM),0)),"^") Q
..S X=$G(^TMP("IB",$J,"INTERFACES",+$G(DFN),"DPT PATIENT'S NAME"))
..W:X'="" X W:X="" $P($G(^DPT(+$G(DFN),0)),"^")
.;
.D
..W $C(27),"&a1900H"
..I $G(IBDSAMP) W "Clinic: ",$P($G(^SC(+$G(IBCLINIC),0)),"^") Q
..S X=$G(^TMP("IB",$J,"INTERFACES",+$G(DFN),"DPT PATIENT'S PID"))
..W:X'="" X I X="",+$G(DFN) D PID^VADPT W VA("PID")
.;
.W $C(27),"&a4200H","VA FORM 10-0360 APR 1994"
.W $C(27),"&a4200h7620V","Station: ",$P($$SITE^VASITE,"^",3)
.I $G(REPRINT) W $C(27),"&a1900H","**REPRINT**"
.;
.;reset the primary font & top margin, position cursor at the top
.;reset the font for body of form
.D
..I IBFORM("WIDTH")>96 W $C(27)_"(s0p16.67h8.5v0s0b0T" Q
..I IBFORM("WIDTH")>80 W $C(27)_"(s0p12h10v0s0b0T" Q
..W $C(27)_"(s0p10h12v0s0b0T"
.;set top margin to leave 4 lines at top
.W $C(27),"&l4E"
.;set cursor to top left
.W $C(27),"&a0c0R"
;
;move cursor to top left
I '(IBFORM("SCAN")&IBDEVICE("PCL")),IBDEVICE("RASTER") S (DX,DY)=0 X IOXY K DX,DY
Q
;
ANCHORS ;draws the anchors
;; - leave middle anchors in for time being. removing causes
;; - printing problems in the first line on the page. We will need
;; - to visit this at a later time.
W !
;top left corner (ANCHOR 1)
W $C(27),"&a184v4H",$C(27),"*c4h120v0P",$C(27),"*c124h4v0P"
;top middle (ANCHOR 2)
W $C(27),"&a184v2876H",$C(27),"*c4h120v0P",$C(27),"*c124h4v0P"
;bottom left (ANCHOR 4)
W $C(27),"&a7732v4H",$C(27),"*c124h4v0P",$C(27),"&a7615v4H",$C(27),"*c4h121v0P"
;top right (ANCHOR 3)
W $C(27),"&a184v5534H",$C(27),"*c116h4v0P",$C(27),"&a184v5650H",$C(27),"*c4h120v0P"
;bottom middle (ANCHOR 5)
W !,$C(27),"&a7732v2876H",$C(27),"*c123h4v0P",$C(27),"&a7615v2876H",$C(27),"*c4h121v0P"
;bottom right (ANCHOR 6)
W $C(27),"&a7732v5534H",$C(27),"*c116h4v0P",$C(27),"&a7616v5650H",$C(27),"*c4h120v0P"
Q
IBDF2F1 ;ALB/CJM - ENCOUNTER FORM - PRINT FORM(sends to printer) ;NOV 16,1992
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
+2 ;
REGISTER(PAGE) ;registration for scanning, form # and patient at bottom
+1 NEW PAGECHK,TYPECHK,IDCHK,VA
+2 IF IBDEVICE("PCL")
Begin DoDot:1
+3 IF IBFORM("SCAN")
Begin DoDot:2
+4 ;calculate the checksums
+5 SET PAGECHK=(3*PAGE)#29
SET TYPECHK=(3*IBFORM("TYPE"))#997
SET IDCHK=(3*(+$GET(IBPFID)))#997
End DoDot:2
+6 ;set top margin to top of page
+7 WRITE $CHAR(27),"&l0E"
+8 ;
+9 IF IBFORM("SCAN")
DO ANCHORS
+10 ;
+11 IF $GET(IBFORM("SCAN",PAGE))
Begin DoDot:2
+12 ; -- black box used to determine if page has data for scanning
+13 ; but not for sample forms
+14 IF '$GET(IBDSAMP)
WRITE $CHAR(27),"&a7576v3400H",$CHAR(27),"*c140h140v0P",$CHAR(27)
End DoDot:2
+15 ;
+16 ;define font for OCR'd text
+17 WRITE $CHAR(27),")s1p10h14v0s0b3T"
+18 ;define font for non-OCR' text
+19 WRITE $CHAR(27)_"(s0p16.67h8.5v0s0b0T"
+20 ;print the form identifiers
+21 WRITE $CHAR(27),"&a330h300V",$CHAR(15),"FORM:",$CHAR(27),"&a650H",$CHAR(14),IBFORM("TYPE")
+22 WRITE $CHAR(27),"&a1470H",$CHAR(15),"ID:",$CHAR(27),"&a1700H",$CHAR(14),$GET(IBPFID)
+23 WRITE $CHAR(27),"&a4830H",$CHAR(15),"PAGE:",$CHAR(27),"&a5150H",$CHAR(14),PAGE
+24 ;
+25 ;is the page going to be scanned?
+26 IF $GET(IBFORM("SCAN",PAGE))
IF $GET(IBPFID)
Begin DoDot:2
+27 ;Populating the scannable pages field in the forms tracking file
+28 ;#357.96. This is used when scanning the EF to make sure all
+29 ;scannable pages have been scanned before data is filed in PCE.
+30 IF '$DATA(^IBD(357.96,IBPFID,9,PAGE,0))
Begin DoDot:3
+31 SET DIC="^IBD(357.96,IBPFID,9,"
SET DIC(0)="L"
SET DIC("P")=$PIECE(^DD(357.96,9,0),"^",2)
SET DA(1)=IBPFID
SET X=PAGE
SET DLAYGO=357.96
KILL DD,DO
DO FILE^DICN
KILL DIC,DA,DLAYGO,DD,DO
End DoDot:3
+32 ;print the checksums
+33 WRITE $CHAR(14),$CHAR(27),"&a3400H",TYPECHK,$CHAR(27),"&a3900H",IDCHK,$CHAR(27),"&a4400H",PAGECHK
End DoDot:2
+34 ;
NAM ;print form id, etc. on bottom of form
+1 Begin DoDot:2
+2 WRITE !,$CHAR(15),$CHAR(27),"&a300h7710V"
+3 IF $GET(IBDSAMP)
WRITE "Sample Form: ",$PIECE($GET(^IBE(357,+$GET(IBFORM),0)),"^")
QUIT
+4 SET X=$GET(^TMP("IB",$JOB,"INTERFACES",+$GET(DFN),"DPT PATIENT'S NAME"))
+5 IF X'=""
WRITE X
IF X=""
WRITE $PIECE($GET(^DPT(+$GET(DFN),0)),"^")
End DoDot:2
+6 ;
+7 Begin DoDot:2
+8 WRITE $CHAR(27),"&a1900H"
+9 IF $GET(IBDSAMP)
WRITE "Clinic: ",$PIECE($GET(^SC(+$GET(IBCLINIC),0)),"^")
QUIT
+10 SET X=$GET(^TMP("IB",$JOB,"INTERFACES",+$GET(DFN),"DPT PATIENT'S PID"))
+11 IF X'=""
WRITE X
IF X=""
IF +$GET(DFN)
DO PID^VADPT
WRITE VA("PID")
End DoDot:2
+12 ;
+13 WRITE $CHAR(27),"&a4200H","VA FORM 10-0360 APR 1994"
+14 WRITE $CHAR(27),"&a4200h7620V","Station: ",$PIECE($$SITE^VASITE,"^",3)
+15 IF $GET(REPRINT)
WRITE $CHAR(27),"&a1900H","**REPRINT**"
+16 ;
+17 ;reset the primary font & top margin, position cursor at the top
+18 ;reset the font for body of form
+19 Begin DoDot:2
+20 IF IBFORM("WIDTH")>96
WRITE $CHAR(27)_"(s0p16.67h8.5v0s0b0T"
QUIT
+21 IF IBFORM("WIDTH")>80
WRITE $CHAR(27)_"(s0p12h10v0s0b0T"
QUIT
+22 WRITE $CHAR(27)_"(s0p10h12v0s0b0T"
End DoDot:2
+23 ;set top margin to leave 4 lines at top
+24 WRITE $CHAR(27),"&l4E"
+25 ;set cursor to top left
+26 WRITE $CHAR(27),"&a0c0R"
End DoDot:1
+27 ;
+28 ;move cursor to top left
+29 IF '(IBFORM("SCAN")&IBDEVICE("PCL"))
IF IBDEVICE("RASTER")
SET (DX,DY)=0
XECUTE IOXY
KILL DX,DY
+30 QUIT
+31 ;
ANCHORS ;draws the anchors
+1 ;; - leave middle anchors in for time being. removing causes
+2 ;; - printing problems in the first line on the page. We will need
+3 ;; - to visit this at a later time.
+4 WRITE !
+5 ;top left corner (ANCHOR 1)
+6 WRITE $CHAR(27),"&a184v4H",$CHAR(27),"*c4h120v0P",$CHAR(27),"*c124h4v0P"
+7 ;top middle (ANCHOR 2)
+8 WRITE $CHAR(27),"&a184v2876H",$CHAR(27),"*c4h120v0P",$CHAR(27),"*c124h4v0P"
+9 ;bottom left (ANCHOR 4)
+10 WRITE $CHAR(27),"&a7732v4H",$CHAR(27),"*c124h4v0P",$CHAR(27),"&a7615v4H",$CHAR(27),"*c4h121v0P"
+11 ;top right (ANCHOR 3)
+12 WRITE $CHAR(27),"&a184v5534H",$CHAR(27),"*c116h4v0P",$CHAR(27),"&a184v5650H",$CHAR(27),"*c4h120v0P"
+13 ;bottom middle (ANCHOR 5)
+14 WRITE !,$CHAR(27),"&a7732v2876H",$CHAR(27),"*c123h4v0P",$CHAR(27),"&a7615v2876H",$CHAR(27),"*c4h121v0P"
+15 ;bottom right (ANCHOR 6)
+16 WRITE $CHAR(27),"&a7732v5534H",$CHAR(27),"*c116h4v0P",$CHAR(27),"&a7616v5650H",$CHAR(27),"*c4h120v0P"
+17 QUIT