source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCMSVZIR.m@ 648

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

initial load of WorldVistAEHR

File size: 1.4 KB
RevLine 
[613]1SCMSVZIR ;ALB/ESD HL7 ZIR Segment Validation ;05/08/95
2 ;;5.3;Scheduling;**44,55,66**;Aug 13, 1993
3 ;
4 ;
5EN(ZIRSEG,HLQ,HLFS,VALERR) ;
6 ; Entry point to return the HL7 ZIR (Income Relation) validation segment
7 ;
8 ; Input: ZIRSEG - ZIR Segment
9 ; HLQ - HL7 null variable
10 ; HLFS - HL7 field separator
11 ; VALERR - Array to put the errors in
12 ;
13 ; Output: 1 if ZIR passed validity check
14 ; Error message if ZIR failed validity check in form of:
15 ; -1^"xxx failed validity check" (xxx=element in ZIR segment)
16 ;
17 ;
18 N I,MSG,X,SEG,CNT,DATA
19 S MSG="-1^Element in ZIR segment failed validity check",SEG="ZIR",CNT=1
20 S ZIRSEG=$G(ZIRSEG)
21 D VALIDATE^SCMSVUT0(SEG,ZIRSEG,"0011",VALERR,.CNT)
22 I $D(@VALERR@(SEG)) G ENQ
23 ;
24 ;- Convert HLQ to null
25 S ZIRSEG=$$CONVERT^SCMSVUT0(ZIRSEG,HLFS,HLQ)
26 ;
27 ;- Validate data elements
28 N DATA1
29 F I=1,12,13,14,90 D I I=14,$G(@VALERR@(SEG,CNT-1))=8100 Q
30 . S DATA=$P(ZIRSEG,HLFS,I)
31 . D VALIDATE^SCMSVUT0(SEG,$S(I=90:DATA1,1:DATA),$P($T(@(I)),";",3),VALERR,.CNT)
32 . I I=12 S $P(DATA1,U,1)=DATA
33 . I I=14 S $P(DATA1,U,2)=DATA
34 ;
35ENQ Q $S($D(@VALERR@(SEG)):MSG,1:1)
36 ;
37 ;
38ERR ;;Invalid or missing patient income data for encounter (HL7 ZIR segment)
39 ;
40 ;
41 ;- ZIR data elements validated
42 ;
431 ;;0035;HL7 SEGMENT NAME
4412 ;;8050;NUMBER OF DEPENDENTS
4513 ;;8150;PATIENT INCOME
4614 ;;8100;MEANS TEST INDICATOR
4790 ;;8070;Number of dependents inconstitentwith means test
Note: See TracBrowser for help on using the repository browser.