source: FOIAVistA/trunk/r/ASISTS-OOPS/OOPSUTL5.m@ 1154

Last change on this file since 1154 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1OOPSUTL5 ;WIOFO/CAH-Utilities Routine ;4/6/00
2 ;;2.0;ASISTS;;Jun 03, 2002
3VAL(IEN) ; Validation for required fields for DOL transmission
4 ;
5 ; Input: IEN = Internal Entry Number of entry in file 2260
6 ; Output: VAL = 1 Valid to be transmitted to DOL
7 ; = "" Invalid to be transmitted
8 ; NULL(#)= List of invalid fields
9 K NULL
10 N DATA,NAM,WITN,WITN0,WITN1
11 S VAL=1
12 F FLD=1,4,5,6,7,8,9,10,11,13,15,30,60,62,67,68,70,73 D
13 .I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,"","LABEL")
14 I $P($G(^OOPS(2260,IEN,"CA")),U,4)=3 D
15 .I $$GET1^DIQ(2260,IEN,61)="" S NULL(61)=$$GET1^DID(2260,61,,"LABEL")
16 I $$GET1^DIQ(2260,IEN,52,"I")=1 D
17 .I $$GET1^DIQ(2260,IEN,146,"I")="N" D
18 ..I $$GET1^DIQ(2260,IEN,147)="" S NULL(147)=$$GET1^DID(2260,147,,"LABEL")
19 .I $$GET1^DIQ(2260,IEN,148,"I")="Y" D
20 ..I $$GET1^DIQ(2260,IEN,149)="" S NULL(149)=$$GET1^DID(2260,149,,"LABEL")
21 .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
22 ..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
23 .I $$GET1^DIQ(2260,IEN,150,"I")="Y" F FLD=151:1:155 D
24 ..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
25 .I $$GET1^DIQ(2260,IEN,2,"I")=1 F FLD=166,167 D
26 ..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
27 .I $P($G(^OOPS(2260,IEN,"CA1I")),U)'="" D
28 ..S NAM=$P(^OOPS(2260,IEN,"CA1I"),U) I '$$NMCHK^OOPSUTL3(NAM) S NULL(156)="Invalid Physician Name format."
29 ..I $$GET1^DIQ(2260,IEN,157)="" S NULL(157)=$$GET1^DID(2260,157,,"LABEL")
30 ..I $$GET1^DIQ(2260,IEN,158)="" S NULL(158)=$$GET1^DID(2260,158,,"LABEL")
31 ..I $$GET1^DIQ(2260,IEN,159)="" S NULL(159)=$$GET1^DID(2260,159,,"LABEL")
32 ..I $$GET1^DIQ(2260,IEN,160)="" S NULL(160)=$$GET1^DID(2260,160,,"LABEL")
33 ..I $$GET1^DIQ(2260,IEN,182)="" S NULL(182)=$$GET1^DID(2260,182,,"LABEL")
34 .; check witness data
35 .S WITN=$O(^OOPS(2260,IEN,"CA1W",0))
36 .I $G(WITN) D
37 ..S WITN0=$G(^OOPS(2260,IEN,"CA1W",WITN,0))
38 ..S WITN1=$G(^OOPS(2260,IEN,"CA1W",WITN,1))
39 ..I '$$NMCHK^OOPSUTL3($P(WITN0,U)) S NULL(125.01)="Invalid Witness Name format."
40 ..I $P(WITN0,U,2)="" S NULL(125.1)=$$GET1^DID(2260.0125,1,,"LABEL")
41 ..I $P(WITN0,U,3)="" S NULL(125.2)=$$GET1^DID(2260.0125,2,,"LABEL")
42 ..I $P(WITN0,U,4)="" S NULL(125.3)=$$GET1^DID(2260.0125,3,,"LABEL")
43 ..I $P(WITN0,U,5)="" S NULL(125.4)=$$GET1^DID(2260.0125,4,,"LABEL")
44 ..I $P(WITN0,U,6)="" S NULL(125.5)=$$GET1^DID(2260.0125,5,,"LABEL")
45 ..I $G(WITN1)="" S NULL(125.6)=$$GET1^DID(2260.0125,6,,"LABEL")
46 .I $$WP^OOPSUTL4(165)>528 S NULL(165)=" REASON FOR CONTROVERT COP exceeds 528 character limit set by DOL."
47 .I $$WP^OOPSUTL4(164)>528 S NULL(164)=" SUPERVISOR NOT AGREE EXPLAIN exceeds 528 character limit set by DOL."
48 I $$GET1^DIQ(2260,IEN,52,"I")=2 D
49 .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
50 ..I $$GET1^DIQ(2260,IEN,FLD)="" S NULL(FLD)=$$GET1^DID(2260,FLD,,"LABEL")
51 .I $P($G(^OOPS(2260,IEN,"CA2J")),U)'="" D
52 ..S NAM=$P(^OOPS(2260,IEN,"CA2J"),U) I '$$NMCHK^OOPSUTL3(NAM) S NULL(245)="Invalid Physician Name format."
53 ..I $$GET1^DIQ(2260,IEN,246)="" S NULL(246)=$$GET1^DID(2260,246,,"LABEL")
54 ..I $$GET1^DIQ(2260,IEN,247)="" S NULL(247)=$$GET1^DID(2260,247,,"LABEL")
55 ..I $$GET1^DIQ(2260,IEN,248)="" S NULL(248)=$$GET1^DID(2260,248,,"LABEL")
56 ..I $$GET1^DIQ(2260,IEN,249)="" S NULL(249)=$$GET1^DID(2260,249,,"LABEL")
57 ..I $$GET1^DIQ(2260,IEN,270)="" S NULL(270)=$$GET1^DID(2260,270,,"LABEL")
58 .I $$WP^OOPSUTL4(216)>528 S NULL(216)="RELATIONSHIP OF ILLNESS TO EMP exceeds 528 character limit set by DOL."
59 .I $$WP^OOPSUTL4(217)>264 S NULL(217)="NATURE OF DISEASE/ILLNESS exceededs 264 character limit set by DOL."
60 .I $$WP^OOPSUTL4(218)>528 S NULL(218)="CLAIM NOT FILED exceeds 528 character limit set by DOL."
61 .I $$WP^OOPSUTL4(219)>528 S NULL(219)="EMPLOYEE STATEMENT DELAYED exceeds 528 character limit set by DOL."
62 .I $$WP^OOPSUTL4(220)>528 S NULL(220)="MEDICAL REPORT DELAYED exceeds 528 character limit set by DOL."
63 .I $$WP^OOPSUTL4(257)>528 S NULL(257)="WORK DUTY CHANGED exceeds 528 character limit set by DOL."
64 ; if NULL is defined, invalid record
65 I $D(NULL) S VAL=""
66 K DISYS,DIW,DIW1,DIWT,DIWTC,DIWX,DN
67 Q VAL
68CONV(TOCON) ; CONVERT A RANGE (Ex. 1,2-4,7 to 1,2,3,4,5,7)
69 ; 'TOCON' must be passed as a literal (Ex. "1,2-4,7" not 1,2-4,7)
70 ;
71 ; Input: TOCON = Value to be converted
72 ; Output: CONV = Converted value
73 N CONV,FIRST,LAST,NUM,TEST,TEST2
74 S CONV=""
75 F TEST=1:1:$L(TOCON,",") D
76 .S NUM=$P(TOCON,",",TEST)
77 .I NUM'["-" S CONV=CONV_NUM_","
78 .I NUM["-" S FIRST=$P(NUM,"-") S LAST=$P(NUM,"-",2) D
79 ..F TEST2=FIRST:1:LAST S CONV=CONV_TEST2_","
80 ..Q
81 S CONV=$E(CONV,1,($L(CONV)-1))
82 Q CONV
Note: See TracBrowser for help on using the repository browser.