source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCMSVZEL.m@ 1766

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1SCMSVZEL ;ALB/ESD HL7 ZEL Segment Validation ; 8/11/99 9:24am
2 ;;5.3;Scheduling;**44,66,142,184,180,222,239,325**;Aug 13, 1993
3 ;
4 ;
5EN(ZELSEG,HLQ,HLFS,VALERR,DFN) ;
6 ; Entry point to return the HL7 ZEL (Patient Eligibility) validation segment
7 ;
8 ; Input: .ZELSEG - ZEL Segment Array
9 ; HLQ - HL7 null variable
10 ; HLFS - HL7 field separator
11 ; VALERR - The array name to put the errors in
12 ; DFN - The DFN of the patient
13 ;
14 ; Output: 1 if ZEL passed validity check
15 ; Error message if ZEL failed validity check in form of:
16 ; -1^"xxx failed validity check" (xxx=element in ZEL segment)
17 ;
18 ;
19 N I,MSG,X,CNT,DATA,SEG,ELIG,VET,LP,MSTSTAT,MSTDATE,SEGLINE,NODE,OFFSET
20 N CVET
21 S SEG="ZEL",CNT=1
22 S MSG="-1^Element in ZEL segment failed validity check"
23 S ZELSEG(1)=$G(ZELSEG(1))
24 D VALIDATE^SCMSVUT0(SEG,ZELSEG(1),"0010",VALERR,.CNT)
25 I $D(@VALERR@(SEG)) G ENQ
26 ;
27 ;- Convert HLQ to null
28 S ZELSEG(1)=$$CONVERT^SCMSVUT0(ZELSEG(1),HLFS,HLQ)
29 S I=0
30 F S I=+$O(ZELSEG(1,I)) Q:'I S ZELSEG(1,I)=$$CONVERT^SCMSVUT0(ZELSEG(1,I),HLFS,HLQ)
31 ;
32 S OFFSET=0,NODE=0,SEGLINE=ZELSEG(1)
33 F I=1,3,9,19,20,23,24,25,30,38,39 DO
34 . I $L(SEGLINE,HLFS)<(I-OFFSET) D
35 . . ;Segment wrapped
36 . . S OFFSET=OFFSET+$L(SEGLINE,HLFS)-1
37 . . S NODE=+$O(ZELSEG(1,NODE))
38 . . I NODE=0 S SEGLINE="",NODE=+$O(ZELSEG(1,NODE),-1) Q
39 . . S SEGLINE=$G(ZELSEG(1,NODE))
40 . S DATA=$P(SEGLINE,HLFS,I-OFFSET)
41 . I I=3 S ELIG=DATA
42 . I I=9 S VET=DATA
43 . I I=24 S MSTSTAT=DATA
44 . I I=25 S MSTDATE=DATA,DATA=MSTSTAT_"^"_MSTDATE
45 . I I=38 S CVET=DATA
46 . I I=39 S DATA=CVET_"^"_DATA
47 . D VALIDATE^SCMSVUT0(SEG,DATA,$P($T(@(I)),";",3),VALERR,.CNT)
48 . Q
49 ;
50 S DATA=ELIG_"^"_VET
51 F LP=32,91 D VALIDATE^SCMSVUT0(SEG,$S(LP=32:ELIG,LP=91:VET,1:DATA),$P($T(@(LP)),";",3),VALERR,.CNT)
52 ;
53ENQ Q $S($D(@VALERR@(SEG)):MSG,1:1)
54 ;
55 ;
56 ;
57ERR ;;Invalid or missing patient eligibility data for encounter (HL7 ZEL segment)
58 ;
59 ;
60 ;- ZEL data elements validated
61 ;
621 ;;0035;HL7 SEGMENT NAME
633 ;;7000;ELIGIBILITY CODE MISSING
6431 ;;7020;ELIGIBILITY CODE INCONSISTENT WITH VET STATUS
6532 ;;7030;ELIGIBILITY CODE INACTIVE
669 ;;7050;VETERAN?
6791 ;;7100;VET STATUS INCONSISTENT WITH POW
6819 ;;7120;AGENT ORANGE EXPOSURE
6923 ;;7150;INVALID/INCONSISTENT RADIATION EXPOSURE METHOD
7020 ;;7210;RADIATION EXPOSURE INDICATED
7124 ;;7040;INVALID MST CLASSIFICATION
7225 ;;7060;MST STATUS DATE INVALID OR INCONSISTENT WITH MST STATUS
7330 ;;7130;AGENT ORANGE EXPOSURE LOCATION
7438 ;;7330;COMBAT VET INDICATOR
7539 ;;7340;COMBAT VET END DATE
Note: See TracBrowser for help on using the repository browser.