Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SCMSVZIR

SCMSVZIR.m

Go to the documentation of this file.
  1. SCMSVZIR ;ALB/ESD HL7 ZIR Segment Validation ;05/08/95
  1. ;;5.3;Scheduling;**44,55,66**;Aug 13, 1993
  1. ;
  1. ;
  1. EN(ZIRSEG,HLQ,HLFS,VALERR) ;
  1. ; Entry point to return the HL7 ZIR (Income Relation) validation segment
  1. ;
  1. ; Input: ZIRSEG - ZIR Segment
  1. ; HLQ - HL7 null variable
  1. ; HLFS - HL7 field separator
  1. ; VALERR - Array to put the errors in
  1. ;
  1. ; Output: 1 if ZIR passed validity check
  1. ; Error message if ZIR failed validity check in form of:
  1. ; -1^"xxx failed validity check" (xxx=element in ZIR segment)
  1. ;
  1. ;
  1. N I,MSG,X,SEG,CNT,DATA
  1. S MSG="-1^Element in ZIR segment failed validity check",SEG="ZIR",CNT=1
  1. S ZIRSEG=$G(ZIRSEG)
  1. D VALIDATE^SCMSVUT0(SEG,ZIRSEG,"0011",VALERR,.CNT)
  1. I $D(@VALERR@(SEG)) G ENQ
  1. ;
  1. ;- Convert HLQ to null
  1. S ZIRSEG=$$CONVERT^SCMSVUT0(ZIRSEG,HLFS,HLQ)
  1. ;
  1. ;- Validate data elements
  1. N DATA1
  1. F I=1,12,13,14,90 D I I=14,$G(@VALERR@(SEG,CNT-1))=8100 Q
  1. . S DATA=$P(ZIRSEG,HLFS,I)
  1. . D VALIDATE^SCMSVUT0(SEG,$S(I=90:DATA1,1:DATA),$P($T(@(I)),";",3),VALERR,.CNT)
  1. . I I=12 S $P(DATA1,U,1)=DATA
  1. . I I=14 S $P(DATA1,U,2)=DATA
  1. ;
  1. ENQ Q $S($D(@VALERR@(SEG)):MSG,1:1)
  1. ;
  1. ;
  1. ERR ;;Invalid or missing patient income data for encounter (HL7 ZIR segment)
  1. ;
  1. ;
  1. ;- ZIR data elements validated
  1. ;
  1. 1 ;;0035;HL7 SEGMENT NAME
  1. 12 ;;8050;NUMBER OF DEPENDENTS
  1. 13 ;;8150;PATIENT INCOME
  1. 14 ;;8100;MEANS TEST INDICATOR
  1. 90 ;;8070;Number of dependents inconstitentwith means test