source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOTIME.m@ 1046

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1OCXOTIME ;SLC/RJS,CLA - PROCESS TIME BASED EVENT ;10/29/98 12:37
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5 ;
6 Q
7EN ;
8 ;
9 Q:'$$RTEST
10 ;
11 N OCXDATE,OCXDFN,OCXELEM,OCXRULE
12 S OCXRULE=0 F S OCXRULE=$O(^OCXD(860.1,"TIME",OCXRULE)) Q:'OCXRULE D
13 .S OCXDFN=0 F S OCXDFN=$O(^OCXD(860.1,"TIME",OCXRULE,OCXDFN)) Q:'OCXDFN D
14 ..S OCXDATE=0 F S OCXDATE=$O(^OCXD(860.1,"TIME",OCXRULE,OCXDFN,OCXDATE)) Q:'OCXDATE I '((+OCXDATE)>OCXNOW) D
15 ...N DFN,OCXOSRC,OUTMSG,OCXNOTIF,OCXELEM
16 ...S OCXOSRC="TIMED ORDER CHECK",(OUTMSG,OCXNOTIF)=""
17 ...S OCXORMTR="ORMTIME: Executing D UPDATE^OCXOZ01 DATE: "_OCXDATE
18 ...D LOG(" "_OCXORMTR)
19 ...S OCXORMTR=" RULE: "_(+OCXRULE)_" ("_$P($G(^OCXS(860.2,+OCXRULE,0)),U,1)
20 ...D LOG(" "_OCXORMTR)
21 ...S OCXORMTR=" Patient: "_OCXDFN_" ("_$P($G(^DPT(OCXDFN,0)),U,1)_")"
22 ...D LOG(" "_OCXORMTR)
23 ...S OCXELEM=0 F S OCXELEM=$O(^OCXS(860.2,OCXRULE,"C","C",OCXELEM)) Q:'OCXELEM D
24 ....S:($P($G(^OCXS(860.6,+$P($G(^OCXS(860.3,+OCXELEM,0)),U,2),0)),U,1)="TIMED ORDER CHECK") OCXOSRC("ELEMENT",OCXELEM)=""
25 ...K ^OCXD(860.1,"TIME",OCXRULE,OCXDFN,OCXDATE)
26 ...K ^OCXD(860.1,OCXDFN,2,OCXDATE,1,OCXRULE)
27 ...K ^OCXD(860.1,OCXDFN,2,OCXDATE,1,"B",OCXRULE,OCXRULE)
28 ...I '$O(^OCXD(860.1,OCXDFN,2,0)) K ^OCXD(860.1,OCXDFN,2)
29 ...D LOGOCX("TIMEOC")
30 ...D UPDATE^OCXOZ01(OCXDFN,OCXOSRC,.OUTMSG)
31 ;
32 Q
33 ;
34LOG(TEXT) ;
35 ;
36 Q
37 ;
38LOGOCX(OCXSRC) ;
39 ; Log Messages
40 Q
41ERROR Q
42 ;
43ACT(OCXDATE,OCXORD) Q:'$$RTEST D CHECK("ACT") Q
44 ;
45EXP(OCXDATE,OCXORD) Q:'$$RTEST D CHECK("EXP") Q
46 ;
47CHECK(OCXMODE) ;
48 ;
49 S OCXDATA("MODE")=OCXMODE
50 Q
51 ;
52RTEST() ;
53 N DATE,TMOUT
54 Q:'$L($T(^OCXOZ01)) 1
55 I '($P($G(^OCXD(861,1,0)),U,1)="SITE PREFERENCES") K ^OCXD(861,1) S ^OCXD(861,1,0)="SITE PREFERENCES"
56 S DATE=$P($G(^OCXD(861,1,0)),U,3)
57 I DATE,((+DATE)=(+$H)),(((+$P($H,",",2))-(+$P(DATE,",",2)))<1800) Q 1
58 Q 0
59 ;
Note: See TracBrowser for help on using the repository browser.