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

DGPTFN1.m

Go to the documentation of this file.
DGPTFN1 ;ISP/RFR - REGISTRATION EVENT NOTIFIER;Aug 24, 2020@16:27
 ;;5.3;Registration;**932,1020,1076**;Aug 13, 1993;Build 4
 ;
 Q
EN ;NOTIFY PACKAGES OF EVENT(S)
 I '$D(ZTQUEUED) D
 .W @IOF
 .W !?19,"* * * REGISTRATION EVENT NOTIFIER * * *",!
 N NAME,NODE,DIC,X,EXIT,IEN,FILE,TYPES
 ;TYPES(DATA_NODE_NAME)=PROTOCOL_NAME
 S TYPES("DG PTF ICD NOTIFIER")="DG PTF ICD DIAGNOSIS NOTIFIER"
 S TYPES("DG PTF ICD OP NOTIFIER")="DG PTF ICD PROCEDURE NOTIFIER"
 S TYPES("DG SA FILE ENTRY NOTIFIER")="DG SA FILE ENTRY NOTIFIER"
 S NAME="" F  S NAME=$O(TYPES(NAME)) Q:NAME=""!($G(EXIT))  D
 .I '$D(ZTQUEUED) W !,"PROCESSING "_NAME_" MESSAGES:",!
 .I '$D(^XTMP(NAME))!($O(^XTMP(NAME,0))="") D  Q
 ..I '$D(ZTQUEUED) W "  THERE ARE NO DATA CHANGE MESSAGES TO PROCESS.",! H 3
 ..I $D(^XTMP(NAME)) K ^XTMP(NAME)
 .L +^XTMP(NAME):DILOCKTM
 .I '$T D  Q
 ..I '$D(ZTQUEUED) W !,"ANOTHER PROCESS IS ALREADY PROCESSING DATA CHANGE MESSAGES.",! H 3
 ..S EXIT=1
 .K ^TMP(NAME,$J)
 .S NODE=0 F  S NODE=$O(^XTMP(NAME,NODE)) Q:NODE=""  D
 ..I $E(NODE,1)'?1N W "  SKIPPING """_NODE_"""",! Q
 ..I '$D(ZTQUEUED) W "  PROCESSING """_NODE_"""..."
 ..I NAME="DG PTF ICD NOTIFIER"!(NAME="DG PTF ICD OP NOTIFIER") D
 ...S FILE=$G(^XTMP(NAME,NODE,"FILE"))
 ...K ^XTMP(NAME,NODE,"FILE")
 ..M ^TMP(NAME,$J)=^XTMP(NAME,NODE)
 ..S DIC=101,X=TYPES(NAME)
 ..D EN^XQOR
 ..I NAME="DG PTF ICD NOTIFIER"!(NAME="DG PTF ICD OP NOTIFIER"),FILE'="" D
 ...S IEN=$G(^XTMP(NAME,NODE,"IENS")),IEN=$P(IEN,",",$L(IEN,",")-1) Q:IEN=""
 ...K ^XTMP(NAME,"B",FILE,IEN)
 ..I NAME="DG SA FILE ENTRY NOTIFIER CACHE" D
 ...S IEN=$G(^XTMP(NAME,NODE,"IEN")) Q:IEN=""
 ...K ^XTMP(NAME,"B",IEN)
 ..K DIC,X,^TMP(NAME,$J),^XTMP(NAME,NODE)
 ..I '$D(ZTQUEUED) W "DONE",!
 .K ^XTMP(NAME)
 .L -^XTMP(NAME)
 .W "FINISHED PROCESSING "_NAME_" MESSAGES.",!
 I '$D(ZTQUEUED) W !,"FINISHED PROCESSING ALL DATA CHANGE MESSAGES.",! H 3
 Q