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

DGFCPROT.m

Go to the documentation of this file.
  1. DGFCPROT ;FLB/ALB-DG Field Monitor cross-reference initialing routine. ;06/24/2010 10:51
  1. ;;5.3;Registration;**273,526,707,825**;AUG 13, 1993;Build 1
  1. ;
  1. FC(DGDA,DGFILE,DGFIELD,DGTYPE,DGDTH,DGUSER,DGX,DGX1,DGX2,DGOPT) ; Field change listener
  1. ;Input: DGDA = DA array as exists during Fileman editing
  1. ;Input: DGFILE = File or subfile number where changed field resides
  1. ;Input: DGFIELD = Number of changed field
  1. ;Input: DGTYPE = Type of cross reference action ("SET" or "KILL")
  1. ;Input: DGDTH = date/time of change in $Horolog format
  1. ;Input: DGUSER = DUZ of user that made the change
  1. ;Input: DGX = X array as documented for Fileman new style x-refs
  1. ;Input: DGX1 = X1 array as documented for Fileman new style x-refs
  1. ;Input: DGX2 = X2 array as documented for Fileman new style x-refs
  1. ;Input: DGOPT = current option in "option_name^menu_text" format
  1. ;
  1. ;This utility invokes the DG FIELD MONITOR event point protocol.
  1. ;The DG variables as described above are made available to the
  1. ;subscribers of this event point.
  1. ;
  1. ;NOTE: This event point is not invoked if the action type is "KILL"
  1. ; and the old field value is null or the new value is not null.
  1. ; It is not invoked if the action type is "SET" and the new
  1. ; field value is null.
  1. ;
  1. Q:DGX="" ;Quit if setting or killing null value
  1. ;
  1. I DGTYPE="KILL",DGX2]"" Q ;Skip kill action on data update
  1. ;
  1. ;Manipulate DGTYPE value
  1. S DGTYPE=$S(DGTYPE="KILL":"DELETE",DGTYPE="SET":"ADD",1:DGTYPE)
  1. I DGX1]"",DGX2]"" S DGTYPE="UPDATE"
  1. ;
  1. S DGOPT=$P(DGOPT,U,1,2) S:DGOPT="" DGOPT="-1^Unknown" ;Current option
  1. ; **825,MPIC_2114
  1. ;see if in reg option and save off values before getting into taskman task job and out of line with reg option
  1. I $$REG^VAFCDD01() D Q
  1. .I (DGFIELD=994)!(DGFIELD=.525)!(DGFIELD=.0906)!(DGFIELD=.121)!(DGFIELD=.133)!(DGFIELD=.134) S VAFCFLDS(DGFIELD_";")=""
  1. .;The fields below ARE multiples
  1. .I DGFILE=2.01 S VAFCF="1;" S VAFCFLDS(VAFCF)="" ;ALIAS
  1. .I DGFILE=2.02 S VAFCF="2.02,.01;" S VAFCFLDS(VAFCF)="" ;RACE INFORMATION
  1. .I DGFILE=2.06 S VAFCF="2.06,.01;" S VAFCFLDS(VAFCF)="" ;ETHNICITY INFORMATION
  1. ;
  1. ;Task off (Taskman) driver routine.
  1. N ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSAVE,ZTSK,DGVAR,BXREF,SUBSCR,ZTREQ
  1. S ZTRTN="INIT^DGFCPROT",ZTDESC="DG Field monitor task"
  1. S ZTIO="DG FIELD MONITOR",ZTDTH=$$NOW^XLFDT
  1. F DGVAR="DGDA","DGDA(","DGFILE","DGFIELD","DGTYPE","DGDTH","DGUSER","DGX","DGX(","DGX1","DGX1(","DGX2","DGX2(","DGOPT" S ZTSAVE(DGVAR)=""
  1. ;If there are no subscribers, do not call Taskman
  1. I $D(VAFCA08) S ZTSAVE("VAFCA08")=VAFCA08 ;**707
  1. I $D(VAFHCA08) S ZTSAVE("VAFHCA08")=VAFHCA08 ;**707
  1. S BXREF=0,BXREF=$O(^ORD(101,"B","DG FIELD MONITOR",BXREF))
  1. S SUBSCR=0,SUBSCR=$O(^ORD(101,BXREF,10,SUBSCR))
  1. I 'SUBSCR Q
  1. D ^%ZTLOAD
  1. Q
  1. ;
  1. INIT N X
  1. S X=$O(^ORD(101,"B","DG FIELD MONITOR",0))_";ORD(101," D EN1^XQOR
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. K DGDA,DGFILE,DGFIELD,DGTYPE,DGDTH,DGUSER,DGX,DGX1,DGX2,DGOPT
  1. Q