source: VWGUIRegistration/trunk/VWREGIT2.m

Last change on this file was 1806, checked in by Jim B., 5 years ago
File size: 2.7 KB
Line 
1VWREGIT2 ;Portland/WorldVista//Jim Bell, et al... - Post-Install for VWREG
2 ;;2.0;WORLD VISTA;**HOME **;;Build 4
3 ;*****************************************************************
4 ;* Licensed under GNU 2.0 or greater - see license.txt file *
5 ;* Program/application is for the management of input templates *
6 ;* owned by the user (DUZ). *
7 ;* REMINDER: All template fields pertain only to the Patient File*
8 ;* (#2)! *
9 ;*****************************************************************
10 ;
11 ;Continued from VWREGIT
12 ;
13 ;GNU License: See WVLIC.txt
14 ;Modified FOIA VISTA,
15 ;Copyright 2013 WorldVistA. Licensed under the terms of the GNU
16 Q
17PRE ;Did this installation happen already? Avoid a re-do?
18 I $O(^XMB(3.8,"B","VW REG ERROR REPORT",0))&($D(^XTV(8989.51,"B","VW GUI REG TEMPLATE DIRECTORY",0))) W !?5,"Installation has already occurred"
19 W !,"Do you want to continue? NO//" R X:60 S:'$L(X) X="NO" S X=$$UP^XLFSTR(X)
20 I "NON"[X W !,"OK" D ^XUSCLEAN
21 Q
22 ;
23PI ;Post Installation install
24 ;Checking for a home directory & file
25 ;I $O(^XMB(3.8,"B","VW REG ERROR REPORT",0)) W !?5,"Installation has already occurred" Q
26 D PRE
27 S AR=1,AR(1)="[TEMPLATES]"
28 S N=0 F S N=$O(^DIE(N)) Q:'+N S X=$P(^(N,0),"^") D
29 . I X["VW " S AR($I(AR))=X_"("_N_")"
30 . I X["[World" S AR($I(AR))=X_"("_N_")"
31 S AR($I(AR))="[ID]"
32 S P4=1,P5="",HD=$ZDIRECTORY_"regparam/",FILE="regit.txt"
33 S X=$$GTF^%ZISH($NA(AR(1)),1,HD,"regit.txt")
34 ZSY "chmod 777 "_$ZDIRECTORY_"regparam/"_FILE ;No sensitive info here
35 Q:$G(TEST) ;Straightening out regit.txt
36 ;
37 ;; NOTE: The parameter definition is installed but there is no installation for
38 ;;the actual parameter and value. Do it here.
39 ;parameter value attempt
40 ;Set a home directory for editing; SYSTEM (DIC(4,) and DOMAIN (DIC(4.2,) only:"/home/vista/regparam/"
41 S PARD=$O(^XTV(8989.51,"B","VW GUI REG TEMPLATE DIRECTORY",0))
42 I PARD D
43 . L +^XTV(8989.5,0):1 D L -^XTV(8989.5,0)
44 .. S NEW=$O(^XTV(8989.5," "),-1)+1
45 .. S $P(^XTV(8989.5,0),"^",3)=NEW
46 .. S $P(^XTV(8989.5,0),"^",4)=$P(^(0),"^",4)+1
47 .. S $P(^XTV(8989.5,NEW,0),"^")="1;DIC(4,"
48 .. S $P(^XTV(8989.5,NEW,0),"^",2)=PARD
49 .. S $P(^XTV(8989.5,NEW,0),"^",3)=1
50 .. S ^XTV(8989.5,NEW,1)=HD
51 .. S DA=NEW,DIK="^XTV(8989.5," D IX^DIK
52 .. S NEW2=$O(^XTV(8989.5," "),-1)+1
53 .. S $P(^XTV(8989.5,0),"^",3)=NEW2
54 .. S $P(^XTV(8989.5,0),"^",4)=$P(^(0),"^",4)+1
55 .. S $P(^XTV(8989.5,NEW2,0),"^")="9;DIC(4.2,"
56 .. S $P(^XTV(8989.5,NEW2,0),"^",2)=PARD
57 .. S $P(^XTV(8989.5,NEW2,0),"^",3)=1
58 .. S ^XTV(8989.5,NEW2,1)=HD
59 .. S DA=NEW2,DIK="^XTV(8989.5," D IX^DIK
60 ;
61 ;Mailgroup VW REG ERROR REPORT - add programmer's email
62 S DA(1)=$O(^XMB(3.8,"B","VW REG ERROR REPORT",0))
63 Q:'DA(1)
64 S DIC="^XMB(3.8,"_DA(1)_",6,"
65 S X="jbellco65@gmail.com"
66 S DIC(0)="LZ"
67 D FILE^DICN
68 Q
69 ;
Note: See TracBrowser for help on using the repository browser.