1 | SCMSVZCL ;ALB/ESD HL7 ZCL Segment Validation ; 11/9/99 2:28pm
|
---|
2 | ;;5.3;Scheduling;**44,66,180,239**;Aug 13, 1993
|
---|
3 | ;
|
---|
4 | ;
|
---|
5 | EN(ZCLARRY,HLQ,HLFS,VALERR,DFN) ;
|
---|
6 | ; Entry point to return the HL7 ZCL (Outpatient Classification) validation segment
|
---|
7 | ;
|
---|
8 | ; Input: ZCLARRY - Array of ZCL Segments
|
---|
9 | ; HLQ - HL7 null variable
|
---|
10 | ; HLFS - HL7 field separator
|
---|
11 | ; VALERR - Array to put the errors in
|
---|
12 | ; DFN - The patient's DFN
|
---|
13 | ;
|
---|
14 | ;
|
---|
15 | ; Output: 1 if ZCL passed validity check
|
---|
16 | ; Error message if ZCL failed validity check in form of:
|
---|
17 | ; -1^"xxx failed validity check" (xxx=element in ZCL segment)
|
---|
18 | ;
|
---|
19 | ;
|
---|
20 | N I,J,MSG,VALID,X,Z,ZCLSEG,SEG,CNT,DATA,SCSETID,VAR,SCCLASS,VALUE,TYPE
|
---|
21 | S VALID=1,MSG="-1^Element in ZCL segment failed validity check"
|
---|
22 | S I=0,J="",ZCLARRY=$G(ZCLARRY),SEG="ZCL",(SCSETID,CNT)=1
|
---|
23 | S:(ZCLARRY="") ZCLARRY="^TMP(""VAFHL"",$J,""CLASS"")"
|
---|
24 | ;
|
---|
25 | ;- Validate classification fields
|
---|
26 | F S I=+$O(@ZCLARRY@(I)) Q:'I F S J=$O(@ZCLARRY@(I,J)) Q:J="" D
|
---|
27 | . S VALID=1
|
---|
28 | . S ZCLSEG=$G(@ZCLARRY@(I,J))
|
---|
29 | . S ZCLSEG=$$CONVERT^SCMSVUT0(ZCLSEG,HLFS,HLQ)
|
---|
30 | . D VALIDATE^SCMSVUT0(SEG,ZCLSEG,"0012",VALERR,.CNT)
|
---|
31 | . I $G(@VALERR@(SEG,CNT-1))="0012" Q
|
---|
32 | . S TYPE=$P(ZCLSEG,HLFS,3)
|
---|
33 | . F Z=1,2,3,32,4,41 DO
|
---|
34 | .. S DATA=$P(ZCLSEG,HLFS,$E(Z,1,1))
|
---|
35 | .. ;
|
---|
36 | .. ;MST check for type 5 encounter 1
|
---|
37 | .. I (Z=32),DATA'=5 Q
|
---|
38 | .. I (Z=32),DATA=5 S VALUE=$P(ZCLSEG,HLFS,4) Q:VALUE'=1
|
---|
39 | .. ;
|
---|
40 | .. D VALIDATE^SCMSVUT0(SEG,DATA,$P($T(@(Z)),";",3),VALERR,.CNT)
|
---|
41 | .. K VALUE
|
---|
42 | .. Q
|
---|
43 | . Q
|
---|
44 | ;
|
---|
45 | I '$D(VALID) D VALIDATE^SCMSVUT0(SEG,"","0012",VALERR,.CNT)
|
---|
46 | ;
|
---|
47 | ENQ Q $S($D(@VALERR@(SEG)):MSG,1:1)
|
---|
48 | ;
|
---|
49 | ;
|
---|
50 | ;- ZCL data elements validated
|
---|
51 | ;
|
---|
52 | 1 ;;0035;HL7 SEGMENT NAME
|
---|
53 | 2 ;;9150;HL7 SEQUENTIAL NUMBER (SET ID)
|
---|
54 | 3 ;;9000;CLASSIFICATION TYPE
|
---|
55 | 32 ;;9030;MST status inconsistent with classification type
|
---|
56 | 4 ;;9050;Answer to classification questions missing
|
---|
57 | 41 ;;9020;Veteran status inconsistent with classification type
|
---|