source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOLOG.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1OCXOLOG ;SLC/RJS,CLA - MAINTAIN RAW DATA LOG ;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 ;
5NEW(OCXA,OCXS,OCXU,OCXP) ;
6 ;
7 ; OCXA - ARRAY NAME
8 ; OCXS - DATA SOURCE
9 ; OCXU - USER
10 ; OCXP - PATIENT
11 ;
12 I '$D(^OCXD(861,1,0)) S ^OCXD(861,1,0)="SITE PREFERENCES"
13 F S OCXI=$O(^OCXD(861,"A"),-1)+1 L +^OCXD(861,OCXI):0 I Q:'$D(^OCXD(861,OCXI)) L -^OCXD(861,OCXI)
14 ;
15 N OCXR,OCXTEMP,OCXD1,OCXD2
16 ;
17 S OCXDT=$$DATE_" "
18 S OCXR(0)=OCXDT
19 S OCXR("ARRAY")=OCXA
20 S OCXR("JOB")=$J
21 S:$L($G(OCXS)) OCXR("SOURCE")=$G(OCXS)
22 S OCXR("VERSION")=$P($T(+3),";;",3)
23 S OCXR("STATUS")="RUNNING"
24 S:$G(OCXU) OCXR("USER")="["_OCXU_"] "_$P($G(^VA(200,+OCXU,0)),U,1)
25 S:$G(OCXP) OCXR("PATIENT")="["_OCXP_"] "_$P($G(^DPT(+OCXP,0)),U,1)
26 ;
27 S OCXD1=0 F S OCXD1=$O(@OCXA@(OCXD1)) Q:'(OCXD1) D
28 .N OCXTXT
29 .S OCXTXT=@OCXA@(OCXD1)
30 .I ($L(OCXTXT)<200) S OCXR("DATA",$$LAST+1,0)=OCXTXT Q
31 .N OCXOVER,OCXOV0
32 .F Q:'$L(OCXTXT) D
33 ..S OCXR("DATA",$$LAST+1,0)=$E(OCXTXT,1,200)
34 ..S OCXTXT=$E(OCXTXT,201,$L(OCXTXT))
35 ..S:$L(OCXTXT) OCXTXT=">>>"_OCXTXT
36 ;
37 S:$O(OCXR("DATA",0)) OCXR("DATA",0)="^^"_$$LAST_"^"_$$LAST_"^"_$$TODAY
38 ;
39 M ^OCXD(861,OCXI)=OCXR
40 S ^OCXD(861,"B",OCXDT,OCXI)=""
41 S $P(^OCXD(861,0),"^",3)=$P(^OCXD(861,0),"^",3)+1
42 S $P(^OCXD(861,0),"^",4)=OCXI
43 ;
44 L -^OCXD(861,OCXI)
45 ;
46 W:$G(OCXTRACE) !,"OCX Logging message ",OCXS," # ",OCXI
47 ;
48 K OCXR,OCXTEMP,OCXD1,OCXD2
49 ;
50 Q OCXI
51 ;
52FINISH(OCXL) ;
53 ;
54 I $G(OCXL),$D(^OCXD(861,OCXL,0)) S ^OCXD(861,OCXL,"STATUS")="FINISHED NORMALLY AT "_$$DATE
55 Q
56 ;
57LAST() Q $O(OCXR("DATA",""),-1)
58 ;
59CLEAR N OCXX S OCXX=$P(^OCXD(861,0),U,1,2) K ^OCXD(861) S ^OCXD(861,0)=OCXX Q
60 ;
61DATE() N X,Y,%DT S X="N",%DT="ST" D ^%DT Q ((Y\1)+17000000)_"."_$E(1000000+((Y#1)*1000000),2,7)
62 ;
63TODAY() N X,Y,%DT S X="T",%DT="" D ^%DT Q Y
64 ;
65CONV(Y) Q:'(Y["@") Y Q $P(Y,"@",1)_" at "_$P(Y,"@",2,99)
66 ;
67PURGE ; Use this for an emergency purge of the raw data
68 ; log in case of <diskfull> errors
69 N OCXX S OCXX=$P($G(^OCXD(861,0)),"^",1,2) Q:'$L(OCXX)
70 K ^OCXD(861) S ^OCXD(861,0)=OCXX
71 Q
72 ;
Note: See TracBrowser for help on using the repository browser.