SCMSVEVN ;ALB/ESD HL7 EVN Segment Validation ;05/08/95
;;5.3;Scheduling;**44,66,1015**;Aug 13, 1993;Build 21
;
;
EN(EVNSEG,HLQ,HLFS,VALERR) ;
; Entry point to return the HL7 EVN (Event Type) validation segment
;
; Input: EVNSEG - EVN Segment
; HLQ - HL7 null variable
; HLFS - HL7 field separator
; VALERR - The array to place the errors in.
;
; Output: 1 if EVN passed validity check
; Error message if EVN failed validity check in form of:
; -1^"xxx failed validity check" (xxx=element in EVN segment)
;
; The array contained in VALERR will have the errors if any
; are found. They will be subscripted by "EVN",# from this
; validation subroutine.
; Ex. ^TMP("TEST",$J,"EVN",1)=ERROR CODE
; ^TMP("TEST",$J,"EVN",2)=ERROR CODE
;
;
N I,MSG,VALID,X,CNT,SEG
S CNT=1,MSG="-1^Element in EVN segment failed validity check"
S SEG="EVN"
;
S EVNSEG=$G(EVNSEG)
D VALIDATE^SCMSVUT0(SEG,EVNSEG,"0005",VALERR,.CNT)
I $D(@VALERR@(SEG)) G ENQ
;
S EVNSEG=$$CONVERT^SCMSVUT0(EVNSEG,HLFS,HLQ)
;
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)
;
ENQ Q $S($D(@VALERR@("EVN",1)):MSG,1:1)
;
;
1 ;;0035;HL7 SEGMENT NAME
2 ;;1000;HL7 EVENT TYPE
3 ;;1050;HL7 EVENT DATE/TIME
SCMSVEVN ;ALB/ESD HL7 EVN Segment Validation ;05/08/95
+1 ;;5.3;Scheduling;**44,66,1015**;Aug 13, 1993;Build 21
+2 ;
+3 ;
EN(EVNSEG,HLQ,HLFS,VALERR) ;
+1 ; Entry point to return the HL7 EVN (Event Type) validation segment
+2 ;
+3 ; Input: EVNSEG - EVN Segment
+4 ; HLQ - HL7 null variable
+5 ; HLFS - HL7 field separator
+6 ; VALERR - The array to place the errors in.
+7 ;
+8 ; Output: 1 if EVN passed validity check
+9 ; Error message if EVN failed validity check in form of:
+10 ; -1^"xxx failed validity check" (xxx=element in EVN segment)
+11 ;
+12 ; The array contained in VALERR will have the errors if any
+13 ; are found. They will be subscripted by "EVN",# from this
+14 ; validation subroutine.
+15 ; Ex. ^TMP("TEST",$J,"EVN",1)=ERROR CODE
+16 ; ^TMP("TEST",$J,"EVN",2)=ERROR CODE
+17 ;
+18 ;
+19 NEW I,MSG,VALID,X,CNT,SEG
+20 SET CNT=1
SET MSG="-1^Element in EVN segment failed validity check"
+21 SET SEG="EVN"
+22 ;
+23 SET EVNSEG=$GET(EVNSEG)
+24 DO VALIDATE^SCMSVUT0(SEG,EVNSEG,"0005",VALERR,.CNT)
+25 IF $DATA(@VALERR@(SEG))
GOTO ENQ
+26 ;
+27 SET EVNSEG=$$CONVERT^SCMSVUT0(EVNSEG,HLFS,HLQ)
+28 ;
+29 FOR I=1:1:3
DO VALIDATE^SCMSVUT0(SEG,$SELECT(I'=3:$PIECE(EVNSEG,HLFS,I),1:$$FMDATE^HLFNC($PIECE(EVNSEG,HLFS,I))),$PIECE($TEXT(@I),";",3),VALERR,.CNT)
+30 ;
ENQ QUIT $SELECT($DATA(@VALERR@("EVN",1)):MSG,1:1)
+1 ;
+2 ;
1 ;;0035;HL7 SEGMENT NAME
2 ;;1000;HL7 EVENT TYPE
3 ;;1050;HL7 EVENT DATE/TIME