source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SD376P.m@ 1267

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

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1SD376P ;BP-OIFO/esw,swo - POSTINSTALL DRIVER ; 10/27/04 3:39pm
2 ;;5.3;Scheduling;**376**;Aug 13, 1993
3EN ;manual entry point
4 ;ST : station number
5 ;STR : list of stations receiving AA ack's only
6 ;STS : current station number with comma's concatenated
7 I '$$PROD^XUPROD(1) D Q
8 . D BMES^XPDUTL("NOT A PRODUCTION SYSTEM. POST INIT CANCELLED")
9EN1 N ST,STR,STS
10 S ST=$P($$SITE^VASITE(),"^",3)
11 Q:ST=""
12 S STR=","_$P($T(STAT),";;",2)_","
13 S STS=","_ST_","
14 I STR[STS D EN^SDRPA18,CLEAN Q ;process stations that received AA ack only then quit
15 I ST=674 D EN^SDRPA17(ST),EN^SDRPA18,CLEAN Q
16 I ST<529 D EN^SDRPA10(ST),EN^SDRPA18,CLEAN Q
17 I ST<547 D EN^SDRPA11(ST),EN^SDRPA18,CLEAN Q
18 I ST<555 D EN^SDRPA12(ST),EN^SDRPA18,CLEAN Q
19 I ST<571 D EN^SDRPA13(ST),EN^SDRPA18,CLEAN Q
20 I ST<619 D EN^SDRPA14(ST),EN^SDRPA18,CLEAN Q
21 I ST<664 D EN^SDRPA15(ST),EN^SDRPA18,CLEAN Q
22 D EN^SDRPA16(ST),EN^SDRPA18,CLEAN Q
23 Q
24PR(SB,SM,ER,SQ) ;process the message number and error code
25 ;SB - Batch #
26 ;SM - Message #
27 ;ER - Error code
28 ;SQ - Sequence number
29 ;V1 - Run number
30 ;V2 - ien in appt multiple
31 ;V3 - ien in batch tracking multiple
32 ;SM is the batch # found in the "AMSG" xref and corresponds to the message control id
33 ;SB is our batch control, use for the 2 node multiples B xref lookups
34 N V1,V2,V3
35 ;get the run number
36 S V1=$O(^SDWL(409.6,"AMSG",SM,SQ,"")) Q:'V1 D
37 . ;get the ien in that run
38 . S V2=$O(^SDWL(409.6,"AMSG",SM,SQ,V1,"")) Q:'V2 D
39 .. ;now get the ien of the batch tracking entry
40 .. S V3=$O(^SDWL(409.6,V1,2,"B",SB,"")) Q:'V3 D
41 ... ;quit if there is an ack date
42 ... I $P($G(^SDWL(409.6,V1,2,V3,0)),"^",4)'="" Q
43 ... ;update batch tracking
44 ... I ER="" S DA=V3,DA(1)=V1,DIE="^SDWL(409.6,"_V1_",2,",DR=".04///"_$$NOW^XLFDT_";.05///AE" D ^DIE K DIE,DA,DR Q
45 ...;
46 ...;update error codes
47 ... S DA=V2,DA(1)=V1,DIE="^SDWL(409.6,"_V1_",1,"
48 ... S DR="7////"_$O(^SCPT(404.472,"B",ER,"")) D ^DIE
49 ... I $D(^SDWL(409.6,"AE","Y",V1,V2)) Q
50 ... I $D(^SDWL(409.6,"AE","N",V1,V2)) D
51 .... S DR="4///Y" D ^DIE K DIE,DA,DR
52 Q
53CLEAN ;clean up batches previous to current one by checking for "AE",("S" or "R") xref and
54 ;deleting if entry in xref exists
55 ;RUN : run # (ien of multiple entry)
56 ;V1 : previous run # (ien of multiple entry)
57 ;V2 : ien (ien in multiple)
58 N V1,V2,V3,ZNODE
59 S V1=9999999 F S V1=$O(^SDWL(409.6,V1),-1) Q:'V1 D
60 .F V3="R","S" S V2=0 F S V2=$O(^SDWL(409.6,"AE",V3,V1,V2)) Q:'V2 D
61 ..S ZNODE=$G(^SDWL(409.6,V1,1,V2,0))
62 ..S DIK="^SDWL(409.6,"_V1_",1,"
63 ..S DA(1)=V1,DA=V2 D ^DIK K DIK
64 Q
65 ;listing of all stations that received only AA ack - no rejection
66STAT ;;358,405,463,503,516,517,523,538,540,542,552,564,575,583,600,613,632,649,653,656,676,679,687,692,693,757
Note: See TracBrowser for help on using the repository browser.