source: WorldVistAEHR/trunk/r/OPERATIONS_WITH_DESERT_STORM-A1B2/A1B2T2.m@ 1006

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1A1B2T2 ;ALB/EG EXTRACT FROM ODS FILES AND PUT IN MESSAGE 2 ; JAN 12 1991
2 ;;Version 1.55 (local for MAS v5 sites);;
3 K ^UTILITY("TRN1",$J) S KNT=2,K4=2,KNT1="",A1B2T2=1,A1B2FLAG=0
4 F AI=1:1 S KNT1=$O(^UTILITY("TRN",$J,2,A1B2T2,KNT1)) Q:KNT1="" S K3=$O(^UTILITY("TRN",$J,2,A1B2T2,KNT1,0)) I $D(^UTILITY("TRN",$J,2,A1B2T2,KNT1)) D PSET S KNT=KNT+1
5 S KNT1="" F A1B2T2=2:1:8 F AI=1:1 S KNT1=$O(^UTILITY("TRN",$J,2,A1B2T2,KNT1)) Q:KNT1="" I $D(^UTILITY("TRN",$J,2,A1B2T2,KNT1,0)) S ^UTILITY("TRN1",$J,2,KNT,0)=^UTILITY("TRN",$J,2,A1B2T2,KNT1,0),KNT=KNT+1
6 I KNT>3 S ^UTILITY("TRN1",$J,2,KNT,0)="$END" D MSG1
7 S K4=3,KNT=2,KNT1="",A1B2T2=1 F AI=1:1 S KNT1=$O(^UTILITY("TRN",$J,3,A1B2T2,KNT1)) Q:KNT1="" S K3=$O(^UTILITY("TRN",$J,3,A1B2T2,KNT1,0)) I $D(^UTILITY("TRN",$J,3,A1B2T2,KNT1)) D PSET S KNT=KNT+1
8 S KNT1="" F A1B2T2=2:1:8 F AI=1:1 S KNT1=$O(^UTILITY("TRN",$J,3,A1B2T2,KNT1)) Q:KNT1="" I $D(^UTILITY("TRN",$J,3,A1B2T2,KNT1,0)) S ^UTILITY("TRN1",$J,3,KNT,0)=^UTILITY("TRN",$J,3,A1B2T2,KNT1,0),KNT=KNT+1
9 I KNT>3 S ^UTILITY("TRN1",$J,3,KNT,0)="$END" D MSG2
10END K ^UTILITY("TRN1",$J),A1B2DEST,A1B2FLAG,A1B2FN,A1B2MG,A1B2NET,A1B2NOW,A1B2T2,AI,AI1,AK,DGTOUT,K3,K4,KNT,KNT1,XMSUB,XMTEXT,XMY,XMZ
11 Q
12PSET S ^UTILITY("TRN1",$J,K4,KNT,0)=^UTILITY("TRN",$J,K4,A1B2T2,KNT1,K3,0)
13 Q:KNT1=.5 S ^UTILITY("TRN1",$J,K4,KNT+1,0)=^UTILITY("TRN",$J,K4,A1B2T2,KNT1,K3+.5,0)
14 S KNT=KNT+1
15 Q
16MSG1 ;new ods message (2)
17 D ET S ^UTILITY("TRN1",$J,2,1,0)="$START"_U_2_U_KNT_U_A1B2NET_U_DGTOUT,XMSUB="ODS NEW from "_A1B2NET,XMTEXT="^UTILITY(""TRN1"","_$J_",2,"
18 S XMY("G.ODS-SERVER@"_A1B2DEST)="" D SRV,^XMD K XMSUB,XMTEXT,XMY S A1B2FLAG=A1B2FLAG+1
19 S A1B2TR=2 F FL=11500.1,11500.2,11500.3,11500.4,11500.61,11500.62,11500.63,11500.64 S A1B2DA="" F AI=1:1 S A1B2DA=$O(^UTILITY("TRN2",$J,A1B2TR,FL,A1B2DA)) Q:A1B2DA="" D SENT
20 K ^UTILITY("TRN2",$J,A1B2TR),A1B2DA,AI,A1B2TR,AI,FL
21 Q
22MSG2 ;correction ods message (3)
23 D ET S ^UTILITY("TRN1",$J,3,1,0)="$START"_U_3_U_KNT_U_A1B2NET_U_DGTOUT,XMSUB="ODS CORRECTION from "_A1B2NET,XMTEXT="^UTILITY(""TRN1"","_$J_",3,"
24 S XMY("G.ODS-SERVER@"_A1B2DEST)="" D SRV,^XMD K XMSUB,XMTEXT,XMY S A1B2FLAG=A1B2FLAG+10
25 S A1B2TR=3 F FL=11500.1,11500.2,11500.3,11500.4,11500.61,11500.62,11500.63,11500.64 S A1B2DA="" F AI=1:1 S A1B2DA=$O(^UTILITY("TRN2",$J,A1B2TR,FL,A1B2DA)) Q:A1B2DA="" D SENT
26 K ^UTILITY("TRN2",$J,A1B2TR),A1B2DA,AI,A1B2TR,AI,FL
27 Q
28SENT ;set transmission flag
29 S DIE=FL,DA=A1B2DA,DR="1.01///1;1.06////"_XMZ D ^DIE K DA,DIE,DR
30 Q
31NADA S %DT="ST",X="NOW" D ^%DT S A1B2NOW=Y,AJ=$S(A1B2FLAG=1:1,A1B2FLAG>9:2,1:9),A1B2FLAG=AJ
32 S DIE=11500.5,DA=1,DLAYGO=11500.5,DR=".04////"_A1B2NOW_";.05///"_A1B2FLAG D ^DIE K DA,DIE,DR
33 K AJ S AJ=$S(A1B2FLAG=1:2,A1B2FLAG=9:1,A1B2FLAG=2:3,1:1),A1B2FLAG=AJ,XMSUB="ODS STATUS from "_A1B2NET
34 S AJ(1,0)="$START^9^1^"_A1B2NET_U_A1B2FN_U_A1B2FLAG,AJ(2,0)="$NADA^NO DATA TO TRANSMIT",XMTEXT="AJ(" D SRV,^XMD K %DT,AJ,XMSUB,XMTEXT,XMY
35 Q
36SRV ;address
37 S AK=0,AJ="ODS CONFIRMATION",XMY("S.A1B2Z-SERVER@"_A1B2DEST)="",A1B2MG=$S('$D(^XMB(3.8,"B",AJ)):.5,1:$O(^XMB(3.8,"B",AJ,0)))
38 I A1B2MG'=.5 F AI1=1:1 S AK=$O(^XMB(3.8,A1B2MG,1,AK)) Q:(AK="")!(AK'?.N) S XMY(^XMB(3.8,A1B2MG,1,AK,0))=""
39 Q
40ET ;elapsed time for run
41 Q:$D(H1)=0 S H2=$H D ET1 Q
42 ;
43ET1 ;H1-start time,H2-end time,DGTOUT-difference in seconds
44 S H1(1)=$P(H1,",",1),H1(2)=$P(H1,",",2),H2(1)=$P(H2,",",1),H2(2)=$P(H2,",",2)
45 I H1(1)=H2(1) S DGTOUT=H2(2)-H1(2) Q
46 S DGTOUT=86400*(H2(1)-H1(1))+(H2(2)-H1(2)) Q
Note: See TracBrowser for help on using the repository browser.