source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXSEND2.m@ 738

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1OCXSEND2 ;SLC/RJS,CLA - BUILD RULE TRANSPORTER ROUTINES (File Data) ;3/21/00 07:48
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,74,105**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5S ;
6 ;
7 ;
8 N FILE,REC,DD,RECNAME,FNAME
9 ;
10 S FILE=0 F S FILE=$O(^OCXS(FILE)) Q:'FILE D
11 .S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="ROOT^OCXS("_(+FILE)_",0)^"_$P(^OCXS(FILE,0),U,1,2)
12 S FILE=0 F S FILE=$O(^OCXD(FILE)) Q:'FILE D
13 .S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="ROOT^OCXD("_(+FILE)_",0)^"_$P(^OCXD(FILE,0),U,1,2)
14 ;
15 F FILE=38,41,40,37,39,36,35,34,32,31,33,30,9,8,6,5,4,3,2 D
16 .S FILE=FILE/10+860
17 .S FNAME=$P(^OCXS(FILE,0),U,1) Q:'$L(FNAME)
18 .Q:'($O(^TMP("OCXSEND",$J,"LIST",FILE,0)))
19 .S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="SOF^"_(+$P(^OCXS(FILE,0),U,2))_" "_$P(^OCXS(FILE,0),U,1)
20 .W !!,"File: ",+FILE," ",FNAME
21 .S RECNAME="" F S RECNAME=$O(^TMP("OCXSEND",$J,"LIST",FILE,"B",RECNAME)) Q:'$L(RECNAME) D
22 ..S REC=0 F S REC=$O(^TMP("OCXSEND",$J,"LIST",FILE,"B",RECNAME,REC)) Q:'REC D
23 ...N REM,ARRAY,DD
24 ...S:(FNAME["ORDER CHECK ") FNAME=$P(FNAME,"ORDER CHECK ",2)
25 ...S:(FNAME["OCX MDD ") FNAME=$P(FNAME,"OCX MDD ",2)
26 ...W !,FILE," ",FNAME,": ",$J(REC,3)," ",$P(^OCXS(FILE,REC,0),U,1)," "
27 ...I (FILE=2),$G(^OCXS(860.2,REC,"INACT")) W !,?10,"*** Inactive rule skipped. ***" Q
28 ...D GETREC("^OCXS("_FILE_",","REM(",REC,.REM)
29 ...S DD=$O(REM(0))
30 ...S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="KEY"_U_DD_U_REM(DD,.01,"E")
31 ...S ARRAY="REM(0)" F S ARRAY=$Q(@ARRAY) Q:'$L(ARRAY) Q:'($E(ARRAY,1,4)="REM(") I $L(@ARRAY) D
32 ....S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="R"_U_$P($P(ARRAY,"(",2),")",1)
33 ....S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="D"_U_(@ARRAY)
34 ...S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="EOR^"
35 .S ^TMP("OCXSEND",$J,"DATA",$$NEXT)="EOF^OCXS("_FILE_")^1"
36 ;
37 Q
38 ;
39NEXT() Q $O(^TMP("OCXSEND",$J,"DATA",""),-1)+1
40 ;
41GETREC(GL,PATH,D0,REM) ;
42 ;
43 Q:'($P($G(@(GL_"0)")),U,2))
44 N S1,DATA,DD
45 S DATA="" D DIQ(GL,D0,.DATA)
46 S DD=$O(DATA(0)) Q:'DD Q:$$WPFLD(DD)
47 ;
48 I $L($$FILE^OCXSENDD(DD,"NAME")) S PATH=PATH_""""_DD_":""" I 1
49 E I (DD["860.41") S PATH=PATH_","""_DD_":"_$G(DATA(DD,D0,.01,"E"))_U_"860.6"""
50 E S PATH=PATH_","""_DD_":"_D0_""""
51 M @(PATH_")")=DATA(DD,D0)
52 ;
53 S S1="" F S S1=$O(@(GL_D0_","_$$SUB(S1)_")")) Q:'$L(S1) I ($D(@(GL_D0_","_$$SUB(S1)_")"))>3) D
54 .N D1,GLREF S GLREF=GL_D0_","_$$SUB(S1)_","
55 .S D1=0 F S D1=$O(@(GLREF_D1_")")) Q:'D1 D GETREC(GLREF,PATH,D1,.REM)
56 ;
57 Q
58 ;
59SUB(X) Q:'(X=+X) """"_X_"""" Q X
60 ;
61DIQ(DIC,DA,OCXARY) ;
62 N DR,DIQ,DD,D0,FLD
63 S DR=".01:99999",DIQ="OCXARY(",DIQ(0)="IEN" D EN^DIQ1
64 ;
65 S DD=0 F S DD=$O(OCXARY(DD)) Q:'DD D
66 .S D0=0 F S D0=$O(OCXARY(DD,D0)) Q:'D0 D
67 ..S FLD=0 F S FLD=$O(OCXARY(DD,D0,FLD)) Q:'FLD D
68 ...I $L($$FIELD^OCXSENDD(DD,FLD,"POINTER")),$L($G(OCXARY(DD,D0,FLD,"E"))),$L($G(OCXARY(DD,D0,FLD,"I"))),(OCXARY(DD,D0,FLD,"E")=OCXARY(DD,D0,FLD,"I")) D Q
69 ....N OCXPNTR
70 ....S OCXPNTR=$$FIELD^OCXSENDD(DD,FLD,"POINTER")
71 ....I $L(OCXPNTR) S OCXPNTR="^"_OCXPNTR_"0)"
72 ....I $D(@OCXPNTR) S OCXPNTR=$P(@OCXPNTR,"^",1)
73 ....W !!,"Broken pointer '",OCXARY(DD,D0,FLD,"E"),"'"
74 ....W " (",$$FIELD^OCXSENDD(DD,FLD,"LABEL"),") to"
75 ....W " '",OCXPNTR,"' file (",DD,",",D0,",",FLD,")"
76 ....W !," Not included."
77 ....I (FLD=.01) K OCXARY(DD,D0)
78 ....E K OCXARY(DD,D0,FLD)
79 ...K OCXARY(DD,D0,FLD,"I")
80 ...K:'$L($G(OCXARY(DD,D0,FLD,"E"))) OCXARY(DD,D0,FLD,"E")
81 ...K:$$EXFLD(DD,FLD) OCXARY(DD,D0,FLD)
82 ..;
83 ..I ($$FIELD^OCXSENDD(DD,.01,"LABEL")["PARAMETER"),($G(OCXARY(DD,D0,.01,"E"))="DATA TYPE"),$G(OCXARY(DD,D0,1,"E")) D
84 ...I $D(^OCXS(864.1,+OCXARY(DD,D0,1,"E"),0)) S OCXARY(DD,D0,1,"E")=$P(^OCXS(864.1,+OCXARY(DD,D0,1,"E"),0),U,1)
85 ..;
86 ..I ($$FIELD^OCXSENDD(DD,.01,"LABEL")["PARAMETER"),($G(OCXARY(DD,D0,.01,"E"))="OCXO GENERATE CODE FUNCTION"),$G(OCXARY(DD,D0,1,"E")) D
87 ...I $D(^OCXS(863.7,+OCXARY(DD,D0,1,"E"),0)) S OCXARY(DD,D0,1,"E")=$P(^OCXS(863.7,+OCXARY(DD,D0,1,"E"),0),U,1)
88 ..;
89 ;
90 Q
91EXFLD(FILE,OCXFLD) ;
92 ;
93 N OCXFNAM
94 S OCXFNAM=$$FIELD^OCXSENDD(FILE,OCXFLD,"LABEL")
95 I (OCXFNAM["UNIQUE OBJECT IDENTIFIER") Q 1
96 I ($E(OCXFNAM,1)="*") Q 1
97 I (FILE=860.2),(OCXFLD=.02) Q 1
98 I (FILE=860.22),(OCXFLD=4) Q 1
99 I (FILE=860.3),(OCXFLD=3) Q 1
100 I (FILE=860.9),(OCXFLD=1) Q 1
101 I (FILE=860.91) Q 1
102 Q 0
103 ;
104WPFLD(X) Q:(X=860.801) 1 Q:(X=860.81) 1 Q:(X=861.01) 1 Q:(X=863.02) 1 Q:(X=863.54) 1
105 Q:(X=863.61) 1 Q:(X=863.72) 1 Q:(X=863.81) 1
106 Q 0
107 ;
Note: See TracBrowser for help on using the repository browser.