1 | SCMSVZSP ;ALB/ESD HL7 ZSP Segment Validation ;05/08/95
|
---|
2 | ;;5.3;Scheduling;**44,66**;Aug 13, 1993
|
---|
3 | ;
|
---|
4 | ;
|
---|
5 | EN(ZSPSEG,HLQ,HLFS,VALERR,DFN) ;
|
---|
6 | ; Entry point to return the HL7 ZSP (Service Period) validation segment
|
---|
7 | ;
|
---|
8 | ; Input: ZSPSEG - ZSP Segment
|
---|
9 | ; HLQ - HL7 null variable
|
---|
10 | ; HLFS - HL7 field separator
|
---|
11 | ; VALERR - The array to put errors in
|
---|
12 | ; DFN - The paitent file DFN
|
---|
13 | ;
|
---|
14 | ; Output: 1 if ZSP passed validity check
|
---|
15 | ; Error message if ZSP failed validity check in form of:
|
---|
16 | ; -1^"xxx failed validity check" (xxx=element in ZSP segment)
|
---|
17 | ;
|
---|
18 | ;
|
---|
19 | N I,MSG,X,DATA,CNT,SEG
|
---|
20 | S MSG="-1^Element in ZSP segment failed validity check"
|
---|
21 | S ZSPSEG=$G(ZSPSEG),CNT=1,SEG="ZSP"
|
---|
22 | D VALIDATE^SCMSVUT0(SEG,ZSPSEG,"0014",VALERR,.CNT)
|
---|
23 | I $D(@VALERR@(SEG)) G ENQ
|
---|
24 | ;
|
---|
25 | ;- Convert HLQ to null
|
---|
26 | S ZSPSEG=$$CONVERT^SCMSVUT0(ZSPSEG,HLFS,HLQ)
|
---|
27 | ;
|
---|
28 | ;- Validate data elements
|
---|
29 | F I=1,3,4,5,51,6,61 D
|
---|
30 | . S DATA=$P(ZSPSEG,HLFS,+$E(I,1,1))
|
---|
31 | . D VALIDATE^SCMSVUT0(SEG,DATA,$P($T(@(I)),";",3),VALERR,.CNT)
|
---|
32 | . Q
|
---|
33 | ;
|
---|
34 | ENQ Q $S($D(@VALERR@(SEG)):MSG,1:1)
|
---|
35 | ;
|
---|
36 | ;
|
---|
37 | ERR ;;Invalid or missing patient service period data for encounter (HL7 ZSP segment)
|
---|
38 | ;
|
---|
39 | ;- ZSP data elements validated
|
---|
40 | ;
|
---|
41 | 1 ;;0035;HL7 SEGMENT NAME
|
---|
42 | 3 ;;B000;Service connected
|
---|
43 | 4 ;;B050;SERVICE CONNECTED PERCENTAGE
|
---|
44 | 5 ;;B100;PERIOD OF SERVICE CODE
|
---|
45 | 51 ;;B120;Period of Serivce (active)
|
---|
46 | 6 ;;B150;VIETNAM SERVICE INDICATED?
|
---|
47 | 61 ;;B170;Vietnam serive indicated incon. vet status
|
---|