source: FOIAVistA/trunk/r/BAR_CODE_MED_ADMIN-ALPB-PSB/PSBPAR.m

Last change on this file was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1PSBPAR ;BIRMINGHAM/EFC-BCMA PARAMETER MANAGEMENT ;Mar 2004
2 ;;3.0;BAR CODE MED ADMIN;**13**;Mar 2004
3 ;
4EN ; Standard editting of parameters
5 K PSBDIV,PSBLIST,DIC
6 W !!,"BCMA Parameters Management",!!
7 W "You are currently logged onto Division: "_DUZ(2)
8 S DIC="^DIC(4,",DIC(0)="AEQM",DIC("A")="Select Division: " D ^DIC Q:+Y<1
9 S PSBDIV=+Y_";DIC(4,"
10 K DIR S DIR(0)="Y",DIR("A")="Edit Divisional Parameters",DIR("B")="Yes"
11 D ^DIR K DIR I Y D TED^XPAREDIT("PSB DIVISION","AB",PSBDIV)
12 K DIR S DIR(0)="Y",DIR("A")="Edit Default Lists",DIR("B")="Yes"
13 D ^DIR K DIR D:Y
14 .S DIR(0)="SO^1:Reasons Given PRN;2:Reasons Held;3:Reasons Refused;4:Injection Sites"
15 .S DIR("A")="Select Default List"
16 .F W @IOF,!,"BCMA Default Lists",! D ^DIR Q:'Y D
17 ..N DIR
18 ..I Y=1 D TED^XPAREDIT("PSB LIST REASONS GIVEN PRN","AB",PSBDIV) Q
19 ..I Y=2 D TED^XPAREDIT("PSB LIST REASONS HELD","AB",PSBDIV) Q
20 ..I Y=3 D TED^XPAREDIT("PSB LIST REASONS REFUSED","AB",PSBDIV) Q
21 ..I Y=4 D TED^XPAREDIT("PSB LIST INJECTION SITES","AB",PSBDIV) Q
22 Q
23 ;
24RPC(RESULTS,PSBCMD,PSBENT,PSBPAR,PSBINS,PSBVAL) ; Main RPC Hit Point
25 ;
26 ; RPC: PSB PARAMETER
27 ;
28 ; Description:
29 ; Called by client to return or set parameters
30 ;
31 N PSBERR,PSBTMP
32 D:PSBCMD="GETPAR" GETPAR(PSBENT,PSBPAR)
33 D:PSBCMD="GETLST" GETLST(PSBENT,PSBPAR)
34 D:PSBCMD="SETPAR" SETPAR(PSBENT,PSBPAR,PSBINS,PSBVAL)
35 D:PSBCMD="DELLST" DELLST(PSBENT,PSBPAR)
36 D:PSBCMD="GETDIV" GETDIV(PSBENT)
37 S:'$D(RESULTS) RESULTS(0)="-1^Unknown Internal Error "_PSBCMD
38 Q
39 ;
40GETDIV(PSBENT) ; Return a valid Entity pointer from user input
41 S X=$$FIND1^DIC(4,"","MX",PSBENT)
42 I +X<1 S RESULTS(0)="-1^Error, Station # "_PSBENT_" not found." Q
43 S RESULTS(0)="1^"_(+X)_";DIC(4,"
44 S RESULTS(1)=$$GET1^DIQ(4,+X_",",.01)_" ("_$$GET1^DIQ(4,+X_",",99)_")"
45 S RESULTS(2)=$$GET1^DIQ(4,+X_",",1.01)
46 S RESULTS(3)=$$GET1^DIQ(4,+X_",",1.02)
47 S RESULTS(4)=$$GET1^DIQ(4,+X_",",1.03)
48 S RESULTS(5)=$$GET1^DIQ(4,+X_",",.02)
49 S RESULTS(6)=$$GET1^DIQ(4,+X_",",1.04)
50 S PSBEDIV=+X ;do NOT kill this variable - needed until gui context ends
51 Q
52 ;
53GETPAR(PSBENT,PSBPAR) ; Return a parameter
54 S RESULTS(0)=$$GET^XPAR(PSBENT,PSBPAR,,"B")
55 Q
56 ;
57GETLST(PSBENT,PSBPAR) ; Return a parameter list
58 D GETLST^XPAR(.PSBTMP,PSBENT,PSBPAR,,.PSBERR)
59 I PSBERR S RESULTS(0)="-1^Error: "_(+PSBERR)_" "_$P(PSBERR,"^",2) Q
60 S RESULTS(0)=PSBTMP
61 F Y=0:0 S Y=$O(PSBTMP(Y)) Q:'Y S RESULTS(Y)=$P(PSBTMP(Y),"^",2)
62 Q
63 ;
64SETPAR(PSBENT,PSBPAR,PSBINS,PSBVAL) ; Set a new parameter
65 D EN^XPAR(PSBENT,PSBPAR,PSBINS,PSBVAL,.PSBERR)
66 I 'PSBERR S RESULTS(0)="1^Success"
67 E S RESULTS(0)="-1^Error: "_(+PSBERR)_" "_$P(PSBERR,"^",2)
68 Q
69 ;
70DELLST(PSBENT,PSBPAR) ; Clear a list
71 D NDEL^XPAR(PSBENT,PSBPAR,.PSBERR)
72 I 'PSBERR S RESULTS(0)="1^Success"
73 E S RESULTS(0)="-1^Error: "_(+PSBERR)_" "_$P(PSBERR,"^",2)
74 Q
75 ;
76USRDEF(PSBPAR) ; Return a parameter for the user
77 Q $$GET^XPAR("ALL",PSBPAR)
78 ;
79RSTUSR ; Reset all a users parameters
80 N PSBUSR,PSBENT,RESULTS
81 S DIC="^VA(200,",DIC(0)="AEQM",DIC("A")="Select User to Reset: "
82 D ^DIC K DIC Q:+Y<1 S PSBUSR=+Y
83 W !!,"Are you sure you want to reset all parameters for this user"
84 S %=2 D YN^DICN Q:%'=1
85 W !,"Resetting..."
86 S PSBENT=PSBUSR_";VA(200,"
87 D DEL^XPAR(PSBENT,"PSB PRINTER USER DEFAULT",1)
88 D DEL^XPAR(PSBENT,"PSB VDL INCL BLANKS",1)
89 D DEL^XPAR(PSBENT,"PSB VDL INCL CONT",1)
90 D DEL^XPAR(PSBENT,"PSB VDL INCL IV MEDS",1)
91 D DEL^XPAR(PSBENT,"PSB VDL INCL ON-CALL",1)
92 D DEL^XPAR(PSBENT,"PSB VDL INCL ONE-TIME",1)
93 D DEL^XPAR(PSBENT,"PSB VDL INCL PRN",1)
94 D DEL^XPAR(PSBENT,"PSB VDL INCL UD MEDS",1)
95 D DEL^XPAR(PSBENT,"PSB VDL START TIME",1)
96 D DEL^XPAR(PSBENT,"PSB VDL STOP TIME",1)
97 D DEL^XPAR(PSBENT,"PSB WINDOW",1)
98 D DEL^XPAR(PSBENT,"PSB UNIT DOSE COLUMN WIDTHS",1)
99 D DEL^XPAR(PSBENT,"PSB VDL SORT COLUMN",1)
100 D DEL^XPAR(PSBENT,"PSB VDL PB SORT COLUMN",1)
101 D DEL^XPAR(PSBENT,"PSB VDL IV SORT COLUMN",1)
102 D DEL^XPAR(PSBENT,"PSB IV COLUMN WIDTHS",1)
103 D DEL^XPAR(PSBENT,"PSB IVPB COLUMN WIDTHS",1)
104 D DEL^XPAR(PSBENT,"PSB HKEY",1)
105 D DEL^XPAR(PSBENT,"PSB IDLE TIMEOUT",1)
106 D DEL^XPAR(PSBENT,"PSB GUI DEFAULT PRINTER",1)
107 D DEL^XPAR(PSBENT,"PSB COVERSHEET VIEWS COL SORT",1)
108 D DEL^XPAR(PSBENT,"PSB COVERSHEET V1 COL WIDTHS",1)
109 D DEL^XPAR(PSBENT,"PSB COVERSHEET V2 COL WIDTHS",1)
110 D DEL^XPAR(PSBENT,"PSB COVERSHEET V3 COL WIDTHS",1)
111 D DEL^XPAR(PSBENT,"PSB COVERSHEET V4 COL WIDTHS",1)
112 W "Done.",!
113 Q
114 ;
Note: See TracBrowser for help on using the repository browser.