source: FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMSVEVN.m@ 821

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1SCMSVEVN ;ALB/ESD HL7 EVN Segment Validation ;05/08/95
2 ;;5.3;Scheduling;**44,66**;Aug 13, 1993
3 ;
4 ;
5EN(EVNSEG,HLQ,HLFS,VALERR) ;
6 ; Entry point to return the HL7 EVN (Event Type) validation segment
7 ;
8 ; Input: EVNSEG - EVN Segment
9 ; HLQ - HL7 null variable
10 ; HLFS - HL7 field separator
11 ; VALERR - The array to place the errors in.
12 ;
13 ; Output: 1 if EVN passed validity check
14 ; Error message if EVN failed validity check in form of:
15 ; -1^"xxx failed validity check" (xxx=element in EVN segment)
16 ;
17 ; The array contained in VALERR will have the errors if any
18 ; are found. They will be subscripted by "EVN",# from this
19 ; validation subroutine.
20 ; Ex. ^TMP("TEST",$J,"EVN",1)=ERROR CODE
21 ; ^TMP("TEST",$J,"EVN",2)=ERROR CODE
22 ;
23 ;
24 N I,MSG,VALID,X,CNT,SEG
25 S CNT=1,MSG="-1^Element in EVN segment failed validity check"
26 S SEG="EVN"
27 ;
28 S EVNSEG=$G(EVNSEG)
29 D VALIDATE^SCMSVUT0(SEG,EVNSEG,"0005",VALERR,.CNT)
30 I $D(@VALERR@(SEG)) G ENQ
31 ;
32 S EVNSEG=$$CONVERT^SCMSVUT0(EVNSEG,HLFS,HLQ)
33 ;
34 F I=1:1:3 D VALIDATE^SCMSVUT0(SEG,$S(I'=3:$P(EVNSEG,HLFS,I),1:$$FMDATE^HLFNC($P(EVNSEG,HLFS,I))),$P($T(@I),";",3),VALERR,.CNT)
35 ;
36ENQ Q $S($D(@VALERR@("EVN",1)):MSG,1:1)
37 ;
38 ;
391 ;;0035;HL7 SEGMENT NAME
402 ;;1000;HL7 EVENT TYPE
413 ;;1050;HL7 EVENT DATE/TIME
Note: See TracBrowser for help on using the repository browser.