source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUHUI.m@ 1582

Last change on this file since 1582 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1XUHUI ;SFISC/SO-Main Field Event Trigger Routine ;1:05 PM 7 Nov 2002
2 ;;8.0;KERNEL;**236,266**;Jul 10, 1995
3 ;This routine comprised three(3) entry points:
4 ;HUI(), HUIKEY(), and OPKG()
5 ;
6 ;PCHK1: Is the business rules check used for the top level for file
7 ;#200, called from AXUHUI xref.
8 ;
9 ;PCHK2: Is the business rules check ussed for the KEYS multiple
10 ;sub-file #200.051
11 ;
12 ;GETVAR: Sets up the variables that are passed thru
13 ;TaskMan to the various options that are to be unwound.
14 ;
15 ;TASK: Sets up the variable list that is to be passed
16 ;thru TaskMan and tasks the job.
17 ;
18 ;CLEAN: Kills any Name Spaced variables that are not implisivly Newed
19 ;
20HUI(XUHUIOP,XUHUINM,XUHUIA,XUHUIXR) ;This is the HUI Entry Point
21 ;XUHUIOP tells the Unwinder to use either 101 for Protocol file or
22 ; 19 for Option file, default = 101
23 ;XUHUINM is the Name(#.01) value of the option to launched
24 ;XUHUIA is a code S = Set xref; K = Kill xref; default = S
25 ;XUHUIXR is the name of the xref
26 ;
27 N ESC S ESC=0
28 D PCHK1 Q:ESC
29 D GETVAR
30 D TASK
31 D CLEAN
32 Q
33 ;
34GETVAR ; Get the variables that are to be passed via Taskman
35 S XUHUIFIL=DIFILE ;File #, IA #3586
36 I $D(DIFLD) M XUHUIFLD=DIFLD ;Field #, IA# 3586
37 I '$D(DIFLD) S XUHUIFLD=""
38 S XUHUIXR=$G(XUHUIXR)
39 M XUHUIDA=DA ;IEN(s) of record, IA# 3586
40 M XUHUIX=X ;New Style 'X' array
41 M XUHUIX1=X1
42 M XUHUIX2=X2
43 Q
44 ;
45TASK ;Creat a task
46 ;Check to see if Protocol DISABLED ;266
47 N ESC
48 S ESC=0
49 I 'XUHUIOP D Q:ESC
50 . N IEN,DISABLE
51 . D CLEAN^DILF
52 . S IEN=$$FIND1^DIC(101,"","X",XUHUINM)
53 . I $D(DIERR) D CLEAN^DILF S ESC=1 Q
54 . D CLEAN^DILF
55 . S DISABLE=$$GET1^DIQ(101,IEN_",",2)
56 . I $D(DIERR) D CLEAN^DILF S ESC=1 Q
57 . D CLEAN^DILF
58 . I DISABLE'="" S ESC=1 ;Protocol is DISABLED
59 . Q
60 N ZTSAVE,ZTDTH,ZTIO,ZTRTN,ZTDESC,ZTREQ,ZTSK ;266
61 S XUHUIA=$S('$D(XUHUIA):"S",XUHUIA="":"S",1:XUHUIA)
62 S ZTSAVE("XUHUIA")=""
63 S ZTSAVE("XUHUIFIL")=""
64 S ZTSAVE("XUHUIFLD")=""
65 S ZTSAVE("XUHUIXR")=""
66 S ZTSAVE("XUHUIDA*")=""
67 S ZTSAVE("XUHUIX*")=""
68 S ZTSAVE("XUHUINM")="" ;Name of top level Protocol or Option
69 S XUHUIOP=$S('$D(XUHUIOP):101,XUHUIOP="":101,1:XUHUIOP)
70 S ZTSAVE("XUHUIOP")=""
71 S ZTDTH=$H,ZTIO="",ZTRTN="DEQUE^XUHUI",ZTREQ="@"
72 S ZTDESC="TASKED FIELD CHANGED EVENT ("_$S(XUHUIA="S":"SET)",1:"KILL)")
73 D ^%ZTLOAD
74 Q
75 ;
76DEQUE ;From: TaskMan
77 S X=XUHUINM
78 S DIC=$S(XUHUIOP=101:"^ORD(101,",XUHUIOP=19:"^DIC(19,",1:"")
79 D EN^XQOR
80 D CLEAN ; Kill off XUHUI* variables that are passed via Taskman
81 Q
82 ;
83HUIKEY(XUHUIOP,XUHUINM,XUHUIA,XUHUIXR) ;HUI Key check Entry Point
84 ;XUHUIOP tells the Unwinder to use either 101 for Protocol file or
85 ; 19 for Option file, default = 101
86 ;XUHUINM is the Name(#.01) value of the option to launched
87 ;XUHUIA is a code S = Set xref; K = Kill xref; default = S
88 ;XUHUIXR is the name of the xref
89 N ESC S ESC=0
90 D PCHK2 Q:ESC
91 D GETVAR
92 D TASK
93 D CLEAN
94 Q
95 ;
96OPKG(XUHUIOP,XUHUINM,XUHUIA,XUHUIXR) ;All Other Package Entry Point
97 ;XUHUIOP tells the Unwinder to use either 101 for Protocol file or
98 ; 19 for Option file, default = 101
99 ;XUHUINM is the Name(#.01) value of the option to launched
100 ;XUHUIA is a code S = Set xref; K = Kill xref; default = S
101 ;XUHUIXR is the name of the xref
102 D GETVAR
103 D TASK
104 D CLEAN
105 Q
106 ;
107PCHK1 ;
108 I '$D(^XUSEC("PROVIDER",DA))#2 S ESC=1 Q ;User is not a Provider
109 Q
110 ;
111PCHK2 ;
112 I $P($G(^DIC(19.1,DA,0)),"^")'="PROVIDER" S ESC=1 Q ;Key Not the PROVIDER key ;266
113 Q
114 ;
115CLEAN ;Kill of XUHUI variables
116 K XUHUIFIL,XUHUIFLD,XUHUIDA,XUHUIX,XUHUIX1,XUHUIX2
117 Q
Note: See TracBrowser for help on using the repository browser.