source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXSEND3.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: 2.8 KB
RevLine 
[623]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**;Dec 17,1997
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,XCM
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 W " ... ",XCM," Lines filed"
31 S RNUM=RNUM+1
32 K ^TMP("OCXSEND",$J,"RTN") S ^TMP("OCXSEND",$J,"RTN",100,0)=" ;"
33 Q XCM
34 ;
35NOW() ;
36 N X,Y,%DT
37 S X="N",%DT="T" D ^%DT S Y=$$DATE^OCXSENDD(Y)
38 I (Y["@") S Y=$P(Y,"@",1)_" at "_$P(Y,"@",2)
39 Q Y
40 ;
41HDR(LINK,RNUM) ;
42 ;
43 N R,LINE,TEXT,RNAME,RLINK,NOW
44 S NOW=$$NOW
45 I 'LINK S RLINK=";"
46 E S RLINK="G ^"_$$RNAME(RNUM+1,2)
47 S RNAME=$$RNAME(RNUM,2),(HEADER1,HEADER2,HEADER3,HEADER4,HEADER5)=";"
48 ;
49 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)
50 ;
51 M ^TMP("OCXSEND",$J,"RTN")=R
52 ;
53 Q
54 ;
55HEX(X) Q:'X "" Q $$HEX(X\36)_$E("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",((X#36)+1))
56 ;
57RNAME(X,Y) ;
58 ; Y=0 -> Main Routine
59 ; Y=1 -> Runtime Library Routine
60 ; Y=2 -> Data Routine for ORYppp
61 ; Y=3 -> Data Routine for OCXRU
62 ;
63 N OCXRN1,OCXRN2,OCXSEQ
64 ;
65 S OCXRN1="OCXRULE",OCXRN2="OCXRU"
66 S:$L($G(OCXPATCH)) OCXRN2="ORY"_$E((1000+$P(OCXPATCH,"*",3)),2,4),OCXRN1=OCXRN2_"ES"
67 ;
68 Q:'Y OCXRN1
69 ;
70 I (Y=1),(X>35) Q ""
71 I (Y=2),'$L($G(OCXPATCH)) S Y=3
72 I (Y=2),(X>1295) Q ""
73 I (Y=3),(X>46655) Q ""
74 ;
75 S OCXSEQ=0 S:X OCXSEQ=$$HEX(X)
76 S OCXSEQ="00000"_OCXSEQ
77 S OCXSEQ=$E(OCXSEQ,($L(OCXSEQ)-Y+1),$L(OCXSEQ))
78 ;
79 Q OCXRN2_OCXSEQ
80 ;
81CONV(X) ;
82 N VAL
83 F Q:'(X["|") D
84 .S VAL=$P(X,"|",2)
85 .X "S VAL="_VAL
86 .S X=$P(X,"|",1)_VAL_$P(X,"|",3,999)
87 I '(X="$"),'$L($P(X," ",2)) S X=X_" ;"
88 Q X
89 ;
90TEXT ;
91 ;;|RNAME| ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE |OCXPATCH| ;|NOW|
92 ;;|OCXLIN2|
93 ;;|OCXLIN3|
94 ;; ;
95 ;;S ;
96 ;; ;
97 ;; D DOT^|$$RNAME^OCXSEND3(0,0)|
98 ;; ;
99 ;; ;
100 ;; K REMOTE,LOCAL,OPCODE,REF
101 ;; F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
102 ;; .S ^TMP("OCXRULE",$J,$O(^TMP("OCXRULE",$J,"A"),-1)+1)=TEXT
103 ;; ;
104 ;; |RLINK|
105 ;; ;
106 ;; Q
107 ;; ;
108 ;;DATA ;
109 ;1;
110 ;
Note: See TracBrowser for help on using the repository browser.