source: WorldVistAEHR/trunk/r/ASISTS-OOPS/OOPSPRT2.m@ 1663

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1OOPSPRT2 ;HINES/WAA-Print CA1/CA2 Routines ;3/24/98
2 ;;2.0;ASISTS;;Jun 03, 2002
3 ;;
4 ; This routine is to display all the report that a person has
5 ; access to.
6EN1(CALLER) ;
7 ; Input:
8 ; Caller O = Safety Officer
9 ; S = Supervisor
10 ; E = Employee
11 ;
12 N OUT,CASE,FORM
13 S OUT=0
14 S IEN=$$SELECT(CALLER) Q:IEN="0"
15 I IEN="-1" S CASE="",FORM=$$FORM Q:FORM="-1"
16 E S CASE=$P(IEN,U,2),FORM="CA"_$$GET1^DIQ(2260,+IEN,52,"I")
17 D PRINT
18 D EXIT
19 Q
20EXIT ;
21 K IO("Q")
22 Q
23FORM() ;Select a form to print
24 N FORM
25 ; Injury CA1
26 ; Illness CA2
27 N DIR,Y
28 W !," 1) Injury (CA1)"
29 W !," 2) Illness (CA2)"
30 W !
31 S DIR(0)="SAO^1:CA1;2:CA2"
32 S DIR("A")="Select Form: "
33 S DIR("?")="Select the form to be printed."
34 D ^DIR
35 I '$D(Y(0)) S FORM="-1"
36 E S FORM=Y(0)
37 Q FORM
38SELECT(CALLER) ; Select a case to print
39 ;INPUT:
40 ; CALLER = "E" FOR EMPLOYEE
41 ; = "S" FOR SUPERVISOR
42 ; = "O" FOR SAFETY OFFICER
43 N SSN,IEN,CASE
44 S IEN=0,CASE=""
45 I $G(DUZ)<1 Q "0" ; Bad or no DUZ
46 I $G(^VA(200,DUZ,1))="" Q "0" ; Person is not a valid user in 200
47 I CALLER="E" D I CASE="0" Q "0" ; Setup SSN
48 .S SSN=$P(^VA(200,DUZ,1),U,9)
49 .I $D(^OOPS(2260,"SSN",SSN))<1 S CASE="0" ; Ensure entry is in 2260
50 .Q
51 D
52 .N DIC,X,Y
53 .S DIC="^OOPS(2260,"
54 .I CALLER="E" S DIC("S")="I $$EMP^OOPSPRT2(Y)"
55 .I CALLER="S" S DIC("S")="I $$SUP^OOPSPRT2(Y)"
56 .I CALLER="O" S DIC("S")="I $$SAF^OOPSPRT2(Y)"
57 .S DIC(0)="AEMNZ",DIC("A")=" Select Case: "
58 .D ^DIC
59 .I $D(DTOUT)!($D(DUOUT)) S Y=0
60 .S CASE=Y
61 .Q
62 Q CASE
63EMP(IEN) ; Employee
64 N VIEW
65 S VIEW=1
66 I $$GET1^DIQ(2260,Y,51,"I")=2 S VIEW=0
67 I '$$EMP^OOPSUTL1(IEN,SSN,1) S VIEW=0
68 Q VIEW
69SUP(IEN) ; Supervisor
70 N VIEW
71 S VIEW=1
72 I $$GET1^DIQ(2260,Y,51,"I")=2 S VIEW=0
73 I $$GET1^DIQ(2260,IEN,53,"I")'=DUZ,$$GET1^DIQ(2260,IEN,53.1,"I")'=DUZ S VIEW=0
74 Q VIEW
75SAF(IEN) ; Safety Officer
76 N VIEW
77 S VIEW=1
78 I $$GET1^DIQ(2260,Y,51,"I")=2 S VIEW=0
79 Q VIEW
80DEVICE ; This is the device selection routine.
81 ;
82 S %ZIS="QM" D ^%ZIS I POP S OUT=1 Q
83 I $D(IO("Q")) D Q
84 .S ZTRTN="PRINT^OOPSPRT2",ZTDESC="Print a "_FORM
85 .S ZTSAVE("OUT")=""
86 .S ZTSAVE("CASE")=""
87 .S ZTSAVE("FORM")=""
88 .D ^%ZTLOAD D HOME^%ZIS Q
89 .Q
90 Q
91PRINT ; This is the main print portion of the routine
92 I FORM="CA1" S FORM="CA-1"
93 I FORM="CA2" S FORM="CA-2"
94 D EN1^OOPSPCA(CASE,FORM)
95 Q
96END ; exit the report
97 D ^%ZISC
98 S:$D(ZTQUEUED) ZTREQ="@"
99 Q
Note: See TracBrowser for help on using the repository browser.