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

XUHUI.m

Go to the documentation of this file.
  1. XUHUI ;SFISC/SO-Main Field Event Trigger Routine ;1:05 PM 7 Nov 2002
  1. ;;8.0;KERNEL;**236,266**;Jul 10, 1995
  1. ;This routine comprised three(3) entry points:
  1. ;HUI(), HUIKEY(), and OPKG()
  1. ;
  1. ;PCHK1: Is the business rules check used for the top level for file
  1. ;#200, called from AXUHUI xref.
  1. ;
  1. ;PCHK2: Is the business rules check ussed for the KEYS multiple
  1. ;sub-file #200.051
  1. ;
  1. ;GETVAR: Sets up the variables that are passed thru
  1. ;TaskMan to the various options that are to be unwound.
  1. ;
  1. ;TASK: Sets up the variable list that is to be passed
  1. ;thru TaskMan and tasks the job.
  1. ;
  1. ;CLEAN: Kills any Name Spaced variables that are not implisivly Newed
  1. ;
  1. HUI(XUHUIOP,XUHUINM,XUHUIA,XUHUIXR) ;This is the HUI Entry Point
  1. ;XUHUIOP tells the Unwinder to use either 101 for Protocol file or
  1. ; 19 for Option file, default = 101
  1. ;XUHUINM is the Name(#.01) value of the option to launched
  1. ;XUHUIA is a code S = Set xref; K = Kill xref; default = S
  1. ;XUHUIXR is the name of the xref
  1. ;
  1. N ESC S ESC=0
  1. D PCHK1 Q:ESC
  1. D GETVAR
  1. D TASK
  1. D CLEAN
  1. Q
  1. ;
  1. GETVAR ; Get the variables that are to be passed via Taskman
  1. S XUHUIFIL=DIFILE ;File #, IA #3586
  1. I $D(DIFLD) M XUHUIFLD=DIFLD ;Field #, IA# 3586
  1. I '$D(DIFLD) S XUHUIFLD=""
  1. S XUHUIXR=$G(XUHUIXR)
  1. M XUHUIDA=DA ;IEN(s) of record, IA# 3586
  1. M XUHUIX=X ;New Style 'X' array
  1. M XUHUIX1=X1
  1. M XUHUIX2=X2
  1. Q
  1. ;
  1. TASK ;Creat a task
  1. ;Check to see if Protocol DISABLED ;266
  1. N ESC
  1. S ESC=0
  1. I 'XUHUIOP D Q:ESC
  1. . N IEN,DISABLE
  1. . D CLEAN^DILF
  1. . S IEN=$$FIND1^DIC(101,"","X",XUHUINM)
  1. . I $D(DIERR) D CLEAN^DILF S ESC=1 Q
  1. . D CLEAN^DILF
  1. . S DISABLE=$$GET1^DIQ(101,IEN_",",2)
  1. . I $D(DIERR) D CLEAN^DILF S ESC=1 Q
  1. . D CLEAN^DILF
  1. . I DISABLE'="" S ESC=1 ;Protocol is DISABLED
  1. . Q
  1. N ZTSAVE,ZTDTH,ZTIO,ZTRTN,ZTDESC,ZTREQ,ZTSK ;266
  1. S XUHUIA=$S('$D(XUHUIA):"S",XUHUIA="":"S",1:XUHUIA)
  1. S ZTSAVE("XUHUIA")=""
  1. S ZTSAVE("XUHUIFIL")=""
  1. S ZTSAVE("XUHUIFLD")=""
  1. S ZTSAVE("XUHUIXR")=""
  1. S ZTSAVE("XUHUIDA*")=""
  1. S ZTSAVE("XUHUIX*")=""
  1. S ZTSAVE("XUHUINM")="" ;Name of top level Protocol or Option
  1. S XUHUIOP=$S('$D(XUHUIOP):101,XUHUIOP="":101,1:XUHUIOP)
  1. S ZTSAVE("XUHUIOP")=""
  1. S ZTDTH=$H,ZTIO="",ZTRTN="DEQUE^XUHUI",ZTREQ="@"
  1. S ZTDESC="TASKED FIELD CHANGED EVENT ("_$S(XUHUIA="S":"SET)",1:"KILL)")
  1. D ^%ZTLOAD
  1. Q
  1. ;
  1. DEQUE ;From: TaskMan
  1. S X=XUHUINM
  1. S DIC=$S(XUHUIOP=101:"^ORD(101,",XUHUIOP=19:"^DIC(19,",1:"")
  1. D EN^XQOR
  1. D CLEAN ; Kill off XUHUI* variables that are passed via Taskman
  1. Q
  1. ;
  1. HUIKEY(XUHUIOP,XUHUINM,XUHUIA,XUHUIXR) ;HUI Key check Entry Point
  1. ;XUHUIOP tells the Unwinder to use either 101 for Protocol file or
  1. ; 19 for Option file, default = 101
  1. ;XUHUINM is the Name(#.01) value of the option to launched
  1. ;XUHUIA is a code S = Set xref; K = Kill xref; default = S
  1. ;XUHUIXR is the name of the xref
  1. N ESC S ESC=0
  1. D PCHK2 Q:ESC
  1. D GETVAR
  1. D TASK
  1. D CLEAN
  1. Q
  1. ;
  1. OPKG(XUHUIOP,XUHUINM,XUHUIA,XUHUIXR) ;All Other Package Entry Point
  1. ;XUHUIOP tells the Unwinder to use either 101 for Protocol file or
  1. ; 19 for Option file, default = 101
  1. ;XUHUINM is the Name(#.01) value of the option to launched
  1. ;XUHUIA is a code S = Set xref; K = Kill xref; default = S
  1. ;XUHUIXR is the name of the xref
  1. D GETVAR
  1. D TASK
  1. D CLEAN
  1. Q
  1. ;
  1. PCHK1 ;
  1. I '$D(^XUSEC("PROVIDER",DA))#2 S ESC=1 Q ;User is not a Provider
  1. Q
  1. ;
  1. PCHK2 ;
  1. I $P($G(^DIC(19.1,DA,0)),"^")'="PROVIDER" S ESC=1 Q ;Key Not the PROVIDER key ;266
  1. Q
  1. ;
  1. CLEAN ;Kill of XUHUI variables
  1. K XUHUIFIL,XUHUIFLD,XUHUIDA,XUHUIX,XUHUIX1,XUHUIX2
  1. Q