source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQDBIH2.m@ 619

Last change on this file since 619 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 880 bytes
Line 
1VAQDBIH2 ;JRP/ALB - GET INFO ABOUT HEALTH SUMMARY COMPONENT;09-SEP-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3VALOCC(LIMIT,TYPEOCC) ;VALIDATE TIME LIMIT
4 ;INPUT : LIMIT - Limit value to check for validity
5 ; TYPEOCC - Flag indicating which limit to validate against
6 ; 0 = Time limit (default)
7 ; 1 = Occurrence limit
8 ;OUTPUT : 0 - Limit is valid
9 ; -1 - Limit is not valid or error
10 ;NOTES : Time limits are 1-5 numerics followed be 'D' or 'M' or 'Y'
11 ; : Occurrence limits are 1-5 numerics
12 ;
13 ;CHECK INPUT
14 Q:($G(LIMIT)="") -1
15 S TYPEOCC=+$G(TYPEOCC)
16 ;DECLARE VARIABLES
17 N ANS,TMP
18 ;VALIDATE TIME LIMIT
19 I ('TYPEOCC) D Q ANS
20 .S ANS=-1
21 .S TMP=$E(LIMIT,1,($L(LIMIT)-1))
22 .Q:(TMP'?1.5N)
23 .S TMP=$E(LIMIT,$L(LIMIT))
24 .I ((TMP="D")!(TMP="M")!(TMP="Y")) S ANS=0 Q
25 ;VALIDATE OCCURRENCE LIMIT
26 Q:(LIMIT?1.5N) 0
27 Q -1
Note: See TracBrowser for help on using the repository browser.