Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SD376P

SD376P.m

Go to the documentation of this file.
  1. SD376P ;BP-OIFO/esw,swo - POSTINSTALL DRIVER ; 10/27/04 3:39pm
  1. ;;5.3;Scheduling;**376**;Aug 13, 1993
  1. EN ;manual entry point
  1. ;ST : station number
  1. ;STR : list of stations receiving AA ack's only
  1. ;STS : current station number with comma's concatenated
  1. I '$$PROD^XUPROD(1) D Q
  1. . D BMES^XPDUTL("NOT A PRODUCTION SYSTEM. POST INIT CANCELLED")
  1. EN1 N ST,STR,STS
  1. S ST=$P($$SITE^VASITE(),"^",3)
  1. Q:ST=""
  1. S STR=","_$P($T(STAT),";;",2)_","
  1. S STS=","_ST_","
  1. I STR[STS D EN^SDRPA18,CLEAN Q ;process stations that received AA ack only then quit
  1. I ST=674 D EN^SDRPA17(ST),EN^SDRPA18,CLEAN Q
  1. I ST<529 D EN^SDRPA10(ST),EN^SDRPA18,CLEAN Q
  1. I ST<547 D EN^SDRPA11(ST),EN^SDRPA18,CLEAN Q
  1. I ST<555 D EN^SDRPA12(ST),EN^SDRPA18,CLEAN Q
  1. I ST<571 D EN^SDRPA13(ST),EN^SDRPA18,CLEAN Q
  1. I ST<619 D EN^SDRPA14(ST),EN^SDRPA18,CLEAN Q
  1. I ST<664 D EN^SDRPA15(ST),EN^SDRPA18,CLEAN Q
  1. D EN^SDRPA16(ST),EN^SDRPA18,CLEAN Q
  1. Q
  1. PR(SB,SM,ER,SQ) ;process the message number and error code
  1. ;SB - Batch #
  1. ;SM - Message #
  1. ;ER - Error code
  1. ;SQ - Sequence number
  1. ;V1 - Run number
  1. ;V2 - ien in appt multiple
  1. ;V3 - ien in batch tracking multiple
  1. ;SM is the batch # found in the "AMSG" xref and corresponds to the message control id
  1. ;SB is our batch control, use for the 2 node multiples B xref lookups
  1. N V1,V2,V3
  1. ;get the run number
  1. S V1=$O(^SDWL(409.6,"AMSG",SM,SQ,"")) Q:'V1 D
  1. . ;get the ien in that run
  1. . S V2=$O(^SDWL(409.6,"AMSG",SM,SQ,V1,"")) Q:'V2 D
  1. .. ;now get the ien of the batch tracking entry
  1. .. S V3=$O(^SDWL(409.6,V1,2,"B",SB,"")) Q:'V3 D
  1. ... ;quit if there is an ack date
  1. ... I $P($G(^SDWL(409.6,V1,2,V3,0)),"^",4)'="" Q
  1. ... ;update batch tracking
  1. ... 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
  1. ...;
  1. ...;update error codes
  1. ... S DA=V2,DA(1)=V1,DIE="^SDWL(409.6,"_V1_",1,"
  1. ... S DR="7////"_$O(^SCPT(404.472,"B",ER,"")) D ^DIE
  1. ... I $D(^SDWL(409.6,"AE","Y",V1,V2)) Q
  1. ... I $D(^SDWL(409.6,"AE","N",V1,V2)) D
  1. .... S DR="4///Y" D ^DIE K DIE,DA,DR
  1. Q
  1. CLEAN ;clean up batches previous to current one by checking for "AE",("S" or "R") xref and
  1. ;deleting if entry in xref exists
  1. ;RUN : run # (ien of multiple entry)
  1. ;V1 : previous run # (ien of multiple entry)
  1. ;V2 : ien (ien in multiple)
  1. N V1,V2,V3,ZNODE
  1. S V1=9999999 F S V1=$O(^SDWL(409.6,V1),-1) Q:'V1 D
  1. .F V3="R","S" S V2=0 F S V2=$O(^SDWL(409.6,"AE",V3,V1,V2)) Q:'V2 D
  1. ..S ZNODE=$G(^SDWL(409.6,V1,1,V2,0))
  1. ..S DIK="^SDWL(409.6,"_V1_",1,"
  1. ..S DA(1)=V1,DA=V2 D ^DIK K DIK
  1. Q
  1. ;listing of all stations that received only AA ack - no rejection
  1. STAT ;;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