source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWDVAL.m@ 1141

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

revised back to 6/30/08 version

File size: 1.1 KB
Line 
1ORWDVAL ; SLC/KCM - Validate procedures
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
3 ;
4VALSCHED(ERR,SCHED) ; Validate a schedule
5 ; Set up 'interval^repeat count', if no interval assume QD
6 S ERR=0
7 S INTERVAL=$P(SCHED," ",1),REPEAT=$P(SCHED," ",2)
8 I '$O(^PS(51.1,"APLR",INTERVAL,0)) S ERR=1 Q
9 I '(X?1"X"1.N) S ERR=1 Q
10 Q
11STOPDT(ADATE,SCHED) ; Return stop date given a schedule
12 ; Look at max days continuous orders
13 ; set numdays to lesser of Xnn and LR MAX...
14 ; calculate stop date from collection time
15 Q
16EXPSCHED(LST,SCHED,START,STOP,MAX) ; procedure
17 ; Expand schedule into start/stop times
18 N IEN,TYP,INTERVAL,REPEAT
19 D VALSCHED I ERR S LST=""
20 S INTERVAL=$P(SCHED," ",1),REPEAT=$E($P(SCHED," ",2),2,999)
21 S IEN=$O(^PS(51.1,"APLR",INTERVAL,0))
22 S TYP=$P(^PS(51.1,IEN,0),U,5),FREQ=$P(^(0),U,3)
23 I TYP="C" D ; add interval until repeat count or stop time reached
24 . ;
25 I TYP="D" D ; from start time look for matching day of week & add
26 . ;
27 I TYP="O" D ; quit with just the start time
28 . ;
29 ; range, shift, dow-range ???
30 Q
31DATE ; Validate a date/time (allow visits)
32 Q
Note: See TracBrowser for help on using the repository browser.