source: WorldVistAEHR/trunk/r/NETWORK_HEALTH_EXCHANGE-AFJX/AFJXPNHX.m@ 1800

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

initial load of WorldVistAEHR

File size: 1.9 KB
RevLine 
[613]1AFJXPNHX ;FO-OAKLAND/GMB-PURGE MSGS ;11/8/95
2 ;;5.1;Network Health Exchange;**1,6,11,17,20,24,31**;Jan 23, 1996
3 ; Totally rewritten 11/2001. (Previously FJ/CWS.)
4 ; Entry points:
5 ; ENTER - invoked by option AFJXNH PURGE NIGHTLY
6ENTER ;
7 N AXCUTOFF
8 S AXCUTOFF=$$FMADD^XLFDT(DT,-7) ; Days to keep on file - OK to change
9 D NHX(AXCUTOFF)
10 D DELST
11 D NITE(AXCUTOFF)
12 Q
13NHX(AXCUTOFF) ;
14 N AXNHEDUZ,AXBSKT,AXMZ,AXDATE,DUZ
15 S (DUZ,AXNHEDUZ)=$$FIND1^DIC(200,"","X","NETWORK,HEALTH EXCHANGE","B") Q:'AXNHEDUZ
16 S AXBSKT=.9
17 F S AXBSKT=$O(^XMB(3.7,AXNHEDUZ,2,AXBSKT)) Q:'AXBSKT D
18 . S AXMZ=0
19 . F S AXMZ=$O(^XMB(3.7,AXNHEDUZ,2,AXBSKT,1,AXMZ)) Q:'AXMZ D
20 . . S AXDATE=$P($G(^XMB(3.9,AXMZ,0)),U,3)
21 . . S AXDATE=$S(AXDATE[".":$P(AXDATE,".",1),1:$$CONVERT^XMXUTIL1(AXDATE))
22 . . I AXDATE'>AXCUTOFF D DELMSG^XMXAPI(AXNHEDUZ,"",AXMZ) Q
23 . . I $$NEW^XMXUTIL2(AXNHEDUZ,AXBSKT,AXMZ) D NONEW^XMXUTIL(AXNHEDUZ,AXBSKT,AXMZ)
24 Q
25DELST ;
26 N AX25IEN,AX25REC,AXDOMIEN,AXDAYS,AXI,AXDTRCVD,DA,DIK,AXCUTOFF
27 S (AX25IEN,AXI)=0
28 F S AX25IEN=$O(^AFJ(537025,AX25IEN)) Q:'AX25IEN D
29 . S AX25REC=$G(^AFJ(537025,AX25IEN,0))
30 . S AXDOMIEN=$P(AX25REC,U),AXDAYS=$P(AX25REC,U,5) Q:AXDOMIEN=""!'AXDAYS
31 . S AXCUTOFF=$$FMADD^XLFDT(DT,-AXDAYS)
32 . F S AXI=$O(^AFJ(537000,"C",AXDOMIEN,AXI)) Q:'AXI D
33 . . S AXDTRCVD=$P($G(^AFJ(537000,AXI,0)),U,2) ; Date Received
34 . . I AXDTRCVD<AXCUTOFF S DIK="^AFJ(537000,",DA=AXI D ^DIK
35 Q
36NITE(AXCUTOFF) ; Nightly purge of messages in the AFJX server baskets
37 N AXSRV,AXBSKT,AXMZ,AXDATE,XMZ,XMSER
38 F AXSRV="S.AFJXSERVER","S.AFJXNHDONE","S.AFJXNETP" D
39 . S AXBSKT=$$FIND1^DIC(3.701,",.5,","X",AXSRV,"B") Q:'AXBSKT
40 . S AXMZ=0
41 . F S AXMZ=$O(^XMB(3.7,.5,2,AXBSKT,1,AXMZ)) Q:'AXMZ D
42 . . I $G(^XMB(3.9,AXMZ,0))="" S XMZ=AXMZ,XMSER=AXSRV D REMSBMSG^XMA1C Q
43 . . S AXDATE=$P(^XMB(3.9,AXMZ,0),U,3)
44 . . S AXDATE=$S(AXDATE[".":$P(AXDATE,".",1),1:$$CONVERT^XMXUTIL1(AXDATE))
45 . . I AXDATE<AXCUTOFF S XMZ=AXMZ,XMSER=AXSRV D REMSBMSG^XMA1C
46 Q
Note: See TracBrowser for help on using the repository browser.