SCMSVZSP ;ALB/ESD HL7 ZSP Segment Validation ;05/08/95
;;5.3;Scheduling;**44,66**;Aug 13, 1993
;
;
EN(ZSPSEG,HLQ,HLFS,VALERR,DFN) ;
; Entry point to return the HL7 ZSP (Service Period) validation segment
;
; Input: ZSPSEG - ZSP Segment
; HLQ - HL7 null variable
; HLFS - HL7 field separator
; VALERR - The array to put errors in
; DFN - The paitent file DFN
;
; Output: 1 if ZSP passed validity check
; Error message if ZSP failed validity check in form of:
; -1^"xxx failed validity check" (xxx=element in ZSP segment)
;
;
N I,MSG,X,DATA,CNT,SEG
S MSG="-1^Element in ZSP segment failed validity check"
S ZSPSEG=$G(ZSPSEG),CNT=1,SEG="ZSP"
D VALIDATE^SCMSVUT0(SEG,ZSPSEG,"0014",VALERR,.CNT)
I $D(@VALERR@(SEG)) G ENQ
;
;- Convert HLQ to null
S ZSPSEG=$$CONVERT^SCMSVUT0(ZSPSEG,HLFS,HLQ)
;
;- Validate data elements
F I=1,3,4,5,51,6,61 D
. S DATA=$P(ZSPSEG,HLFS,+$E(I,1,1))
. D VALIDATE^SCMSVUT0(SEG,DATA,$P($T(@(I)),";",3),VALERR,.CNT)
. Q
;
ENQ Q $S($D(@VALERR@(SEG)):MSG,1:1)
;
;
ERR ;;Invalid or missing patient service period data for encounter (HL7 ZSP segment)
;
;- ZSP data elements validated
;
1 ;;0035;HL7 SEGMENT NAME
3 ;;B000;Service connected
4 ;;B050;SERVICE CONNECTED PERCENTAGE
5 ;;B100;PERIOD OF SERVICE CODE
51 ;;B120;Period of Serivce (active)
6 ;;B150;VIETNAM SERVICE INDICATED?
61 ;;B170;Vietnam serive indicated incon. vet status
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCMSVZSP 1500 printed Dec 13, 2024@02:42:18 Page 2
SCMSVZSP ;ALB/ESD HL7 ZSP Segment Validation ;05/08/95
+1 ;;5.3;Scheduling;**44,66**;Aug 13, 1993
+2 ;
+3 ;
EN(ZSPSEG,HLQ,HLFS,VALERR,DFN) ;
+1 ; Entry point to return the HL7 ZSP (Service Period) validation segment
+2 ;
+3 ; Input: ZSPSEG - ZSP Segment
+4 ; HLQ - HL7 null variable
+5 ; HLFS - HL7 field separator
+6 ; VALERR - The array to put errors in
+7 ; DFN - The paitent file DFN
+8 ;
+9 ; Output: 1 if ZSP passed validity check
+10 ; Error message if ZSP failed validity check in form of:
+11 ; -1^"xxx failed validity check" (xxx=element in ZSP segment)
+12 ;
+13 ;
+14 NEW I,MSG,X,DATA,CNT,SEG
+15 SET MSG="-1^Element in ZSP segment failed validity check"
+16 SET ZSPSEG=$GET(ZSPSEG)
SET CNT=1
SET SEG="ZSP"
+17 DO VALIDATE^SCMSVUT0(SEG,ZSPSEG,"0014",VALERR,.CNT)
+18 IF $DATA(@VALERR@(SEG))
GOTO ENQ
+19 ;
+20 ;- Convert HLQ to null
+21 SET ZSPSEG=$$CONVERT^SCMSVUT0(ZSPSEG,HLFS,HLQ)
+22 ;
+23 ;- Validate data elements
+24 FOR I=1,3,4,5,51,6,61
Begin DoDot:1
+25 SET DATA=$PIECE(ZSPSEG,HLFS,+$EXTRACT(I,1,1))
+26 DO VALIDATE^SCMSVUT0(SEG,DATA,$PIECE($TEXT(@(I)),";",3),VALERR,.CNT)
+27 QUIT
End DoDot:1
+28 ;
ENQ QUIT $SELECT($DATA(@VALERR@(SEG)):MSG,1:1)
+1 ;
+2 ;
ERR ;;Invalid or missing patient service period data for encounter (HL7 ZSP segment)
+1 ;
+2 ;- ZSP data elements validated
+3 ;
1 ;;0035;HL7 SEGMENT NAME
3 ;;B000;Service connected
4 ;;B050;SERVICE CONNECTED PERCENTAGE
5 ;;B100;PERIOD OF SERVICE CODE
51 ;;B120;Period of Serivce (active)
6 ;;B150;VIETNAM SERVICE INDICATED?
61 ;;B170;Vietnam serive indicated incon. vet status