source: WorldVistAEHR/trunk/r/HEALTHEVET_DESKTOP-XHD/XHDX.m@ 1154

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1XHDX ; SLC/JER - Desktop Config Calls ; 01 Aug 2003 12:18 AM
2 ;;1.0;HEALTHEVET DESKTOP;;Jul 15, 2003
3PERSEL(LST) ; List perspectives for a user
4 N OPT,X,I
5 S OPT=$$GET^XPAR($$ENTSTR,"XHD PRISM PERSPECTIVE SELECTOR",1,"I")
6 Q:'OPT
7 S I=0 F S I=$O(^DIC(19,+OPT,10,I)) Q:'I D
8 . S X=^DIC(19,+OPT,10,I,0)
9 . S LST($S($P(X,U,3):$P(X,U,3),1:99999+I))=$P(^DIC(19,+X,0),U,2)
10 Q
11ENTSTR() ; Build entities string
12 Q "ALL^USR.`"_DUZ_$S(+$G(^VA(200,DUZ,5)):"^SRV.`"_+$G(^(5)),1:"")
13VERSRV(LST,OPT) ; Return option versions
14 N I,X
15 S I=0 F S I=$O(OPT(I)) Q:'I D
16 . N XHDLST
17 . S X=$P(OPT(I),U),LST(I)=X
18 . D FIND^DIC(19,"",1,"X",X,1,,,,"XHDLST")
19 . I 'XHDLST("DILIST",0) Q
20 . S $P(LST(I),U,2)=$RE($P($RE(XHDLST("DILIST","ID",1,1))," ",1))
21 Q
22ASSIGN ; Assign perspectives to users
23 N DIC,DONE,X,Y,USR,OPT,ANERR,CUR,CURNM,REP,DIR,DIRUT,DUOUT,DTOUT
24 S DIC=19,DIC(0)="AEMQ",DIC("A")="Select Perspective Option: "
25 D ^DIC Q:Y<1 S OPT=+Y
26 W !!,"Assigning "_$P(Y,U,2)_" to Users"
27 S DONE=0 F D Q:DONE
28 . S DIC=200,DIC(0)="AEMQ",DIC("A")="Assign to: "
29 . D ^DIC I Y<1 S DONE=1 Q
30 . S USR=+Y
31 . S CUR=+$$GET^XPAR(USR_";VA(200,","XHD PRISM PERSPECTIVE SELECTOR",1)
32 . I +CUR,(CUR'=OPT) D Q:'REP
33 . . S CURNM=$$GET^XPAR(USR_";VA(200,","XHD PRISM PERSPECTIVE SELECTOR",1,"E")
34 . . S DIR(0)="Y",DIR("A")="Currently Assigned "_CURNM_". Replace",DIR("B")="Y"
35 . . D ^DIR S REP=Y
36 . D EN^XPAR(USR_";VA(200,","XHD PRISM PERSPECTIVE SELECTOR",1,"`"_OPT,.ANERR)
37 . I ANERR W !,$P(ANERR,U,2)
38 . D CHKCTXT(OPT,USR)
39 Q
40CHKCTXT(OPT,USR) ; Check context
41 N HASOPT,ALLCTXT
42 S HASOPT=$$ACCESS^XQCHK(USR,OPT)
43 I +HASOPT<1 D
44 . S ALLCTXT=$$FIND1^DIC(19,"","QX","ORRCM CLIENT")
45 . S HASOPT=$$ACCESS^XQCHK(USR,ALLCTXT)
46 I +HASOPT<1 D
47 . N USRNM,OPTNM
48 . S USRNM=$$GET1^DIQ(200,USR_",",.01)
49 . S OPTNM=$$GET1^DIQ(19,OPT_",",.01)
50 . W !,USRNM_" does not have the "_OPTNM_" in the menu tree."
51 . W !,"You many need to add this as a secondary menu for this user.",!
52 Q
53BYUSR ; Assign a perspective to a single user
54 N DIC,DIR,DIRUT,DUOUT,DTOUT,X,Y,USR,OPT,ANERR
55 S DIC=200,DIC(0)="AEMQ" ;,DIC("A")="Assign to: "
56 D ^DIC Q:Y<1 S USR=+Y
57 S DIR(0)="PAO^19:EM",DIR("A")="Select Perspective Option: "
58 S DIR("B")=$$GET^XPAR(USR_";VA(200,","XHD PRISM PERSPECTIVE SELECTOR",1,"E")
59 I DIR("B")="" K DIR("B")
60 D ^DIR
61 S OPT="" S:(Y<1)&(X="@") OPT="@" S:+Y>0 OPT="`"_+Y
62 Q:OPT=""
63 D EN^XPAR(USR_";VA(200,","XHD PRISM PERSPECTIVE SELECTOR",1,OPT,.ANERR)
64 I ANERR W !,$P(ANERR,U,2)
65 S OPT=+$P(OPT,"`",2) I OPT D CHKCTXT(OPT,USR)
66 Q
67BYSVC ; Assign a perspective to a service
68 N DIC,DIR,DIRUT,DUOUT,DTOUT,X,Y,SVC,SVCNM,OPT,OPTNM,ANERR
69 S DIC=49,DIC(0)="AEMQ"
70 D ^DIC Q:Y<1 S SVC=+Y,SVCNM=$P(Y,U,2)
71 S DIR(0)="PAO^19:EM",DIR("A")="Select Perspective Option: "
72 S DIR("B")=$$GET^XPAR(SVC_";DIC(49,","XHD PRISM PERSPECTIVE SELECTOR",1,"E")
73 I DIR("B")="" K DIR("B")
74 D ^DIR
75 S OPT="" S:(Y<1)&(X="@") OPT="@" S:+Y>0 OPT="`"_+Y S OPTNM=$P(Y,U,2)
76 Q:OPT=""
77 D EN^XPAR(SVC_";DIC(49,","XHD PRISM PERSPECTIVE SELECTOR",1,OPT,.ANERR)
78 I ANERR W !,$P(ANERR,U,2)
79 I 'ANERR,(+$P(OPT,"`",2)) D
80 . W !,OPTNM_" has been set for "_SVCNM_"."
81 . W !,"Note: "_OPTNM_" must also be available in each user's menu tree."
82 Q
Note: See TracBrowser for help on using the repository browser.