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

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1DGPFAPI2 ;ALB/RBS - PRF EXTERNAL API'S ; 6/7/05 4:44pm
2 ;;5.3;Registration;**554,650**;Aug 13, 1993;Build 3
3 ;
4 Q ;no direct entry
5 ;
6STOTIU(DGDFN,DGAIEN,DGHIEN,DGTIUIEN) ;store TIU Progress Note link
7 ;This function is used to update the TIU PN LINK (#.06) field of
8 ;the PRF ASSIGNMENT HISTORY (#26.14) file with the IEN of the
9 ;TIU Progress Note in the TIU DOCUMENT (#8925) file.
10 ;
11 ; Associated DBIA: #4384 - DGPF FILE/DELETE TIU PN LINK
12 ; Supported DBIA: #4380 - $$CHKDOC^TIUPRF - TIU API's for PRF
13 ;
14 ; Input:
15 ; DGDFN - [Required] IEN of PATIENT (#2) file
16 ; DGAIEN - [Required] IEN of PRF ASSIGNMENT (#26.13) file
17 ; DGHIEN - [Required] IEN of PRF ASSIGNMENT HISTORY (#26.14) file
18 ; DGTIUIEN - [Required] IEN of TIU DOCUMENT (#8925) file
19 ;
20 ; Output:
21 ; Function result - returns 1 on success
22 ; - returns two piece string on failure
23 ; Format: 0^error text generated from EZBLD^DIALOG
24 ;
25 N DGDIALOG ;failure reason generated from EZBLD^DIALOG
26 N DGPFA ;flag assignment array
27 N DGPFAH ;flag assignment history array
28 N DGRSLT ;function result
29 ;
30 S DGDFN=+$G(DGDFN)
31 S DGAIEN=+$G(DGAIEN)
32 S DGHIEN=+$G(DGHIEN)
33 S DGTIUIEN=+$G(DGTIUIEN)
34 ;
35 S DGRSLT=0
36 ;
37 D ;drops out on error condition
38 . ;
39 . I '$$CHKDOC^TIUPRF(DGTIUIEN) S DGDIALOG=$$EZBLD^DIALOG(261104) Q
40 . ;
41 . ;check if progress note already setup (x-ref "ATIUPN")
42 . I $D(^DGPF(26.14,"ATIUPN",DGTIUIEN)) S DGDIALOG=$$EZBLD^DIALOG(261109) Q
43 . ;
44 . ;get history record that is being updated
45 . I '$$GETHIST^DGPFAAH(DGHIEN,.DGPFAH) S DGDIALOG=$$EZBLD^DIALOG(261101) Q
46 . ;
47 . ;check if correct history record of the patient assignment
48 . I $P($G(DGPFAH("ASSIGN")),U)'=DGAIEN S DGDIALOG=$$EZBLD^DIALOG(261101) Q
49 . ;
50 . ;check for existing entry
51 . I +$P($G(DGPFAH("TIULINK")),U) S DGDIALOG=$$EZBLD^DIALOG(261109) Q
52 . ;
53 . ;get assignment record
54 . I '$$GETASGN^DGPFAA(DGAIEN,.DGPFA) S DGDIALOG=$$EZBLD^DIALOG(261102) Q
55 . ;
56 . ;check if current site is Owner Site
57 . I '$$ISDIV^DGPFUT($P(DGPFA("OWNER"),U)) S DGDIALOG=$$EZBLD^DIALOG(261103) Q
58 . ;
59 . ;file the TIU PN LINK
60 . S DGRSLT=$$STOHIST(DGHIEN,DGTIUIEN)
61 . I 'DGRSLT S DGDIALOG=$P($G(DGRSLT),"^",2) Q
62 . ;
63 . S DGRSLT=1
64 ;
65 Q $S(DGRSLT:1,1:DGRSLT_"^"_$G(DGDIALOG))
66 ;
67STOHIST(DGHIEN,DGTIUIEN) ;update TIU Progress Note link
68 ;This function is used to update the TIU PN LINK (#.06) field of
69 ;the PRF ASSIGNMENT HISTORY (#26.14) file.
70 ;
71 ; Input:
72 ; DGHIEN - [Required] IEN of PRF ASSIGNMENT HISTORY (#26.14) file
73 ; DGTIUIEN - [Required] IEN of TIU DOCUMENT (#8925) file
74 ;
75 ; Output:
76 ; Function result - returns 1 on success
77 ; - returns two piece string on failure
78 ; Format: 0^error text generated from EZBLD^DIALOG
79 ;
80 N DGDIALOG ;failure reason generated from EZBLD^DIALOG
81 N DGERR ;FILE^DIE error array (undefined on filing success)
82 N DGFDA ;FILE^DIE formatted array containing field ien and data
83 N DGFIL ;file number to file data
84 N DGRSLT ;function result
85 ;
86 S DGHIEN=+$G(DGHIEN)
87 S DGTIUIEN=+$G(DGTIUIEN)
88 ;
89 S DGRSLT=0
90 S DGFIL=26.14
91 ;
92 D ;drops out on error condition
93 . S DGFDA(DGFIL,DGHIEN_",",.06)=DGTIUIEN
94 . D FILE^DIE("","DGFDA","DGERR")
95 . I $D(DGERR) S DGDIALOG=$$EZBLD^DIALOG(261105) Q
96 . ;
97 . S DGRSLT=1
98 ;
99 Q $S(DGRSLT:1,1:DGRSLT_"^"_$G(DGDIALOG))
100 ;
101DELTIU(DGTIUIEN) ;delete TIU Progress Note link
102 ;This function is used to delete the TIU PN LINK (#.06) field of
103 ;the PRF ASSIGNMENT HISTORY (#26.14) file.
104 ;
105 ; Associated DBIA: #4384 - DGPF FILE/DELETE TIU PN LINK
106 ; Supported DBIA: #4380 - $$CHKDOC^TIUPRF - TIU API's for PRF
107 ;
108 ; Input:
109 ; DGTIUIEN - [Required] IEN of record in TIU DOCUMENT (#8925) file
110 ;
111 ; Output:
112 ; Function result - returns 1 on success
113 ; - returns two piece string on failure
114 ; Format: 0^error text generated from EZBLD^DIALOG
115 ;
116 N DGDIALOG ;failure reason generated from EZBLD^DIALOG
117 N DGERR ;FILE^DIE error array (undefined on filing success)
118 N DGFDA ;FILE^DIE formatted array containing field ien and data
119 N DGFIL ;file number to file data
120 N DGHIEN ;IEN of history record
121 N DGRSLT ;function result
122 ;
123 S DGTIUIEN=+$G(DGTIUIEN)
124 S (DGRSLT,DGHIEN)=0
125 S DGFIL=26.14
126 ;
127 D ;drops out on error condition
128 . ;
129 . S DGHIEN=+$O(^DGPF(DGFIL,"ATIUPN",DGTIUIEN,DGHIEN))
130 . I '$D(^DGPF(DGFIL,DGHIEN,0)) S DGDIALOG=$$EZBLD^DIALOG(261101) Q
131 . S DGFDA(DGFIL,DGHIEN_",",.06)="@"
132 . D FILE^DIE("","DGFDA","DGERR")
133 . I $D(DGERR) S DGDIALOG=$$EZBLD^DIALOG(261106) Q
134 . ;
135 . S DGRSLT=1
136 ;
137 Q $S(DGRSLT:1,1:DGRSLT_"^"_$G(DGDIALOG))
Note: See TracBrowser for help on using the repository browser.