1 | HLOCLNT3 ;ALB/CJM- Updates messages missing application acks - 10/4/94 1pm ;07/10/2007
|
---|
2 | ;;1.6;HEALTH LEVEL SEVEN;**126,130,134,137**;Oct 13, 1995;Build 21
|
---|
3 | ;Per VHA Directive 2004-038, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | DOWORK(WORK) ;
|
---|
6 | ;
|
---|
7 | N CUTOFF,MSGIEN,QUIT,NOW,SYSTEM
|
---|
8 | S NOW=$$NOW^XLFDT
|
---|
9 | S QUIT=0
|
---|
10 | D SYSPARMS^HLOSITE(.SYSTEM)
|
---|
11 | S PURGE=$$FMADD^XLFDT($$NOW^XLFDT,,24*SYSTEM("ERROR PURGE"))
|
---|
12 | ;
|
---|
13 | ;7 day wait for an application ack is more than reasonable
|
---|
14 | S CUTOFF=$$FMADD^XLFDT(NOW,-3)
|
---|
15 | ;
|
---|
16 | S MSGIEN=+$G(^HLTMP("LAST IEN CHECKED FOR MISSING APPLICATION ACK"))
|
---|
17 | F S MSGIEN=$O(^HLB(MSGIEN)) Q:'MSGIEN Q:MSGIEN>99999999999 D Q:QUIT
|
---|
18 | .N MSG,HDR
|
---|
19 | .Q:'$$GETMSG^HLOMSG(MSGIEN,.MSG)
|
---|
20 | .Q:'MSG("DT/TM")
|
---|
21 | .Q:'MSG("BODY")
|
---|
22 | .I MSG("DT/TM")>CUTOFF S:MSG("DT/TM CREATED")>CUTOFF QUIT=1,MSGIEN=MSGIEN-1 Q
|
---|
23 | .Q:MSG("STATUS")'=""
|
---|
24 | .Q:MSG("DIRECTION")'="OUT"
|
---|
25 | .Q:MSG("BATCH")
|
---|
26 | .Q:MSG("STATUS","APP ACK'D")
|
---|
27 | .;Q:MSG("STATUS","APP ACK RESPONSE")=""
|
---|
28 | .;message has been in a non-complete status for a longtime, pending an application ack - set status to error and schedule for purging
|
---|
29 | .S $P(^HLB(MSGIEN,0),"^",9)=PURGE
|
---|
30 | .S ^HLB("AD","OUT",PURGE,MSGIEN)=""
|
---|
31 | .S $P(^HLB(MSGIEN,0),"^",20)="ER"
|
---|
32 | .S $P(^HLB(MSGIEN,0),"^",21)="MISSING APPLICATION ACKNOWLEDGMENT"
|
---|
33 | .M HDR=MSG("HDR")
|
---|
34 | .Q:'$$PARSEHDR^HLOPRS(.HDR)
|
---|
35 | .S ^HLB("ERRORS",$S($L(HDR("RECEIVING APPLICATION")):HDR("RECEIVING APPLICATION"),1:"UNKNOWN"),NOW,MSGIEN)=""
|
---|
36 | .D COUNT^HLOESTAT("OUT",HDR("RECEIVING APPLICATION"),HDR("SENDING APPLICATION"),$S(MSG("BATCH"):"BATCH",1:$G(HDR("MESSAGE TYPE"))),$G(HDR("EVENT")))
|
---|
37 | S:MSGIEN>99999999999 MSGIEN=0
|
---|
38 | S ^HLTMP("LAST IEN CHECKED FOR MISSING APPLICATION ACK")=MSGIEN
|
---|
39 | Q
|
---|