70 lines
2.5 KiB
Mathematica
70 lines
2.5 KiB
Mathematica
OOPSPCA ;HIRMFO/YH-CA1/CA2 FORM PRINT ;2/19/98
|
|
;;2.0;ASISTS;;Jun 03, 2002
|
|
EN1(CASE,FORM) ; ENTRY POINT TO PRINT THE REPORT OF ACCIDENT FORMS CA1 AND CA2
|
|
;CASE - CASE NUMBER (TEXT)
|
|
;FORM - CA-1 OR CA-2
|
|
Q:FORM=""
|
|
N IEN S IEN=0
|
|
I CASE'="",$D(^OOPS(2260,"B",CASE)) S IEN=$O(^OOPS(2260,"B",CASE,0))
|
|
DEV W !!?5,"The CA-1 and CA-2 forms require a Hewlett Packard laser jet"
|
|
W !?5,"(or compatible) printer with PCL (Printer Control Language)"
|
|
W !?5,"Level 5. Do NOT select the home device."
|
|
S %ZIS="Q",%ZIS("B")="" W ! D ^%ZIS G:POP Q1
|
|
I $D(IO("Q")) S ZTDESC=$S(FORM=1:"NOTICE OF TRAUMATIC INJURY",1:""),ZTIO=ION,ZTRTN="START^OOPSPCA",ZTSAVE("IEN")="",ZTSAVE("FORM")=""
|
|
I $D(IO("Q")) D ^%ZTLOAD,HOME^%ZIS D Q1 Q
|
|
START ; START TO PRINT REPORT OF ACCIDENT FORM CA1 AND CA2
|
|
U IO
|
|
I FORM="CA-1" D G Q1
|
|
. K ^TMP($J) S NN=1,^TMP($J,NN)="Federal Employee's Notice of Traumatic Injury and Claim for Continuation of"
|
|
. S NN=NN+1,^TMP($J,NN)="Pay/Compensation (Continued)"
|
|
. D ^OOPSPC10,^OOPSPC20,^OOPSPC30
|
|
. I IEN=0 D ^OOPSPC70
|
|
. I NN>2 D
|
|
. . S PAGE=1,LINE=0 D PRINTXT
|
|
I FORM="CA-2" D G Q1
|
|
. K ^TMP($J) S NN=1,^TMP($J,NN)="Notice of Occupational Disease and Claim for Compensation (Continued)"
|
|
. D ^OOPSPC40,^OOPSPC50,^OOPSPC60
|
|
. I IEN=0 D ^OOPSPC80
|
|
. I NN>1 D
|
|
. . S PAGE=1,LINE=0 D PRINTXT
|
|
Q1 K ^TMP($J),PAGE,LINE,NN,OOPSDATA,OOPSP,ZTSK,ZTIO S:$D(ZTQUEUED) ZTREQ="@" W @IOF D ^%ZISC Q
|
|
PRINTXT ;PRINT
|
|
N DIWL,DIWR,DIWF,X,II,OOPSWP
|
|
K ^UTILITY($J,"W")
|
|
S DIWL=1,DIWR="",DIWF="C76"
|
|
W @IOF,?70,"Page "_PAGE,!
|
|
F II=1:1:NN D
|
|
.S X=^TMP($J,II)
|
|
.D ^DIWP
|
|
S OOPSWP=^UTILITY($J,"W",1)
|
|
F I=1:1:OOPSWP D
|
|
.W !,^UTILITY($J,"W",1,I,0)
|
|
.S LINE=LINE+1
|
|
.I LINE=65 S PAGE=PAGE+1,LINE=0 W @IOF,?70,"Page"_PAGE,!,^TMP($J,1),!,^TMP($J,2),!
|
|
K ^UTILITY($J,"W")
|
|
Q
|
|
WP(OOPSDIWL,OOPSDIWR,OOPSDIWF,OOPSBS,OOPSNODE,OOPSSEL,OOPSAT,OOPSLBL) ;
|
|
N DIWL,DIWR,DIWF,X,II,III,OOPSWP,OOPSNUM,OOPSFLAG
|
|
S OOPSFLAG=0
|
|
K ^UTILITY($J,"W")
|
|
S DIWL=OOPSDIWL,DIWR=OOPSDIWR,DIWF=OOPSDIWF
|
|
S OOPSNUM=+$P($G(^OOPS(2260,IEN,OOPSNODE,0)),"^",4)
|
|
I OOPSNUM>0,(OOPSNUM<(OOPSBS+1)) D
|
|
.F II=1:1:OOPSNUM D
|
|
..S X=$G(^OOPS(2260,IEN,OOPSNODE,II,0))
|
|
..D ^DIWP
|
|
.S OOPSWP=^UTILITY($J,"W",1)
|
|
.S:OOPSWP>OOPSBS OOPSFLAG=1
|
|
.I OOPSWP<(OOPSBS+1) D
|
|
..F II=1:1:OOPSWP D
|
|
...X OOPSSEL
|
|
I OOPSNUM>OOPSBS!(OOPSFLAG) D
|
|
.X OOPSAT
|
|
.S NN=NN+1,^TMP($J,NN)=" ",NN=NN+1
|
|
.S ^TMP($J,NN)=OOPSLBL
|
|
.S NN=NN+1,^TMP($J,NN)=" "
|
|
.S I=0 F S I=$O(^OOPS(2260,IEN,OOPSNODE,I)) Q:I'>0 D
|
|
..S NN=NN+1,^TMP($J,NN)=^OOPS(2260,IEN,OOPSNODE,I,0)
|
|
K ^UTILITY($J,"W")
|
|
Q
|