source: FOIAVistA/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUFD4.m@ 1314

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

initial load of FOIAVistA 6/30/08 version

File size: 4.1 KB
Line 
1TIUFD4 ; SLC/MAM - LM Template D Actions Edit Technical Fields, Edit Upload. LM Subtemplate DJ Action DELOBJ ;4/17/97 11:02
2 ;;1.0;TEXT INTEGRATION UTILITIES;**14**;Jun 20, 1997
3 ;
4DELOBJ ; Template DJ Action Delete (Object).
5 N FILEDA,MSG,USED,ASKOK,DA,DIK,LINENO
6 S FILEDA=TIUFINFO("FILEDA"),VALMBCK="R"
7 I ($L($P(TIUFNOD0,U,5))!$L($P(TIUFNOD0,U,6))),'$$PERSOWNS^TIUFLF2(FILEDA,DUZ) S MSG=" Only an Owner can delete a file entry" W MSG,! D PAUSE^TIUFXHLX G DELOX
8 L +^TIU(8925.1,FILEDA):1 I '$T W !!," Another user is editing this entry; Please try later" H 2 G DELOX
9 S USED=$$OBJUSED^TIUFLJ(FILEDA)
10 Q:$$CANTDEL^TIUFHA1(FILEDA,USED)
11 H 1 S ASKOK=$$ASKOK^TIUFHA1(0,0,USED) I 'ASKOK S MSG=" ... Object not deleted!" W !,MSG,! D PAUSE^TIUFXHLX G DELOX
12 ; Delete FILEDA as Docmt Def entry in file 8925.1:
13 S DA=FILEDA,DIK="^TIU(8925.1," D ^DIK
14 S LINENO=$O(^TMP("TIUF1IDX",$J,"DAF",FILEDA,0))
15 D UPDATE^TIUFLLM1(TIUFTMPL,-1,LINENO-1) S TIUFVCN1=TIUFVCN1-1
16 S MSG=" ... Object Deleted!" W !,MSG,! H 1 S VALMBCK="Q"
17DELOX L -^TIU(8925.1,FILEDA)
18 I $D(DTOUT) S VALMBCK="Q"
19 Q
20 ;
21EDTECH ;LM Template D Action Edit Technical Fields.
22 ; Requires CURRENT arrays TIUFINFO, TIUFNOD0.
23 ; Requires TIUFTLIN as set in DSTECH^TIUFD.
24 N FILEDA,DA,DIE,DR,LINENO,PFILEDA,PNODE61,PCUSTOM,TYPE,STATUS
25 N DIR,X,Y,TIUFY,TIUFXNOD,TIUFFULL,ICUSTOM,DTOUT,DIRUT,DIROUT
26 S FILEDA=TIUFINFO("FILEDA"),VALMBCK="",TYPE=$P(TIUFNOD0,U,4),TIUFXNOD=$G(XQORNOD(0))
27 I '$D(^TIU(8925.1,FILEDA,0)) W !!," Can't Edit Technical Fields; File Entry "_FILEDA_" does not exist; See IRM",! D PAUSE^TIUFXHLX S VALMBCK="Q" G EDTEX
28 S STATUS=$$STATWORD^TIUFLF5($P(TIUFNOD0,U,7)) ;e.g. INACTIVE
29 I STATUS="NO/BAD" W !!," Can't Edit Technical Fields; No Status/Bad Status",! D PAUSE^TIUFXHLX G EDTEX
30 I TYPE="O",'$$PERSOWNS^TIUFLF2(FILEDA,DUZ) W !!," Can't edit Technical Fields: Only an Owner can edit Objects",! D PAUSE^TIUFXHLX G EDTEX
31 I STATUS'="INACTIVE",TYPE'="O",TIUFWHO="N" K DIRUT D G:$D(DIRUT)!(TIUFY'=1) EDTEX
32 . S DIR(0)="Y",DIR("A",1)=" Entry is not Inactive. Do you want to bypass safety measures and edit"
33 . S DIR("A",2)="Technical Fields even though this may cause errors if e.g. a document is being"
34 . S DIR("A")="entered on this entry"
35 . S DIR("B")="NO" D ^DIR S TIUFY=Y K DIR,X,Y
36 I STATUS'="INACTIVE",TIUFWHO'="N" W !!," Can't edit Technical Fields; Entry is not Inactive",! D PAUSE^TIUFXHLX G EDTEX
37 L +^TIU(8925.1,FILEDA):1 I '$T W !!," Another user is editing this entry.",! H 2 G EDTEX
38 S DA=FILEDA,DIE=8925.1
39 S PFILEDA=+$O(^TIU(8925.1,"AD",FILEDA,0)) I 'PFILEDA S PCUSTOM=0,ICUSTOM="" G DR
40 ;If FILEDA is Clinical Documents, want to edit 6.14 but not 6.1, 6.12, 6.13:Type=CL so will edit 6.14; PCUSTOM undefined, so skip others:
41 D INHERIT^TIUFLD(PFILEDA,0,6.14,"","","",.ICUSTOM)
42 I TYPE="CL"!(TYPE="DC")!(TYPE="DOC") S PNODE61=$G(^TIU(8925.1,PFILEDA,6.1)),PCUSTOM=$P(PNODE61,U,4) I PCUSTOM="" S PCUSTOM=ICUSTOM
43DR S DR=$S(TYPE="O":9,1:"4.1:4.45;4.6;4.7;4.9;5;6;I '$G(PCUSTOM) S Y=7;6.1;6.12;6.13;7;8;S:TYPE=""DOC"" Y=0 I ICUSTOM=0 S Y=0;6.14") D ^DIE
44 G:$D(DTOUT) EDTEX
45 S LINENO=TIUFTLIN
46 D DSTECH^TIUFD(.LINENO) S VALMCNT=LINENO
47 G:$D(DTOUT) EDTEX
48 S VALMBCK="R"
49EDTEX ;
50 L -^TIU(8925.1,+$G(FILEDA))
51 I $D(DTOUT) S VALMBCK="Q" Q
52 I $G(TIUFFULL) S VALMBCK="R" D RESET^TIUFXHLX
53 Q
54 ;
55EDUPLOAD ;LM Template D Action Edit Upload.
56 ; Requires CURRENT arrays TIUFINFO, TIUFNOD0.
57 ; Requires TIUFULIN as set in DSUPLOAD^TIUFD2.
58 N FILEDA,DA,DIE,DR,LINENO,TIUFXNOD,STATUS,TYPE,DTOUT,DIRUT,DIROUT
59 S FILEDA=TIUFINFO("FILEDA"),VALMBCK="",TIUFXNOD=$G(XQORNOD(0))
60 I '$D(^TIU(8925.1,FILEDA,0)) W !!," Can't Edit Upload; File Entry "_FILEDA_" does not exist in the file; See IRM",! D PAUSE^TIUFXHLX S VALMBCK="Q" G EDUPX
61 S STATUS=$$STATWORD^TIUFLF5($P(TIUFNOD0,U,7)),TYPE=$P(TIUFNOD0,U,4)
62 L +^TIU(8925.1,FILEDA):1 I '$T W !," Another user is editing this entry." H 2 G EDUPX
63 D FULL^VALM1
64 N TIUX
65 S DA=FILEDA,DIE=8925.1
66 S DR="[TIUF UPLOAD FIELD EDIT]" D ^DIE G:$D(DTOUT) EDUPX
67 S LINENO=TIUFULIN
68 D DSUPLOAD^TIUFD1(.LINENO) S VALMCNT=LINENO G:$D(DTOUT) EDUPX
69 S VALMSG=$$VMSG^TIUFL D RE^VALM4,RESET^TIUFXHLX
70EDUPX ;
71 L -^TIU(8925.1,+$G(FILEDA))
72 I $D(DTOUT) S VALMBCK="Q"
73 Q
74 ;
Note: See TracBrowser for help on using the repository browser.