DG53527P ;BP-CIOFO/KEITH - Pre/post inits ; 21 May 2001 7:11 PM
;;5.3;Registration;**527,1015**;Aug 13, 1993;Build 21
;
POST ;Post init
N DGFLD,DGMFLD,DGOUT,DGFILE
;File cross references
F DGFLD=.111,.1112,.112,.113,.114,.115,.116,.1411,.1412,.1413,.1414,.1415,.1416,.1417,.1418 D XR(2,.DGFLD)
;Recompile templates
I $O(DGFLD(2,0)) D
.D MES^XPDUTL(" >>> Recompiling templates on address fields...")
.D DIEZ^DIKCUTL3(2,.DGFLD)
.Q
;Check/update triggering field definitions
D MES^XPDUTL(" >>> Checking triggering field definitions...")
D TRIG^DICR(.DGFLD,.DGOUT)
S DGFILE=0 F S DGFILE=$O(DGOUT(DGFILE)) Q:'DGFILE D
.S DGFLD=0 F S DGFLD=$O(DGOUT(DGFILE,DGFLD)) Q:'DGFLD D
..D MES^XPDUTL(" Field #"_DGFLD_" of file #"_DGFILE_" updated.")
..Q
.Q
;File cross references for Confidential Address Category fields
F DGMFLD=.01,1 D XR(2.141,.DGMFLD)
;Recompile templates
I $O(DGMFLD(2.141,0)) D
.D MES^XPDUTL(" >>> Recompiling templates on Confidential Address Category fields...")
.D DIEZ^DIKCUTL3(2.141,.DGMFLD)
.Q
;Check/update triggering field definitions
D MES^XPDUTL(" >>> Checking triggering field definitions...")
D TRIG^DICR(.DGMFLD,.DGOUT)
S DGFILE=0 F S DGFILE=$O(DGOUT(DGFILE)) Q:'DGFILE D
.S DGFLD=0 F S DGFLD=$O(DGOUT(DGFILE,DGFLD)) Q:'DGFLD D
..D MES^XPDUTL(" Field #"_DGFLD_" of file #"_DGFILE_" updated.")
..Q
.Q
Q
;
XR(DGFILE,DGFLD) ;File index type cross references
;
N DGFDA,DGIEN,DGWP,DGERR,DGXR,DGVAL,DGOUT,DIERR
;Set up x-refs. Any value that has a ".", will have the period
;replaved with a "D" to prevent x-ref's such as .11 and 11 having
;identical xref names
S DGXR=$S(DGFLD[".":"ADGFMD"_$P(DGFLD,".",2),1:"ADGFM"_DGFLD)
;Check for existing x-ref
S DGVAL(1)=DGFILE,DGVAL(2)=DGXR
D FIND^DIC(.11,"","@;IXIE","KP",.DGVAL,"","","","","DGOUT")
I $D(DGOUT("DILIST",1)) D Q
.D MES^XPDUTL(" >>> Cross reference "_DGXR_" already exists, nothing filed.")
.Q
;Create filer array
S DGFDA(.11,"+1,",.01)=DGFILE ;FILE
S DGFDA(.11,"+1,",.02)=DGXR ;NAME
S DGFDA(.11,"+1,",.11)="This x-ref calls the DG FIELD MONITOR event point." ;SHORT DESCRIPTION
S DGFDA(.11,"+1,",.2)="MU" ;TYPE
S DGFDA(.11,"+1,",.4)="F" ;EXECUTION
S DGFDA(.11,"+1,",.41)="I" ;ACTIVITY
S DGFDA(.11,"+1,",.5)="I" ;ROOT TYPE
S DGFDA(.11,"+1,",.51)=DGFILE ;ROOT FILE
S DGFDA(.11,"+1,",.42)="A" ;USE
S DGFDA(.11,"+1,",1.1)="D FC^DGFCPROT(.DA,"_DGFILE_","_DGFLD_",""SET"",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q" ;SET LOGIC
S DGFDA(.11,"+1,",2.1)="D FC^DGFCPROT(.DA,"_DGFILE_","_DGFLD_",""KILL"",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q" ;KILL LOGIC
;CROSS REFERENCE VALUES
S DGFDA(.114,"+2,+1,",.01)=1 ;ORDER NUMBER
S DGFDA(.114,"+2,+1,",1)="F" ;TYPE OF VALUE
S DGFDA(.114,"+2,+1,",2)=DGFILE ;FILE NUMBER
S DGFDA(.114,"+2,+1,",3)=DGFLD ;FIELD NUMBER
S DGFDA(.114,"+2,+1,",7)="F" ;COLLATION
;DESCRIPTION
S DGWP(1)="This cross reference activates the DG FIELD MONITOR event point."
S DGWP(2)="Applications that wish to monitor edit activity related to this field may"
S DGWP(3)="subscribe to that event point and take action as indicated by the changes"
S DGWP(4)="that occur. Refer to the DG FIELD MONITOR protocol for a description of"
S DGWP(5)="the information available at the time of the event."
;File INDEX record
D UPDATE^DIE("","DGFDA","DGIEN","DGERR")
I $D(DIERR) D Q
.N DGI S DGI=""
.D MES^XPDUTL(" >>> A problem has occurred during the filing of x-ref. "_DGXR_"!")
.D MES^XPDUTL(" Please contact Customer Support.")
.F S DGI=$O(DGERR("DIERR",1,"TEXT",DGI)) Q:DGI="" D
..D MES^XPDUTL(DGERR("DIERR",1,"TEXT",DGI))
..Q
.Q
S DGFLD(DGFILE,DGFLD)="" ;Create list to recompile templates
D MES^XPDUTL(" >>> "_DGXR_" cross reference filed.")
;File DESCRIPTION field
D WP^DIE(.11,DGIEN(1)_",",.1,"","DGWP")
Q
DG53527P ;BP-CIOFO/KEITH - Pre/post inits ; 21 May 2001 7:11 PM
+1 ;;5.3;Registration;**527,1015**;Aug 13, 1993;Build 21
+2 ;
POST ;Post init
+1 NEW DGFLD,DGMFLD,DGOUT,DGFILE
+2 ;File cross references
+3 FOR DGFLD=.111,.1112,.112,.113,.114,.115,.116,.1411,.1412,.1413,.1414,.1415,.1416,.1417,.1418
DO XR(2,.DGFLD)
+4 ;Recompile templates
+5 IF $ORDER(DGFLD(2,0))
Begin DoDot:1
+6 DO MES^XPDUTL(" >>> Recompiling templates on address fields...")
+7 DO DIEZ^DIKCUTL3(2,.DGFLD)
+8 QUIT
End DoDot:1
+9 ;Check/update triggering field definitions
+10 DO MES^XPDUTL(" >>> Checking triggering field definitions...")
+11 DO TRIG^DICR(.DGFLD,.DGOUT)
+12 SET DGFILE=0
FOR
SET DGFILE=$ORDER(DGOUT(DGFILE))
IF 'DGFILE
QUIT
Begin DoDot:1
+13 SET DGFLD=0
FOR
SET DGFLD=$ORDER(DGOUT(DGFILE,DGFLD))
IF 'DGFLD
QUIT
Begin DoDot:2
+14 DO MES^XPDUTL(" Field #"_DGFLD_" of file #"_DGFILE_" updated.")
+15 QUIT
End DoDot:2
+16 QUIT
End DoDot:1
+17 ;File cross references for Confidential Address Category fields
+18 FOR DGMFLD=.01,1
DO XR(2.141,.DGMFLD)
+19 ;Recompile templates
+20 IF $ORDER(DGMFLD(2.141,0))
Begin DoDot:1
+21 DO MES^XPDUTL(" >>> Recompiling templates on Confidential Address Category fields...")
+22 DO DIEZ^DIKCUTL3(2.141,.DGMFLD)
+23 QUIT
End DoDot:1
+24 ;Check/update triggering field definitions
+25 DO MES^XPDUTL(" >>> Checking triggering field definitions...")
+26 DO TRIG^DICR(.DGMFLD,.DGOUT)
+27 SET DGFILE=0
FOR
SET DGFILE=$ORDER(DGOUT(DGFILE))
IF 'DGFILE
QUIT
Begin DoDot:1
+28 SET DGFLD=0
FOR
SET DGFLD=$ORDER(DGOUT(DGFILE,DGFLD))
IF 'DGFLD
QUIT
Begin DoDot:2
+29 DO MES^XPDUTL(" Field #"_DGFLD_" of file #"_DGFILE_" updated.")
+30 QUIT
End DoDot:2
+31 QUIT
End DoDot:1
+32 QUIT
+33 ;
XR(DGFILE,DGFLD) ;File index type cross references
+1 ;
+2 NEW DGFDA,DGIEN,DGWP,DGERR,DGXR,DGVAL,DGOUT,DIERR
+3 ;Set up x-refs. Any value that has a ".", will have the period
+4 ;replaved with a "D" to prevent x-ref's such as .11 and 11 having
+5 ;identical xref names
+6 SET DGXR=$SELECT(DGFLD[".":"ADGFMD"_$PIECE(DGFLD,".",2),1:"ADGFM"_DGFLD)
+7 ;Check for existing x-ref
+8 SET DGVAL(1)=DGFILE
SET DGVAL(2)=DGXR
+9 DO FIND^DIC(.11,"","@;IXIE","KP",.DGVAL,"","","","","DGOUT")
+10 IF $DATA(DGOUT("DILIST",1))
Begin DoDot:1
+11 DO MES^XPDUTL(" >>> Cross reference "_DGXR_" already exists, nothing filed.")
+12 QUIT
End DoDot:1
QUIT
+13 ;Create filer array
+14 ;FILE
SET DGFDA(.11,"+1,",.01)=DGFILE
+15 ;NAME
SET DGFDA(.11,"+1,",.02)=DGXR
+16 ;SHORT DESCRIPTION
SET DGFDA(.11,"+1,",.11)="This x-ref calls the DG FIELD MONITOR event point."
+17 ;TYPE
SET DGFDA(.11,"+1,",.2)="MU"
+18 ;EXECUTION
SET DGFDA(.11,"+1,",.4)="F"
+19 ;ACTIVITY
SET DGFDA(.11,"+1,",.41)="I"
+20 ;ROOT TYPE
SET DGFDA(.11,"+1,",.5)="I"
+21 ;ROOT FILE
SET DGFDA(.11,"+1,",.51)=DGFILE
+22 ;USE
SET DGFDA(.11,"+1,",.42)="A"
+23 ;SET LOGIC
SET DGFDA(.11,"+1,",1.1)="D FC^DGFCPROT(.DA,"_DGFILE_","_DGFLD_",""SET"",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q"
+24 ;KILL LOGIC
SET DGFDA(.11,"+1,",2.1)="D FC^DGFCPROT(.DA,"_DGFILE_","_DGFLD_",""KILL"",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q"
+25 ;CROSS REFERENCE VALUES
+26 ;ORDER NUMBER
SET DGFDA(.114,"+2,+1,",.01)=1
+27 ;TYPE OF VALUE
SET DGFDA(.114,"+2,+1,",1)="F"
+28 ;FILE NUMBER
SET DGFDA(.114,"+2,+1,",2)=DGFILE
+29 ;FIELD NUMBER
SET DGFDA(.114,"+2,+1,",3)=DGFLD
+30 ;COLLATION
SET DGFDA(.114,"+2,+1,",7)="F"
+31 ;DESCRIPTION
+32 SET DGWP(1)="This cross reference activates the DG FIELD MONITOR event point."
+33 SET DGWP(2)="Applications that wish to monitor edit activity related to this field may"
+34 SET DGWP(3)="subscribe to that event point and take action as indicated by the changes"
+35 SET DGWP(4)="that occur. Refer to the DG FIELD MONITOR protocol for a description of"
+36 SET DGWP(5)="the information available at the time of the event."
+37 ;File INDEX record
+38 DO UPDATE^DIE("","DGFDA","DGIEN","DGERR")
+39 IF $DATA(DIERR)
Begin DoDot:1
+40 NEW DGI
SET DGI=""
+41 DO MES^XPDUTL(" >>> A problem has occurred during the filing of x-ref. "_DGXR_"!")
+42 DO MES^XPDUTL(" Please contact Customer Support.")
+43 FOR
SET DGI=$ORDER(DGERR("DIERR",1,"TEXT",DGI))
IF DGI=""
QUIT
Begin DoDot:2
+44 DO MES^XPDUTL(DGERR("DIERR",1,"TEXT",DGI))
+45 QUIT
End DoDot:2
+46 QUIT
End DoDot:1
QUIT
+47 ;Create list to recompile templates
SET DGFLD(DGFILE,DGFLD)=""
+48 DO MES^XPDUTL(" >>> "_DGXR_" cross reference filed.")
+49 ;File DESCRIPTION field
+50 DO WP^DIE(.11,DGIEN(1)_",",.1,"","DGWP")
+51 QUIT