source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMEXLI.m@ 1261

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

revised back to 6/30/08 version

File size: 4.9 KB
Line 
1PXRMEXLI ; SLC/PKR - List Manager routines for repository entry install. ;01/10/2003
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4 ;================================================
5INSALL ;Install all components in a repository entry.
6 N IND,INSTALL
7 K ^TMP("PXRMEXIA",$J)
8 ;Set the install date and time.
9 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
10 ;Initialize the name change storage.
11 K PXRMNMCH
12 S (IND,INSTALL,PXRMDONE)=0
13 F S IND=$O(^TMP("PXRMEXLC",$J,"SEL",IND)) Q:(+IND=0)!(PXRMDONE) D
14 . D INSCOM(IND,.INSTALL)
15 ;
16 ;If anything was installed rebuild the display.
17 I INSTALL D CDISP^PXRMEXLC(PXRMRIEN)
18 ;
19 ;Save the install history in the repository.
20 D SAVHIST^PXRMEXU1
21 Q
22 ;
23 ;================================================
24INSCOM(IND,INSTALL) ;Install component IND.
25 ;PXRMRIEN is not passed because this is invoked by the ListManger
26 ;action to install a repository entry.
27 N ACTION,ATTR,END,EXISTS,FIELDNUM,FILENUM,IND120,JND120
28 N NEWNAME,NEWPT01,PT01,RTN,START,TEMP,TEMP0
29 S TEMP=^TMP("PXRMEXLC",$J,"SEL",IND)
30 S FILENUM=$P(TEMP,U,1)
31 S EXISTS=$P(TEMP,U,4)
32 ;Dialogs use their own installation screen.
33 I FILENUM=801.41 D Q
34 . D START^PXRMEXLD
35 . S VALMBCK="R"
36 S IND120=$P(TEMP,U,2)
37 S JND120=$P(TEMP,U,3)
38 S TEMP=^PXD(811.8,PXRMRIEN,120,IND120,1,JND120,0)
39 S START=$P(TEMP,U,2)
40 S END=$P(TEMP,U,3)
41 S TEMP=^PXD(811.8,PXRMRIEN,100,START,0)
42 ;Go to full screen mode.
43 D FULL^VALM1
44 I ((FILENUM=0)!(FILENUM=811.4)),DUZ(0)'="@" D Q
45 . I FILENUM=0 W !,"Only programmers can install routines."
46 . I FILENUM=811.4 W !,"Only programmers can install Reminder Computed Findings."
47 . H 2
48 . S VALMBCK="R"
49 I FILENUM=0 D
50 . D RTNLD^PXRMEXIC(PXRMRIEN,START,END,.ATTR,.RTN)
51 . S ACTION=$$GETRACT^PXRMEXCF(.ATTR,.NEWNAME,.PXRMNMCH,.RTN,EXISTS)
52 .;Save what was done for the installation summary.
53 . S ^TMP("PXRMEXIA",$J,IND,"ROUTINE",ATTR("NAME"),ACTION)=NEWNAME
54 E D
55 .;Make sure we have the .01, some files have .001.
56 . S TEMP0=$P(TEMP,";",3)
57 . S FIELDNUM=$P(TEMP0,"~",1)
58 . I FIELDNUM=.001 S TEMP=^PXD(811.8,PXRMRIEN,100,(START+1),0)
59 . S PT01=$P(TEMP,"~",2)
60 . D SETATTR^PXRMEXFI(.ATTR,FILENUM)
61 . S ACTION=$$GETFACT^PXRMEXFI(PT01,.ATTR,.NEWPT01,.PXRMNMCH,EXISTS)
62 .;Save what was done for the installation summary.
63 . S ^TMP("PXRMEXIA",$J,IND,ATTR("FILE NAME"),ATTR("PT01"),ACTION)=NEWPT01
64 ;If the ACTION is Quit then quit the entire install.
65 I ACTION="Q" S PXRMDONE=1 Q
66 ;If the ACTION is Skip then skip this component.
67 I ACTION="S" S VALMBCK="R" Q
68 ;If the ACTION is rePlace then skip this component.
69 I ACTION="P" S VALMBCK="R" Q
70 ;Install this component.
71 I FILENUM=0 D
72 . S NEWPT01=$G(PXRMNMCH(ATTR("FILE NUMBER"),ATTR("NAME")))
73 . I NEWPT01="" S NEWPT01=ATTR("NAME")
74 . D RTNSAVE^PXRMEXIC(.RTN,NEWPT01)
75 . S INSTALL=1
76 E D
77 . D FILE^PXRMEXIC(PXRMRIEN,EXISTS,IND120,JND120,ACTION,.ATTR,.PXRMNMCH)
78 . S INSTALL=1
79 S VALMBCK="R"
80 Q
81 ;
82 ;================================================
83INSSEL ;Get a list of components to install.
84 N IND,INSTALL,VALMBG,VALMLST,VALMY
85 ;
86 S VALMBG=1,VALMLST=+$O(^TMP("PXRMEXLC",$J,"IDX",""),-1)
87 ;
88 ;Get the list to install.
89 D EN^VALM2(XQORNOD(0))
90 ;If there is no list quit.
91 I '$D(VALMY) Q
92 ;
93 K ^TMP("PXRMEXIA",$J)
94 ;Set the install date and time.
95 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
96 ;
97 ;Initialize the name change storage.
98 K PXRMNMCH
99 S (IND,INSTALL)=0
100 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D
101 .D INSCOM(IND,.INSTALL)
102 ;
103 ;If anything was installed rebuild the display.
104 I INSTALL D CDISP^PXRMEXLC(PXRMRIEN)
105 ;
106 ;Save the install history in the repository.
107 D SAVHIST^PXRMEXU1
108 Q
109 ;
110 ;================================================
111INSTALL ;Install the repository entry PXRMRIEN.
112 N IEN,IND,VALMY
113 ;Make sure the component list exists for this entry. PXRMRIEN is
114 ;set in INSTALL^PXRMEXLR.
115 I '$D(^PXD(811.8,PXRMRIEN,120)) D CLIST^PXRMEXU1(.PXRMRIEN)
116 I PXRMRIEN=-1 Q
117 ;Format the component list for display.
118 D CDISP^PXRMEXLC(PXRMRIEN)
119 S VALMCNT=$O(^TMP("PXRMEXLC",$J,"IDX"),-1)
120 S VALMBCK="R"
121 D XQORM
122 Q
123 ;
124 ;Exit action added to PXRM EXCH INSTALL MENU
125PEXIT ;PXRM EXCH INSTALL MENU protocol exit code
126 S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
127 ;Reset after page up/down etc
128 D XQORM
129 Q
130 ;
131XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT COMPONENT",0))_U_"1:"_VALMCNT
132 S XQORM("A")="Select Action: "
133 Q
134 ;
135XSEL ;PXRM EXCH SELECT COMPONENT validation
136 N CNT,SELECT,SEL,PXRMDONE
137 S SELECT=$P(XQORNOD(0),"=",2)
138 I '$$VALID^PXRMEXLD(SELECT) S VALMBCK="R" Q
139 ;
140 ;Sort selections into ascending sequence order
141 D ORDER^PXRMEXLD(.SELECT,1)
142 ;
143 K ^TMP("PXRMEXIA",$J)
144 ;Set the install date and time.
145 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
146 ;
147 ;Install selected component
148 N INSTALL
149 S INSTALL=0,CNT=0,PXRMDONE=0
150 F CNT=1:1 S SEL=$P(SELECT,",",CNT) Q:'SEL D Q:PXRMDONE
151 . D INSCOM(SEL,.INSTALL)
152 ;
153 ;If anything was installed rebuild the display.
154 I INSTALL D CDISP^PXRMEXLC(PXRMRIEN)
155 ;
156 ;Save the install history in the repository.
157 D SAVHIST^PXRMEXU1
158 ;
159 ;Clear any renames made in the last session
160 K PXRMNMCH
161 Q
Note: See TracBrowser for help on using the repository browser.