source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMEXSI.m@ 1608

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

revised back to 6/30/08 version

File size: 5.5 KB
RevLine 
[623]1PXRMEXSI ; SLC/PKR/PJH - Silent repository entry install. ;12/22/2004
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4 ;===================================================
5BUILD ;Build list manager workfile from ^TMP("PXRMEXTMP" (see ^PXRMEXLB)
6 N DDATA,DDLG,IND,JND,NLINE,NSEL
7 S NLINE=0,NSEL=0
8 S DDLG=$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM")) Q:DDLG=""
9 ;
10 ;Save reminder dialog
11 S DDATA=^TMP("PXRMEXTMP",$J,"DLOC",DDLG)
12 S IND=$P(DDATA,U,3),JND=$P(DDATA,U,4)
13 D DSAVE(DDLG,IND,JND)
14 ;
15 ;Process sub-components
16 I $D(^TMP("PXRMEXTMP",$J,"DREPL",DDLG))>0 D DREPL(DDLG)
17 D DCMP(DDLG)
18 Q
19 ;
20 ;===================================================
21DCMP(DLG) ;Search for dialog components
22 N DDLG,DEND,DNAM,DSEQ,DSTRT,IND,JND
23 S DSEQ=0
24 F S DSEQ=$O(^TMP("PXRMEXTMP",$J,"DMAP",DLG,DSEQ)) Q:'DSEQ D
25 . S DDATA=^TMP("PXRMEXTMP",$J,"DMAP",DLG,DSEQ)
26 . S DNAM=$P(DDATA,U),DSTRT=$P(DDATA,U,2),DEND=$P(DDATA,U,3) Q:DNAM=""
27 . S IND=$P(DDATA,U,4),JND=$P(DDATA,U,5)
28 .;Save line in workfile
29 . D DSAVE(DNAM,IND,JND)
30 .;
31 . I $D(^TMP("PXRMEXTMP",$J,"DREPL",DNAM))>0 D DREPL(DNAM)
32 .;Process any sub-components
33 . I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAM)) D DCMP(DNAM)
34 Q
35 ;
36 ;===================================================
37DREPL(DLG,LEV) ;
38 N DDATA,DDLG,DEND,DNAM,DSEQ,DSTRT,IND,JND
39 S DDATA=^TMP("PXRMEXTMP",$J,"DREPL",DLG)
40 S DNAM=$P(DDATA,U),DSTRT=$P(DDATA,U,2),DEND=$P(DDATA,U,3) Q:DNAM=""
41 S IND=$P(DDATA,U,4),JND=$P(DDATA,U,5)
42 ;Save line in workfile
43 D DSAVE(DNAM,IND,JND)
44 I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAM)) D DCMP(DNAM)
45 Q
46 ;===================================================
47DSAVE(DNAM,IND,JND) ;Update workfile
48 ;Ignore national prompts
49 I $$PXRM^PXRMEXID(DNAM) Q
50 N DEXIST
51 S NSEL=NSEL+1
52 ;Check if dialog exists
53 S DEXIST=$$EXISTS^PXRMEXIU(801.41,DNAM)
54 ;Store the file number, start and stop line in the exchange file.
55 S ^TMP("PXRMEXLD",$J,"SEL",NSEL)=FILENUM_U_IND_U_JND_U_DEXIST
56 Q
57 ;
58 ;===================================================
59INITMPG ;Initialize ^TMP arrays.
60 K ^TMP("PXRMEXIA",$J)
61 K ^TMP("PXRMEXLC",$J)
62 K ^TMP("PXRMEXLD",$J)
63 K ^TMP("PXRMEXTMP",$J)
64 Q
65 ;
66 ;===================================================
67INSCOM(PXRMRIEN,IND,TEMP,REMNAME) ;Install component IND of PXRMRIEN.
68 N ACTION,ATTR,END,EXISTS,FILENUM,IND120,JND120,NAME
69 N PT01,RTN,START
70 S FILENUM=$P(TEMP,U,1),EXISTS=$P(TEMP,U,4)
71 S IND120=$P(TEMP,U,2),JND120=$P(TEMP,U,3)
72 S TEMP=^PXD(811.8,PXRMRIEN,120,IND120,1,JND120,0)
73 I (FILENUM=801.41)!(FILENUM=811.5) S ACTION=$S(EXISTS:"M",1:"I")
74 E S ACTION=$S(EXISTS:"O",1:"I")
75 S START=$P(TEMP,U,2)
76 S END=$P(TEMP,U,3)
77 S TEMP=^PXD(811.8,PXRMRIEN,100,START,0)
78 I FILENUM=0 D
79 . D RTNLD^PXRMEXIC(PXRMRIEN,START,END,.ATTR,.RTN)
80 .;Save what was done for the installation summary.
81 . S ^TMP("PXRMEXIA",$J,IND,"ROUTINE",ATTR("NAME"),ACTION)=""
82 E D
83 . S PT01=$P(TEMP,"~",2)
84 . S (ATTR("NAME"),ATTR("PT01"))=PT01
85 . D SETATTR^PXRMEXFI(.ATTR,FILENUM)
86 .;Save what was done for the installation summary.
87 . S ^TMP("PXRMEXIA",$J,IND,ATTR("FILE NAME"),PT01,ACTION)=""
88 ;Install this component.
89 I FILENUM=0 D RTNSAVE^PXRMEXIC(.RTN,ATTR("NAME"))
90 E D FILE^PXRMEXIC(PXRMRIEN,EXISTS,IND120,JND120,ACTION,.ATTR,.PXRMNMCH)
91 ;Save reminder name
92 I FILENUM=811.9 S REMNAME=PT01
93 ;If this component was not installed add to the no install message.
94 Q
95 ;
96 ;===================================================
97INSDLG(PXRMRIEN) ;Install dialog components (in reverse order)
98 ;
99 K ^TMP("PXRMEXSI",$J)
100 N IND,TEMP,JND120,KIDSDONE
101 ;Build list of components
102 D BUILD
103 S IND="",KIDSDONE=0
104 F S IND=$O(^TMP("PXRMEXLD",$J,"SEL",IND),-1) Q:'IND!(KIDSDONE=1) D
105 . S TEMP=^TMP("PXRMEXLD",$J,"SEL",IND),JND120=$P(TEMP,U,3)
106 .;Skip install if dialog occurs more than once
107 . I $D(^TMP("PXRMEXSI",$J,JND120)) Q
108 . S ^TMP("PXRMEXSI",$J,JND120)=""
109 .;Silent Dialog Install
110 . D INSCOM(PXRMRIEN,IND,TEMP,.REMNAME)
111 K ^TMP("PXRMEXSI",$J)
112 Q
113 ;
114 ;===================================================
115INSTALL(PXRMRIEN,NOR) ;Install all components in a repository entry.
116 ;If NOR is true do not install routines.
117 N DNAME,FILENUM,IND,PXRMNMCH,REMNAME,TEMP
118 S NOR=$G(NOR)
119 ;Initialize ^TMP globals.
120 D INITMPG
121 ;Build the component list.
122 K ^PXD(811.8,PXRMRIEN,100,"B")
123 K ^PXD(811.8,PXRMRIEN,120)
124 D CLIST^PXRMEXU1(.PXRMRIEN)
125 I PXRMRIEN=-1 Q
126 ;Build the selectable list.
127 D CDISP^PXRMEXLC(PXRMRIEN)
128 ;Set the install date and time.
129 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
130 ;Initialize the name change storage.
131 K PXRMNMCH
132 S IND=0
133 F S IND=$O(^TMP("PXRMEXLC",$J,"SEL",IND)) Q:+IND=0 D
134 . S TEMP=^TMP("PXRMEXLC",$J,"SEL",IND)
135 . S FILENUM=$P(TEMP,U,1)
136 .;If NOR is true do not install routines.
137 . I FILENUM=0,NOR Q
138 . ;Install dialog components
139 . I FILENUM=801.41 N PXRMDONE S PXRMDONE=0 D INSDLG(PXRMRIEN) Q
140 . ;Install component
141 . E D INSCOM(PXRMRIEN,IND,TEMP,.REMNAME)
142 ;
143 ;Get the dialog name
144 S DNAME=$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM"))
145 ;Link the dialog if it exists
146 I DNAME'="" D
147 . N DIEN,RIEN
148 .;Get the dialog ien
149 . S DIEN=$$EXISTS^PXRMEXIU(801.41,DNAME) Q:'DIEN
150 .;Get the reminder ien
151 . S RIEN=+$$EXISTS^PXRMEXIU(811.9,$G(REMNAME)) Q:'RIEN
152 . I RIEN>0 D
153 .. N DA,DIE,DIK,DR
154 ..;Set reminder to dialog pointer
155 .. S DR="51///^S X=DNAME",DIE="^PXD(811.9,",DA=RIEN
156 .. D ^DIE
157 ;
158 ;Save the install history.
159 D SAVHIST^PXRMEXU1
160 ;If any components were skipped send the message.
161 I $D(^TMP("PXRMEXNI",$J)) D
162 . N NE,XMSUB
163 . S NE=$O(^TMP("PXRMEXNI",$J,""),-1)+1
164 . S ^TMP("PXRMEXNI",$J,NE,0)="Please review and make changes as necessary."
165 . K ^TMP("PXRMXMZ",$J)
166 . M ^TMP("PXRMXMZ",$J)=^TMP("PXRMEXNI",$J)
167 . S XMSUB="COMPONENTS SKIPPED DURING SILENT MODE INSTALL"
168 . D SEND^PXRMMSG(XMSUB)
169 ;Cleanup TMP globals.
170 D INITMPG
171 Q
172 ;
Note: See TracBrowser for help on using the repository browser.