source: FOIAVistA/tag/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPFLF4.m@ 1796

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1DGPFLF4 ;ALB/RBS - PRF FLAG MANAGEMENT LM PROTOCOL ACTIONS CONT. ; 4/15/04 12:15pm
2 ;;5.3;Registration;**425,554,650**;Aug 13, 1993 ;Build 3
3 ;
4 ;no direct entry
5 QUIT
6 ;
7EF ;Entry point for DGPF EDIT FLAG action protocol.
8 ;
9 ; Input: DGCAT - flag category (1=National, 2=Local)
10 ;
11 ; Output: Edit File entry in PRF LOCAL FLAG FILE (#26.11)
12 ; New File entry in PRF LOCAL FLAG HISTORY FILE (#26.12)
13 ; Set variable VALMBCK to 'R' = refresh screen
14 ;
15 N X,Y,DIRUT,DTOUT,DUOUT,DIROUT ;input/output vars for ^DIR
16 N DGIDXIEN ;ien of flag record from the "IDX"
17 N DGPFLF ;array containing flag record field values
18 N DGPFLH ;array containing flag history record field values
19 N DGPFORIG ;save original array containing flag record field values
20 N DGABORT ;abort flag
21 N DGRESULT ;result of $$STOALL^DGPFALF1 api call
22 N DGERR ;if error returned
23 N DGOK ;ok flag to enter record flag entry & flag description
24 N DGLOCK ;lock var for flag file edit
25 N DGSEL ;user selection (list item)
26 N VALMY ;output of EN^VALM2 call, array of user selected entries
27 N DGMSG ;user message
28 N DGQ,DGSUB ;counters and quit flag
29 ;
30 ;init vars
31 S (DGABORT,DGLOCK,DGRESULT,DGQ,DGSUB)=0
32 S DGOK=1,(DGSEL,DGIDXIEN)=""
33 ;
34 ;set screen to full scrolling region
35 D FULL^VALM1
36 W !
37 ;
38 ;check flag category (only Category II flags can be edited)
39 I DGCAT=1 D
40 . D BLD^DIALOG(261129,"Can not edit 'Category I' flags.","","DGERR","F")
41 . D MSG^DIALOG("WE","","","","DGERR") W *7
42 . D PAUSE^VALM1
43 . S DGOK=0
44 ;
45 ;init flag record and history arrays
46 ; The DGPFLF array will contain 2 "^" pieces (internal^external)
47 ; for a final full screen display before filing.
48 K DGPFLF,DGPFLH,DGPFORIG
49 ;
50 ;allow user to select a single flag for editing
51 D:DGOK
52 . S DGOK=0,VALMBCK=""
53 . D EN^VALM2($G(XQORNOD(0)),"S")
54 . Q:'$D(VALMY)
55 . S DGSEL=$O(VALMY(""))
56 . Q:DGSEL']""
57 . Q:'$D(@VALMAR@("IDX",DGSEL))
58 . S DGIDXIEN=$G(@VALMAR@("IDX",DGSEL))
59 . ; lock flag record
60 . S DGLOCK=$$LOCKLF^DGPFALF1(DGIDXIEN)
61 . I 'DGLOCK D Q
62 . . X DGMSG
63 . . W !?7,"Unable to Lock Flag, another User is Editing this Flag.",*7
64 . . D PAUSE^VALM1
65 . ;
66 . ; call api to get record back in array DGPFLF
67 . I '$$GETLF^DGPFALF($P(DGIDXIEN,";"),.DGPFLF) D Q
68 . . X DGMSG
69 . . W !?7,"No Local Flag record data found. Please check your selection.",*7
70 . . D PAUSE^VALM1
71 . ;
72 . M DGPFORIG=DGPFLF ;save original array to compare for edits later
73 . S DGOK=1
74 ;
75 ;Call DGPFLF5 for user prompts to edit fields
76 ; - split from this one due to size
77 I DGOK D
78 . D EFCONT^DGPFLF5(.DGPFLF,.DGPFLH,.DGPFORIG,.DGABORT,DGIDXIEN)
79 . Q:DGABORT
80 . ;
81 . ;check to see if user changed anything
82 . S DGSUB="",DGQ=0
83 . I $G(DGPFLF("OLDFLAG"))]"" S DGQ=1 ;flag name has changed
84 . I 'DGQ D
85 . . F DGSUB="STAT","TYPE","REVFREQ","NOTIDAYS","REVGRP","TIUTITLE" D Q:DGQ
86 . . . I DGPFLF(DGSUB)'=DGPFORIG(DGSUB) S DGQ=1
87 . . Q:DGQ
88 . . ;
89 . . ;was description modified?
90 . . I $O(DGPFLF("DESC",""),-1)'=$O(DGPFORIG("DESC",""),-1) S DGQ=1
91 . . Q:DGQ
92 . . ;
93 . . S DGSUB=0
94 . . F S DGSUB=$O(DGPFLF("DESC",DGSUB)) Q:DGSUB="" D Q:DGQ
95 . . . I DGPFLF("DESC",DGSUB,0)'=$G(DGPFORIG("DESC",DGSUB,0)) S DGQ=1
96 . . Q:DGQ
97 . . ;
98 . . S DGSUB=0
99 . . F S DGSUB=$O(DGPFLF("PRININV",DGSUB)) Q:DGSUB="" D Q:DGQ
100 . . . I DGPFLF("PRININV",DGSUB,0)'=$G(DGPFORIG("PRININV",DGSUB,0)) S DGQ=1
101 . ;
102 . I 'DGQ D Q
103 . . W !!," >>> No edits to "_$P(DGPFLF("FLAG"),U,2)_" were found."
104 . . S DGABORT=1
105 . ;
106 . K DGPFORIG ;kill array - no longer needed
107 . ;
108 . ;re-display user's answers on full screen
109 . D REVIEW^DGPFUT3(.DGPFLF,.DGPFLH,"",XQY0,XQORNOD(0))
110 . ;
111 . ;file the edits
112 . W !,*7
113 . I $$ANSWER^DGPFUT("Would you like to file the local record flag changes","YES","Y")'>0 S DGABORT=1 Q
114 . ;
115 . W !,"Updating the local record flag..."
116 . ;
117 . ;setup remaining flag history array nodes for filing
118 . ;note, the DGPFLH("FLAG") will be setup in $$STOALL^DGPFALF1
119 . S DGPFLH("ENTERDT")=$$NOW^XLFDT() ;current date/time
120 . S DGPFLH("ENTERBY")=DUZ ;current user
121 . ;
122 . ;file both the (#26.11) & (#26.12) entries
123 . S DGRESULT=$$STOALL^DGPFALF1(.DGPFLF,.DGPFLH,.DGERR)
124 . ;
125 . W !!," >>> Local record flag was "_$S(+DGRESULT:"filed successfully.",1:"not filed successfully."),*7
126 . ;
127 . D PAUSE^VALM1
128 ;
129 I DGLOCK,$$UNLOCK^DGPFALF1(DGIDXIEN)
130 ;
131 I DGABORT D
132 . W !!," >>> The '"_$P($G(XQORNOD(0)),U,3)_"' action is aborting, nothing has been filed.",*7
133 . I $$ANSWER^DGPFUT("Enter RETURN to continue","","E") ;pause
134 ;
135 ;re-build list of local record flags
136 D BLD^DGPFLF
137 ;
138 ;return to LM (refresh screen)
139 S VALMBCK="R"
140 Q
141 ;
Note: See TracBrowser for help on using the repository browser.