source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXSEND3.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: 2.8 KB
Line 
1OCXSEND3 ;SLC/RJS,CLA - BUILD RULE TRANSPORTER ROUTINES (Build Routines) ;1/31/01 08:51
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,74,96,105,243**;Dec 17,1997;Build 242
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5EN() ;
6 ;
7 N LAST,RLINE,RNUM,RTEXT,TOTLINE
8 K ^TMP("OCXSEND",$J,"RTN") S ^TMP("OCXSEND",$J,"RTN",100,0)=" ;"
9 S (TOTLINE,RSIZE,RLINE,RCNT)=0,RNUM=1 F S RLINE=$O(^TMP("OCXSEND",$J,"DATA",RLINE)) Q:'RLINE D
10 .S RTEXT=$G(^TMP("OCXSEND",$J,"DATA",RLINE)) Q:'$L(RTEXT)
11 .S LAST=$O(^TMP("OCXSEND",$J,"RTN",""),-1)+1,RCNT=RCNT+1,RSIZE=RSIZE+$L(RTEXT)
12 .S ^TMP("OCXSEND",$J,"RTN",LAST,0)=" ;;"_RTEXT
13 .I (RSIZE>6000) S TOTLINE=TOTLINE+$$RFILE($O(^TMP("OCXSEND",$J,"DATA",RLINE)),.RNUM) S (RSIZE,RCNT)=0
14 I $O(^TMP("OCXSEND",$J,"RTN",100)) S TOTLINE=TOTLINE+$$RFILE(0,.RNUM)
15 ;
16 Q TOTLINE
17 ;
18RFILE(LINK,RNUM) ;
19 ;
20 N DIE,LAST,X,XCN
21 D HDR(LINK,RNUM)
22 S LAST=$O(^TMP("OCXSEND",$J,"RTN",""),-1)+1
23 S ^TMP("OCXSEND",$J,"RTN",LAST,0)=" ;1;"
24 S ^TMP("OCXSEND",$J,"RTN",LAST+1,0)=" ;"
25 S ^TMP("OCXSEND",$J,"RTN",LAST+2,0)="$"
26 S DIE="^TMP(""OCXSEND"","_$J_",""RTN"",",XCN=0
27 S X=$$RNAME(RNUM,2)
28 W !,X
29 X ^%ZOSF("SAVE")
30 S RNUM=RNUM+1
31 K ^TMP("OCXSEND",$J,"RTN") S ^TMP("OCXSEND",$J,"RTN",100,0)=" ;"
32 Q ""
33 ;
34NOW() ;
35 N X,Y,%DT
36 S X="N",%DT="T" D ^%DT S Y=$$DATE^OCXSENDD(Y)
37 I (Y["@") S Y=$P(Y,"@",1)_" at "_$P(Y,"@",2)
38 Q Y
39 ;
40HDR(LINK,RNUM) ;
41 ;
42 N R,LINE,TEXT,RNAME,RLINK,NOW
43 S NOW=$$NOW
44 I 'LINK S RLINK=";"
45 E S RLINK="G ^"_$$RNAME(RNUM+1,2)
46 S RNAME=$$RNAME(RNUM,2),(HEADER1,HEADER2,HEADER3,HEADER4,HEADER5)=";"
47 ;
48 F LINE=1:1:999 S TEXT=$P($T(TEXT+LINE),";",2,999) Q:TEXT S TEXT=$P(TEXT,";",2,999) S R(LINE,0)=$$CONV(TEXT)
49 ;
50 M ^TMP("OCXSEND",$J,"RTN")=R
51 ;
52 Q
53 ;
54HEX(X) Q:'X "" Q $$HEX(X\36)_$E("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",((X#36)+1))
55 ;
56RNAME(X,Y) ;
57 ; Y=0 -> Main Routine
58 ; Y=1 -> Runtime Library Routine
59 ; Y=2 -> Data Routine for ORYppp
60 ; Y=3 -> Data Routine for OCXRU
61 ;
62 N OCXRN1,OCXRN2,OCXSEQ
63 ;
64 S OCXRN1="OCXRULE",OCXRN2="OCXRU"
65 S:$L($G(OCXPATCH)) OCXRN2="ORY"_$E((1000+$P(OCXPATCH,"*",3)),2,4),OCXRN1=OCXRN2_"ES"
66 ;
67 Q:'Y OCXRN1
68 ;
69 I (Y=1),(X>35) Q ""
70 I (Y=2),'$L($G(OCXPATCH)) S Y=3
71 I (Y=2),(X>1295) Q ""
72 I (Y=3),(X>46655) Q ""
73 ;
74 S OCXSEQ=0 S:X OCXSEQ=$$HEX(X)
75 S OCXSEQ="00000"_OCXSEQ
76 S OCXSEQ=$E(OCXSEQ,($L(OCXSEQ)-Y+1),$L(OCXSEQ))
77 ;
78 Q OCXRN2_OCXSEQ
79 ;
80CONV(X) ;
81 N VAL
82 F Q:'(X["|") D
83 .S VAL=$P(X,"|",2)
84 .X "S VAL="_VAL
85 .S X=$P(X,"|",1)_VAL_$P(X,"|",3,999)
86 I '(X="$"),'$L($P(X," ",2)) S X=X_" ;"
87 Q X
88 ;
89TEXT ;
90 ;;|RNAME| ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE |OCXPATCH| ;|NOW|
91 ;;|OCXLIN2|
92 ;;|OCXLIN3|
93 ;; ;
94 ;;S ;
95 ;; ;
96 ;; D DOT^|$$RNAME^OCXSEND3(0,0)|
97 ;; ;
98 ;; ;
99 ;; K REMOTE,LOCAL,OPCODE,REF
100 ;; F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
101 ;; .S ^TMP("OCXRULE",$J,$O(^TMP("OCXRULE",$J,"A"),-1)+1)=TEXT
102 ;; ;
103 ;; |RLINK|
104 ;; ;
105 ;; Q
106 ;; ;
107 ;;DATA ;
108 ;1;
109 ;
Note: See TracBrowser for help on using the repository browser.