OOPSPC11 ;HIRMFO/YH-EMPLOYEE'S DATA, CA1 FORM ;6/12/98
;;2.0;ASISTS;;Jun 03, 2002
;EMPLOYEE DATA
;EMPLOYEE'S DATA
S OOPSDATA=$P($G(^OOPS(2260,IEN,0)),"^",2)
W !,"PU1.3,25.4,LB"_OOPSDATA_"#;" ;NAME
S OOPSDATA=$G(^OOPS(2260,IEN,"2162A"))
S OOPSP=$P(OOPSDATA,"^") I OOPSP'["-" S OOPSP=$E(OOPSP,1,3)_"-"_$E(OOPSP,4,5)_"-"_$E(OOPSP,6,13)
W !,"PU16.8,25.3;LB"_OOPSP_"#;" ;SSN
S OOPSP=$P(OOPSDATA,"^",2) I OOPSP'="" D WDATE^OOPSPUT1(OOPSP,"3.4,24.6","4.3,24.6","5.2,24.6") ;DATE OF BIRTH
S OOPSP=$P(OOPSDATA,"^",3) W !,$S(OOPSP=1:"PU7.2,24.5;LBX#;",OOPSP=2:"PU8.6,24.5;LBX#;",1:"") ;SEX
N PHN
S PHN=$TR($P(OOPSDATA,"^",8),"/-*#","")
W !,"PU10.8,24.6;LB"_$E(PHN,1,3)_"-"_$E(PHN,4,6)_"-",$E(PHN,7,10)_"#;"
S OOPSP=$P(OOPSDATA,"^",12) I OOPSP'="" W !,"PU18.4,24.6;LB"_+OOPSP_"#;PU19.8,24.6;LB"_$P(OOPSDATA,"^",13)_"#;" ;GRADE AND STEP
I $P(OOPSDATA,"^",4)'="" W !,"PU1.3,23.6;LB"_$P(OOPSDATA,"^",4)_"#;"
I $P(OOPSDATA,"^",5)'="" W !,"PU1.3,22.6;LB"_$P(OOPSDATA,"^",5)_"#;"
I $D(^DIC(5,+$P(OOPSDATA,"^",6),0)) W !,"LB, "_$P(^DIC(5,+$P(OOPSDATA,"^",6),0),"^")_" "_$P(OOPSDATA,"^",7)_"#;" ;ADDRESS
S OOPSP=+$P($G(^OOPS(2260,IEN,"CA1A")),"^",8) ;DEPENDENTS
I OOPSP>0,OOPSP<7 D
. W !,$S(OOPSP=1:"PU16.9,23.6;LBX#;",OOPSP=2:"PU16.9,23.2;LBX#;",OOPSP=3:"PU16.9,22.8;LBX#;",OOPSP=4:"PU16.9,23.6;LBX#;PU16.9,23.2;LBX#;",OOPSP=5:"PU16.9,23.6;LBX#;PU16.9,22.8;LBX#;",OOPSP=6:"PU16.9,23.2;LBX#;PU16.9,22.8;LBX#;",1:"")
I OOPSP=7 W !,"PU16.9,23.6;LBX#;PU16.9,23.2;LBX#;PU16.9,22.8;LBX#;"
W !,"PU1.3,21;LB"_$P($G(^OOPS(2260,IEN,"CA1A")),"^",9)_"#;" ;WHERE INJURY OCCURRED
; Patch 11 - this should print field 109, not 4
; S OOPSP=$P($G(^OOPS(2260,IEN,0)),"^",5) I OOPSP'="" D
S OOPSDATA=$G(^OOPS(2260,IEN,"CA1A"))
S OOPSP=$P(OOPSDATA,"^",10) I OOPSP'="" D
. D WDATE^OOPSPUT1($P(OOPSP,"."),"1.4,19.8","2.3,19.8","3.2,19.8")
. D WTIME^OOPSPUT1($P(OOPSP,".",2)_"0000","6.5,20.1","6.5,19.7","4.8,20","5.8,20") ;D/T INJURY OCCURED
; S OOPSDATA=$G(^OOPS(2260,IEN,"CA1A")) ; moved above patch 11
S OOPSP=$P(OOPSDATA,"^",11) I OOPSP'="" D WDATE^OOPSPUT1(OOPSP,"8.3,19.8","9.2,19.8","10,19.8") ;DATE OF NOTICE
W !,"PU11.6,20;LB"_$P(OOPSDATA,"^",12)_"#;" ;OCCUPATION
S OOPSDATA=$G(^OOPS(2260,IEN,"CA1B"))
S OOPSP=$P(OOPSDATA,"^") I OOPSP'="" W !,"PU1.3,18.8;LB"_$E(OOPSP,1,86)_"#;","PU1.3,18.2;LB"_$E(OOPSP,87,150)_"#;","PU1.3,17.8;LB"_$E(OOPSP,151,200)_"#;" ;CAUSE OF INJURY
; patch 8 - added block 14
S OOPSNOI=$$GET1^DIQ(2260,IEN,"62:1")
S OCC=$$GET1^DIQ(2260,IEN,15,"E")
S OCC=$S(OCC<2200:"G"_OCC,(OCC>2499&(OCC<9001)):"W"_OCC,(OCC=9999):"Z"_OCC,1:"")
S OOPSTYP=$$GET1^DIQ(2260,IEN,"123:1")
S OOPSSOR=$$GET1^DIQ(2260,IEN,"124:1")
W "PU17.4,17.8;LB"_OCC_"#;" ; OCCUPATION CODE
S OOPSDATA=$G(^OOPS(2260,IEN,"CA1C")) W !,"PU1.3,16.8;LB"_$E(OOPSDATA,1,60)_"#;" ; 1st line NATURE OF INJURY
W "PU16.8,16.8;LB"_OOPSTYP_"#;"_"PU18.9,16.8;LB"_OOPSSOR_"#;" ;TYP/SORCE
W "PU1.3,15.8;LB"_$E(OOPSDATA,61,100)_"#;" ;NATURE OF INJURY
W "PU16.8,15.8;LB"_OOPSNOI_"#;" ; NOI CODE
S OOPSP=$P($G(^OOPS(2260,IEN,"CA1A")),"^",13) W !,$S(OOPSP["COP":"PU1.5,13.5;LBX#;",OOPSP["L":"PU1.5,12.4;LBX#;",1:"")
K OOPSNOI,OCC,OOPSTYP,OOPSSOR
;
; Patch 8 - added Employee signature, date signed to CA1
N X,X1,X2,STR,VER
S STR=$G(^OOPS(2260,IEN,"CA")),VER=$P(STR,"^",9),X=$P(STR,"^",7)
I $G(VER)=1&($G(X)'="") D
. S X1=$$GET1^DIQ(2260,IEN,119,"I"),X2=$$CA1SUM^OOPSUTL6()
. D DE^XUSHSHP
. W !,"PU9.6,10.7;LB/ES/ "_X_"#;"
S OOPSDATA=$G(^OOPS(2260,IEN,"CA1ES"))
I $P(OOPSDATA,"^",2)'="",+$P(OOPSDATA,"^",3)>0 W !,"PU17.6,10.7;LB"_$$FMTE^XLFDT($P(OOPSDATA,"^",3),1)_"#;" ;DATE SIGNED
;
; Patch 8 - Witness information - only send the first witness entered
N WITN
S WITN=$O(^OOPS(2260,IEN,"CA1W",0))
I '$G(WITN) K I,J Q
S OOPSDATA=$G(^OOPS(2260,IEN,"CA1W",WITN,1))
W !,"PU1.5,7.0;LB"_OOPSDATA_"#;"
S OOPSDATA=$G(^OOPS(2260,IEN,"CA1W",WITN,0))
W !,"PU1.5,3.9;LB"_$P(OOPSDATA,U)_"#;"_"PU17.9,3.9;LB"_$$FMTE^XLFDT($P(OOPSDATA,U,6),1)_"#;"
W !,"PU1.5,3.2;LB"_$P(OOPSDATA,U,2)_"#;" ; Witness address
W !,"PU8.2,3.2;LB"_$P(OOPSDATA,U,3)_"#;" ; Witness City
W !,"PU13.4,3.2;LB"_$E($P($G(^DIC(5,+$P(OOPSDATA,U,4),0)),U),1,20)_"#;"
W !,"PU17.9,3.2;LB"_$E($P(OOPSDATA,U,5),1,5)_"#;"
S OOPSDATA=$G(^OOPS(2260,IEN,"CA1D"))
W !,"PU1,3.9;LB"_$P(OOPSDATA,"^")_"#;"
K I,J Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSPC11 4348 printed Nov 22, 2024@16:49:33 Page 2
OOPSPC11 ;HIRMFO/YH-EMPLOYEE'S DATA, CA1 FORM ;6/12/98
+1 ;;2.0;ASISTS;;Jun 03, 2002
+2 ;EMPLOYEE DATA
+3 ;EMPLOYEE'S DATA
+4 SET OOPSDATA=$PIECE($GET(^OOPS(2260,IEN,0)),"^",2)
+5 ;NAME
WRITE !,"PU1.3,25.4,LB"_OOPSDATA_"#;"
+6 SET OOPSDATA=$GET(^OOPS(2260,IEN,"2162A"))
+7 SET OOPSP=$PIECE(OOPSDATA,"^")
IF OOPSP'["-"
SET OOPSP=$EXTRACT(OOPSP,1,3)_"-"_$EXTRACT(OOPSP,4,5)_"-"_$EXTRACT(OOPSP,6,13)
+8 ;SSN
WRITE !,"PU16.8,25.3;LB"_OOPSP_"#;"
+9 ;DATE OF BIRTH
SET OOPSP=$PIECE(OOPSDATA,"^",2)
IF OOPSP'=""
DO WDATE^OOPSPUT1(OOPSP,"3.4,24.6","4.3,24.6","5.2,24.6")
+10 ;SEX
SET OOPSP=$PIECE(OOPSDATA,"^",3)
WRITE !,$SELECT(OOPSP=1:"PU7.2,24.5;LBX#;",OOPSP=2:"PU8.6,24.5;LBX#;",1:"")
+11 NEW PHN
+12 SET PHN=$TRANSLATE($PIECE(OOPSDATA,"^",8),"/-*#","")
+13 WRITE !,"PU10.8,24.6;LB"_$EXTRACT(PHN,1,3)_"-"_$EXTRACT(PHN,4,6)_"-",$EXTRACT(PHN,7,10)_"#;"
+14 ;GRADE AND STEP
SET OOPSP=$PIECE(OOPSDATA,"^",12)
IF OOPSP'=""
WRITE !,"PU18.4,24.6;LB"_+OOPSP_"#;PU19.8,24.6;LB"_$PIECE(OOPSDATA,"^",13)_"#;"
+15 IF $PIECE(OOPSDATA,"^",4)'=""
WRITE !,"PU1.3,23.6;LB"_$PIECE(OOPSDATA,"^",4)_"#;"
+16 IF $PIECE(OOPSDATA,"^",5)'=""
WRITE !,"PU1.3,22.6;LB"_$PIECE(OOPSDATA,"^",5)_"#;"
+17 ;ADDRESS
IF $DATA(^DIC(5,+$PIECE(OOPSDATA,"^",6),0))
WRITE !,"LB, "_$PIECE(^DIC(5,+$PIECE(OOPSDATA,"^",6),0),"^")_" "_$PIECE(OOPSDATA,"^",7)_"#;"
+18 ;DEPENDENTS
SET OOPSP=+$PIECE($GET(^OOPS(2260,IEN,"CA1A")),"^",8)
+19 IF OOPSP>0
IF OOPSP<7
Begin DoDot:1
+20 WRITE !,$SELECT(OOPSP=1:"PU16.9,23.6;LBX#;",OOPSP=2:"PU16.9,23.2;LBX#;",OOPSP=3:"PU16.9,22.8;LBX#;",OOPSP=4:"PU16.9,23.6;LBX#;PU16.9,23.2;LBX#;",OOPSP=5:"PU16.9,23.6;LBX#;PU16.9,22.8;LBX#;",OOPSP=6:"PU16.9,23.2;LBX#;PU16.9,22.8;LBX#
;",1:"")
End DoDot:1
+21 IF OOPSP=7
WRITE !,"PU16.9,23.6;LBX#;PU16.9,23.2;LBX#;PU16.9,22.8;LBX#;"
+22 ;WHERE INJURY OCCURRED
WRITE !,"PU1.3,21;LB"_$PIECE($GET(^OOPS(2260,IEN,"CA1A")),"^",9)_"#;"
+23 ; Patch 11 - this should print field 109, not 4
+24 ; S OOPSP=$P($G(^OOPS(2260,IEN,0)),"^",5) I OOPSP'="" D
+25 SET OOPSDATA=$GET(^OOPS(2260,IEN,"CA1A"))
+26 SET OOPSP=$PIECE(OOPSDATA,"^",10)
IF OOPSP'=""
Begin DoDot:1
+27 DO WDATE^OOPSPUT1($PIECE(OOPSP,"."),"1.4,19.8","2.3,19.8","3.2,19.8")
+28 ;D/T INJURY OCCURED
DO WTIME^OOPSPUT1($PIECE(OOPSP,".",2)_"0000","6.5,20.1","6.5,19.7","4.8,20","5.8,20")
End DoDot:1
+29 ; S OOPSDATA=$G(^OOPS(2260,IEN,"CA1A")) ; moved above patch 11
+30 ;DATE OF NOTICE
SET OOPSP=$PIECE(OOPSDATA,"^",11)
IF OOPSP'=""
DO WDATE^OOPSPUT1(OOPSP,"8.3,19.8","9.2,19.8","10,19.8")
+31 ;OCCUPATION
WRITE !,"PU11.6,20;LB"_$PIECE(OOPSDATA,"^",12)_"#;"
+32 SET OOPSDATA=$GET(^OOPS(2260,IEN,"CA1B"))
+33 ;CAUSE OF INJURY
SET OOPSP=$PIECE(OOPSDATA,"^")
IF OOPSP'=""
WRITE !,"PU1.3,18.8;LB"_$EXTRACT(OOPSP,1,86)_"#;","PU1.3,18.2;LB"_$EXTRACT(OOPSP,87,150)_"#;","PU1.3,17.8;LB"_$EXTRACT(OOPSP,151,200)_"#;"
+34 ; patch 8 - added block 14
+35 SET OOPSNOI=$$GET1^DIQ(2260,IEN,"62:1")
+36 SET OCC=$$GET1^DIQ(2260,IEN,15,"E")
+37 SET OCC=$SELECT(OCC<2200:"G"_OCC,(OCC>2499&(OCC<9001)):"W"_OCC,(OCC=9999):"Z"_OCC,1:"")
+38 SET OOPSTYP=$$GET1^DIQ(2260,IEN,"123:1")
+39 SET OOPSSOR=$$GET1^DIQ(2260,IEN,"124:1")
+40 ; OCCUPATION CODE
WRITE "PU17.4,17.8;LB"_OCC_"#;"
+41 ; 1st line NATURE OF INJURY
SET OOPSDATA=$GET(^OOPS(2260,IEN,"CA1C"))
WRITE !,"PU1.3,16.8;LB"_$EXTRACT(OOPSDATA,1,60)_"#;"
+42 ;TYP/SORCE
WRITE "PU16.8,16.8;LB"_OOPSTYP_"#;"_"PU18.9,16.8;LB"_OOPSSOR_"#;"
+43 ;NATURE OF INJURY
WRITE "PU1.3,15.8;LB"_$EXTRACT(OOPSDATA,61,100)_"#;"
+44 ; NOI CODE
WRITE "PU16.8,15.8;LB"_OOPSNOI_"#;"
+45 SET OOPSP=$PIECE($GET(^OOPS(2260,IEN,"CA1A")),"^",13)
WRITE !,$SELECT(OOPSP["COP":"PU1.5,13.5;LBX#;",OOPSP["L":"PU1.5,12.4;LBX#;",1:"")
+46 KILL OOPSNOI,OCC,OOPSTYP,OOPSSOR
+47 ;
+48 ; Patch 8 - added Employee signature, date signed to CA1
+49 NEW X,X1,X2,STR,VER
+50 SET STR=$GET(^OOPS(2260,IEN,"CA"))
SET VER=$PIECE(STR,"^",9)
SET X=$PIECE(STR,"^",7)
+51 IF $GET(VER)=1&($GET(X)'="")
Begin DoDot:1
+52 SET X1=$$GET1^DIQ(2260,IEN,119,"I")
SET X2=$$CA1SUM^OOPSUTL6()
+53 DO DE^XUSHSHP
+54 WRITE !,"PU9.6,10.7;LB/ES/ "_X_"#;"
End DoDot:1
+55 SET OOPSDATA=$GET(^OOPS(2260,IEN,"CA1ES"))
+56 ;DATE SIGNED
IF $PIECE(OOPSDATA,"^",2)'=""
IF +$PIECE(OOPSDATA,"^",3)>0
WRITE !,"PU17.6,10.7;LB"_$$FMTE^XLFDT($PIECE(OOPSDATA,"^",3),1)_"#;"
+57 ;
+58 ; Patch 8 - Witness information - only send the first witness entered
+59 NEW WITN
+60 SET WITN=$ORDER(^OOPS(2260,IEN,"CA1W",0))
+61 IF '$GET(WITN)
KILL I,J
QUIT
+62 SET OOPSDATA=$GET(^OOPS(2260,IEN,"CA1W",WITN,1))
+63 WRITE !,"PU1.5,7.0;LB"_OOPSDATA_"#;"
+64 SET OOPSDATA=$GET(^OOPS(2260,IEN,"CA1W",WITN,0))
+65 WRITE !,"PU1.5,3.9;LB"_$PIECE(OOPSDATA,U)_"#;"_"PU17.9,3.9;LB"_$$FMTE^XLFDT($PIECE(OOPSDATA,U,6),1)_"#;"
+66 ; Witness address
WRITE !,"PU1.5,3.2;LB"_$PIECE(OOPSDATA,U,2)_"#;"
+67 ; Witness City
WRITE !,"PU8.2,3.2;LB"_$PIECE(OOPSDATA,U,3)_"#;"
+68 WRITE !,"PU13.4,3.2;LB"_$EXTRACT($PIECE($GET(^DIC(5,+$PIECE(OOPSDATA,U,4),0)),U),1,20)_"#;"
+69 WRITE !,"PU17.9,3.2;LB"_$EXTRACT($PIECE(OOPSDATA,U,5),1,5)_"#;"
+70 SET OOPSDATA=$GET(^OOPS(2260,IEN,"CA1D"))
+71 WRITE !,"PU1,3.9;LB"_$PIECE(OOPSDATA,"^")_"#;"
+72 KILL I,J
QUIT