OOPSUTL5 ;WIOFO/CAH-Utilities Routine ;4/6/00
;;2.0;ASISTS;;Jun 03, 2002
VAL(IEN) ; Validation for required fields for DOL transmission
;
; Input: IEN = Internal Entry Number of entry in file 2260
; Output: VAL = 1 Valid to be transmitted to DOL
; = "" Invalid to be transmitted
; NULL(#)= List of invalid fields
K NULL
N DATA,NAM,WITN,WITN0,WITN1
S VAL=1
F FLD=1,4,5,6,7,8,9,10,11,13,15,30,60,62,67,68,70,73 D
.I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,"","LABEL")
I $P($G(^OOPS(2260,IEN,"CA")),U,4)=3 D
.I $$GET1^DIQ(2260,IEN,61)="" S NULL(61)=$$GET1^DID(2260,61,,"LABEL")
I $$GET1^DIQ(2260,IEN,52,"I")=1 D
.I $$GET1^DIQ(2260,IEN,146,"I")="N" D
..I $$GET1^DIQ(2260,IEN,147)="" S NULL(147)=$$GET1^DID(2260,147,,"LABEL")
.I $$GET1^DIQ(2260,IEN,148,"I")="Y" D
..I $$GET1^DIQ(2260,IEN,149)="" S NULL(149)=$$GET1^DID(2260,149,,"LABEL")
.F FLD=108,110,111,112,114,120,126,130,131,132,133,134,140,162,169,170,171,172,173,174,175,176,177,180,181,183,184,185 D
..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
.I $$GET1^DIQ(2260,IEN,150,"I")="Y" F FLD=151:1:155 D
..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
.I $$GET1^DIQ(2260,IEN,2,"I")=1 F FLD=166,167 D
..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
.I $P($G(^OOPS(2260,IEN,"CA1I")),U)'="" D
..S NAM=$P(^OOPS(2260,IEN,"CA1I"),U) I '$$NMCHK^OOPSUTL3(NAM) S NULL(156)="Invalid Physician Name format."
..I $$GET1^DIQ(2260,IEN,157)="" S NULL(157)=$$GET1^DID(2260,157,,"LABEL")
..I $$GET1^DIQ(2260,IEN,158)="" S NULL(158)=$$GET1^DID(2260,158,,"LABEL")
..I $$GET1^DIQ(2260,IEN,159)="" S NULL(159)=$$GET1^DID(2260,159,,"LABEL")
..I $$GET1^DIQ(2260,IEN,160)="" S NULL(160)=$$GET1^DID(2260,160,,"LABEL")
..I $$GET1^DIQ(2260,IEN,182)="" S NULL(182)=$$GET1^DID(2260,182,,"LABEL")
.; check witness data
.S WITN=$O(^OOPS(2260,IEN,"CA1W",0))
.I $G(WITN) D
..S WITN0=$G(^OOPS(2260,IEN,"CA1W",WITN,0))
..S WITN1=$G(^OOPS(2260,IEN,"CA1W",WITN,1))
..I '$$NMCHK^OOPSUTL3($P(WITN0,U)) S NULL(125.01)="Invalid Witness Name format."
..I $P(WITN0,U,2)="" S NULL(125.1)=$$GET1^DID(2260.0125,1,,"LABEL")
..I $P(WITN0,U,3)="" S NULL(125.2)=$$GET1^DID(2260.0125,2,,"LABEL")
..I $P(WITN0,U,4)="" S NULL(125.3)=$$GET1^DID(2260.0125,3,,"LABEL")
..I $P(WITN0,U,5)="" S NULL(125.4)=$$GET1^DID(2260.0125,4,,"LABEL")
..I $P(WITN0,U,6)="" S NULL(125.5)=$$GET1^DID(2260.0125,5,,"LABEL")
..I $G(WITN1)="" S NULL(125.6)=$$GET1^DID(2260.0125,6,,"LABEL")
.I $$WP^OOPSUTL4(165)>528 S NULL(165)=" REASON FOR CONTROVERT COP exceeds 528 character limit set by DOL."
.I $$WP^OOPSUTL4(164)>528 S NULL(164)=" SUPERVISOR NOT AGREE EXPLAIN exceeds 528 character limit set by DOL."
I $$GET1^DIQ(2260,IEN,52,"I")=2 D
.F FLD=208,209,213,214,215,222,223,230,231,232,233,234,237,238,241,251,252,255,265,266,267,268,269 D
..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
.I $P($G(^OOPS(2260,IEN,"CA2J")),U)'="" D
..S NAM=$P(^OOPS(2260,IEN,"CA2J"),U) I '$$NMCHK^OOPSUTL3(NAM) S NULL(245)="Invalid Physician Name format."
..I $$GET1^DIQ(2260,IEN,246)="" S NULL(246)=$$GET1^DID(2260,246,,"LABEL")
..I $$GET1^DIQ(2260,IEN,247)="" S NULL(247)=$$GET1^DID(2260,247,,"LABEL")
..I $$GET1^DIQ(2260,IEN,248)="" S NULL(248)=$$GET1^DID(2260,248,,"LABEL")
..I $$GET1^DIQ(2260,IEN,249)="" S NULL(249)=$$GET1^DID(2260,249,,"LABEL")
..I $$GET1^DIQ(2260,IEN,270)="" S NULL(270)=$$GET1^DID(2260,270,,"LABEL")
.I $$WP^OOPSUTL4(216)>528 S NULL(216)="RELATIONSHIP OF ILLNESS TO EMP exceeds 528 character limit set by DOL."
.I $$WP^OOPSUTL4(217)>264 S NULL(217)="NATURE OF DISEASE/ILLNESS exceededs 264 character limit set by DOL."
.I $$WP^OOPSUTL4(218)>528 S NULL(218)="CLAIM NOT FILED exceeds 528 character limit set by DOL."
.I $$WP^OOPSUTL4(219)>528 S NULL(219)="EMPLOYEE STATEMENT DELAYED exceeds 528 character limit set by DOL."
.I $$WP^OOPSUTL4(220)>528 S NULL(220)="MEDICAL REPORT DELAYED exceeds 528 character limit set by DOL."
.I $$WP^OOPSUTL4(257)>528 S NULL(257)="WORK DUTY CHANGED exceeds 528 character limit set by DOL."
; if NULL is defined, invalid record
I $D(NULL) S VAL=""
K DISYS,DIW,DIW1,DIWT,DIWTC,DIWX,DN
Q VAL
CONV(TOCON) ; CONVERT A RANGE (Ex. 1,2-4,7 to 1,2,3,4,5,7)
; 'TOCON' must be passed as a literal (Ex. "1,2-4,7" not 1,2-4,7)
;
; Input: TOCON = Value to be converted
; Output: CONV = Converted value
N CONV,FIRST,LAST,NUM,TEST,TEST2
S CONV=""
F TEST=1:1:$L(TOCON,",") D
.S NUM=$P(TOCON,",",TEST)
.I NUM'["-" S CONV=CONV_NUM_","
.I NUM["-" S FIRST=$P(NUM,"-") S LAST=$P(NUM,"-",2) D
..F TEST2=FIRST:1:LAST S CONV=CONV_TEST2_","
..Q
S CONV=$E(CONV,1,($L(CONV)-1))
Q CONV
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSUTL5 4778 printed Dec 13, 2024@01:39:49 Page 2
OOPSUTL5 ;WIOFO/CAH-Utilities Routine ;4/6/00
+1 ;;2.0;ASISTS;;Jun 03, 2002
VAL(IEN) ; Validation for required fields for DOL transmission
+1 ;
+2 ; Input: IEN = Internal Entry Number of entry in file 2260
+3 ; Output: VAL = 1 Valid to be transmitted to DOL
+4 ; = "" Invalid to be transmitted
+5 ; NULL(#)= List of invalid fields
+6 KILL NULL
+7 NEW DATA,NAM,WITN,WITN0,WITN1
+8 SET VAL=1
+9 FOR FLD=1,4,5,6,7,8,9,10,11,13,15,30,60,62,67,68,70,73
Begin DoDot:1
+10 IF $$GET1^DIQ(2260,IEN,FLD)=""
SET NULL(FLD)=$$GET1^DID(2260,FLD,"","LABEL")
End DoDot:1
+11 IF $PIECE($GET(^OOPS(2260,IEN,"CA")),U,4)=3
Begin DoDot:1
+12 IF $$GET1^DIQ(2260,IEN,61)=""
SET NULL(61)=$$GET1^DID(2260,61,,"LABEL")
End DoDot:1
+13 IF $$GET1^DIQ(2260,IEN,52,"I")=1
Begin DoDot:1
+14 IF $$GET1^DIQ(2260,IEN,146,"I")="N"
Begin DoDot:2
+15 IF $$GET1^DIQ(2260,IEN,147)=""
SET NULL(147)=$$GET1^DID(2260,147,,"LABEL")
End DoDot:2
+16 IF $$GET1^DIQ(2260,IEN,148,"I")="Y"
Begin DoDot:2
+17 IF $$GET1^DIQ(2260,IEN,149)=""
SET NULL(149)=$$GET1^DID(2260,149,,"LABEL")
End DoDot:2
+18 FOR FLD=108,110,111,112,114,120,126,130,131,132,133,134,140,162,169,170,171,172,173,174,175,176,177,180,181,183,184,185
Begin DoDot:2
+19 IF $$GET1^DIQ(2260,IEN,FLD)=""
SET NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
End DoDot:2
+20 IF $$GET1^DIQ(2260,IEN,150,"I")="Y"
FOR FLD=151:1:155
Begin DoDot:2
+21 IF $$GET1^DIQ(2260,IEN,FLD)=""
SET NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
End DoDot:2
+22 IF $$GET1^DIQ(2260,IEN,2,"I")=1
FOR FLD=166,167
Begin DoDot:2
+23 IF $$GET1^DIQ(2260,IEN,FLD)=""
SET NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
End DoDot:2
+24 IF $PIECE($GET(^OOPS(2260,IEN,"CA1I")),U)'=""
Begin DoDot:2
+25 SET NAM=$PIECE(^OOPS(2260,IEN,"CA1I"),U)
IF '$$NMCHK^OOPSUTL3(NAM)
SET NULL(156)="Invalid Physician Name format."
+26 IF $$GET1^DIQ(2260,IEN,157)=""
SET NULL(157)=$$GET1^DID(2260,157,,"LABEL")
+27 IF $$GET1^DIQ(2260,IEN,158)=""
SET NULL(158)=$$GET1^DID(2260,158,,"LABEL")
+28 IF $$GET1^DIQ(2260,IEN,159)=""
SET NULL(159)=$$GET1^DID(2260,159,,"LABEL")
+29 IF $$GET1^DIQ(2260,IEN,160)=""
SET NULL(160)=$$GET1^DID(2260,160,,"LABEL")
+30 IF $$GET1^DIQ(2260,IEN,182)=""
SET NULL(182)=$$GET1^DID(2260,182,,"LABEL")
End DoDot:2
+31 ; check witness data
+32 SET WITN=$ORDER(^OOPS(2260,IEN,"CA1W",0))
+33 IF $GET(WITN)
Begin DoDot:2
+34 SET WITN0=$GET(^OOPS(2260,IEN,"CA1W",WITN,0))
+35 SET WITN1=$GET(^OOPS(2260,IEN,"CA1W",WITN,1))
+36 IF '$$NMCHK^OOPSUTL3($PIECE(WITN0,U))
SET NULL(125.01)="Invalid Witness Name format."
+37 IF $PIECE(WITN0,U,2)=""
SET NULL(125.1)=$$GET1^DID(2260.0125,1,,"LABEL")
+38 IF $PIECE(WITN0,U,3)=""
SET NULL(125.2)=$$GET1^DID(2260.0125,2,,"LABEL")
+39 IF $PIECE(WITN0,U,4)=""
SET NULL(125.3)=$$GET1^DID(2260.0125,3,,"LABEL")
+40 IF $PIECE(WITN0,U,5)=""
SET NULL(125.4)=$$GET1^DID(2260.0125,4,,"LABEL")
+41 IF $PIECE(WITN0,U,6)=""
SET NULL(125.5)=$$GET1^DID(2260.0125,5,,"LABEL")
+42 IF $GET(WITN1)=""
SET NULL(125.6)=$$GET1^DID(2260.0125,6,,"LABEL")
End DoDot:2
+43 IF $$WP^OOPSUTL4(165)>528
SET NULL(165)=" REASON FOR CONTROVERT COP exceeds 528 character limit set by DOL."
+44 IF $$WP^OOPSUTL4(164)>528
SET NULL(164)=" SUPERVISOR NOT AGREE EXPLAIN exceeds 528 character limit set by DOL."
End DoDot:1
+45 IF $$GET1^DIQ(2260,IEN,52,"I")=2
Begin DoDot:1
+46 FOR FLD=208,209,213,214,215,222,223,230,231,232,233,234,237,238,241,251,252,255,265,266,267,268,269
Begin DoDot:2
+47 IF $$GET1^DIQ(2260,IEN,FLD)=""
SET NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
End DoDot:2
+48 IF $PIECE($GET(^OOPS(2260,IEN,"CA2J")),U)'=""
Begin DoDot:2
+49 SET NAM=$PIECE(^OOPS(2260,IEN,"CA2J"),U)
IF '$$NMCHK^OOPSUTL3(NAM)
SET NULL(245)="Invalid Physician Name format."
+50 IF $$GET1^DIQ(2260,IEN,246)=""
SET NULL(246)=$$GET1^DID(2260,246,,"LABEL")
+51 IF $$GET1^DIQ(2260,IEN,247)=""
SET NULL(247)=$$GET1^DID(2260,247,,"LABEL")
+52 IF $$GET1^DIQ(2260,IEN,248)=""
SET NULL(248)=$$GET1^DID(2260,248,,"LABEL")
+53 IF $$GET1^DIQ(2260,IEN,249)=""
SET NULL(249)=$$GET1^DID(2260,249,,"LABEL")
+54 IF $$GET1^DIQ(2260,IEN,270)=""
SET NULL(270)=$$GET1^DID(2260,270,,"LABEL")
End DoDot:2
+55 IF $$WP^OOPSUTL4(216)>528
SET NULL(216)="RELATIONSHIP OF ILLNESS TO EMP exceeds 528 character limit set by DOL."
+56 IF $$WP^OOPSUTL4(217)>264
SET NULL(217)="NATURE OF DISEASE/ILLNESS exceededs 264 character limit set by DOL."
+57 IF $$WP^OOPSUTL4(218)>528
SET NULL(218)="CLAIM NOT FILED exceeds 528 character limit set by DOL."
+58 IF $$WP^OOPSUTL4(219)>528
SET NULL(219)="EMPLOYEE STATEMENT DELAYED exceeds 528 character limit set by DOL."
+59 IF $$WP^OOPSUTL4(220)>528
SET NULL(220)="MEDICAL REPORT DELAYED exceeds 528 character limit set by DOL."
+60 IF $$WP^OOPSUTL4(257)>528
SET NULL(257)="WORK DUTY CHANGED exceeds 528 character limit set by DOL."
End DoDot:1
+61 ; if NULL is defined, invalid record
+62 IF $DATA(NULL)
SET VAL=""
+63 KILL DISYS,DIW,DIW1,DIWT,DIWTC,DIWX,DN
+64 QUIT VAL
CONV(TOCON) ; CONVERT A RANGE (Ex. 1,2-4,7 to 1,2,3,4,5,7)
+1 ; 'TOCON' must be passed as a literal (Ex. "1,2-4,7" not 1,2-4,7)
+2 ;
+3 ; Input: TOCON = Value to be converted
+4 ; Output: CONV = Converted value
+5 NEW CONV,FIRST,LAST,NUM,TEST,TEST2
+6 SET CONV=""
+7 FOR TEST=1:1:$LENGTH(TOCON,",")
Begin DoDot:1
+8 SET NUM=$PIECE(TOCON,",",TEST)
+9 IF NUM'["-"
SET CONV=CONV_NUM_","
+10 IF NUM["-"
SET FIRST=$PIECE(NUM,"-")
SET LAST=$PIECE(NUM,"-",2)
Begin DoDot:2
+11 FOR TEST2=FIRST:1:LAST
SET CONV=CONV_TEST2_","
+12 QUIT
End DoDot:2
End DoDot:1
+13 SET CONV=$EXTRACT(CONV,1,($LENGTH(CONV)-1))
+14 QUIT CONV