DGPFAPI2 ;ALB/RBS - PRF EXTERNAL API'S ; 6/7/05 4:44pm
;;5.3;Registration;**554,650**;Aug 13, 1993;Build 3
;
Q ;no direct entry
;
STOTIU(DGDFN,DGAIEN,DGHIEN,DGTIUIEN) ;store TIU Progress Note link
;This function is used to update the TIU PN LINK (#.06) field of
;the PRF ASSIGNMENT HISTORY (#26.14) file with the IEN of the
;TIU Progress Note in the TIU DOCUMENT (#8925) file.
;
; Associated DBIA: #4384 - DGPF FILE/DELETE TIU PN LINK
; Supported DBIA: #4380 - $$CHKDOC^TIUPRF - TIU API's for PRF
;
; Input:
; DGDFN - [Required] IEN of PATIENT (#2) file
; DGAIEN - [Required] IEN of PRF ASSIGNMENT (#26.13) file
; DGHIEN - [Required] IEN of PRF ASSIGNMENT HISTORY (#26.14) file
; DGTIUIEN - [Required] IEN of TIU DOCUMENT (#8925) file
;
; Output:
; Function result - returns 1 on success
; - returns two piece string on failure
; Format: 0^error text generated from EZBLD^DIALOG
;
N DGDIALOG ;failure reason generated from EZBLD^DIALOG
N DGPFA ;flag assignment array
N DGPFAH ;flag assignment history array
N DGRSLT ;function result
;
S DGDFN=+$G(DGDFN)
S DGAIEN=+$G(DGAIEN)
S DGHIEN=+$G(DGHIEN)
S DGTIUIEN=+$G(DGTIUIEN)
;
S DGRSLT=0
;
D ;drops out on error condition
. ;
. I '$$CHKDOC^TIUPRF(DGTIUIEN) S DGDIALOG=$$EZBLD^DIALOG(261104) Q
. ;
. ;check if progress note already setup (x-ref "ATIUPN")
. I $D(^DGPF(26.14,"ATIUPN",DGTIUIEN)) S DGDIALOG=$$EZBLD^DIALOG(261109) Q
. ;
. ;get history record that is being updated
. I '$$GETHIST^DGPFAAH(DGHIEN,.DGPFAH) S DGDIALOG=$$EZBLD^DIALOG(261101) Q
. ;
. ;check if correct history record of the patient assignment
. I $P($G(DGPFAH("ASSIGN")),U)'=DGAIEN S DGDIALOG=$$EZBLD^DIALOG(261101) Q
. ;
. ;check for existing entry
. I +$P($G(DGPFAH("TIULINK")),U) S DGDIALOG=$$EZBLD^DIALOG(261109) Q
. ;
. ;get assignment record
. I '$$GETASGN^DGPFAA(DGAIEN,.DGPFA) S DGDIALOG=$$EZBLD^DIALOG(261102) Q
. ;
. ;check if current site is Owner Site
. I '$$ISDIV^DGPFUT($P(DGPFA("OWNER"),U)) S DGDIALOG=$$EZBLD^DIALOG(261103) Q
. ;
. ;file the TIU PN LINK
. S DGRSLT=$$STOHIST(DGHIEN,DGTIUIEN)
. I 'DGRSLT S DGDIALOG=$P($G(DGRSLT),"^",2) Q
. ;
. S DGRSLT=1
;
Q $S(DGRSLT:1,1:DGRSLT_"^"_$G(DGDIALOG))
;
STOHIST(DGHIEN,DGTIUIEN) ;update TIU Progress Note link
;This function is used to update the TIU PN LINK (#.06) field of
;the PRF ASSIGNMENT HISTORY (#26.14) file.
;
; Input:
; DGHIEN - [Required] IEN of PRF ASSIGNMENT HISTORY (#26.14) file
; DGTIUIEN - [Required] IEN of TIU DOCUMENT (#8925) file
;
; Output:
; Function result - returns 1 on success
; - returns two piece string on failure
; Format: 0^error text generated from EZBLD^DIALOG
;
N DGDIALOG ;failure reason generated from EZBLD^DIALOG
N DGERR ;FILE^DIE error array (undefined on filing success)
N DGFDA ;FILE^DIE formatted array containing field ien and data
N DGFIL ;file number to file data
N DGRSLT ;function result
;
S DGHIEN=+$G(DGHIEN)
S DGTIUIEN=+$G(DGTIUIEN)
;
S DGRSLT=0
S DGFIL=26.14
;
D ;drops out on error condition
. S DGFDA(DGFIL,DGHIEN_",",.06)=DGTIUIEN
. D FILE^DIE("","DGFDA","DGERR")
. I $D(DGERR) S DGDIALOG=$$EZBLD^DIALOG(261105) Q
. ;
. S DGRSLT=1
;
Q $S(DGRSLT:1,1:DGRSLT_"^"_$G(DGDIALOG))
;
DELTIU(DGTIUIEN) ;delete TIU Progress Note link
;This function is used to delete the TIU PN LINK (#.06) field of
;the PRF ASSIGNMENT HISTORY (#26.14) file.
;
; Associated DBIA: #4384 - DGPF FILE/DELETE TIU PN LINK
; Supported DBIA: #4380 - $$CHKDOC^TIUPRF - TIU API's for PRF
;
; Input:
; DGTIUIEN - [Required] IEN of record in TIU DOCUMENT (#8925) file
;
; Output:
; Function result - returns 1 on success
; - returns two piece string on failure
; Format: 0^error text generated from EZBLD^DIALOG
;
N DGDIALOG ;failure reason generated from EZBLD^DIALOG
N DGERR ;FILE^DIE error array (undefined on filing success)
N DGFDA ;FILE^DIE formatted array containing field ien and data
N DGFIL ;file number to file data
N DGHIEN ;IEN of history record
N DGRSLT ;function result
;
S DGTIUIEN=+$G(DGTIUIEN)
S (DGRSLT,DGHIEN)=0
S DGFIL=26.14
;
D ;drops out on error condition
. ;
. S DGHIEN=+$O(^DGPF(DGFIL,"ATIUPN",DGTIUIEN,DGHIEN))
. I '$D(^DGPF(DGFIL,DGHIEN,0)) S DGDIALOG=$$EZBLD^DIALOG(261101) Q
. S DGFDA(DGFIL,DGHIEN_",",.06)="@"
. D FILE^DIE("","DGFDA","DGERR")
. I $D(DGERR) S DGDIALOG=$$EZBLD^DIALOG(261106) Q
. ;
. S DGRSLT=1
;
Q $S(DGRSLT:1,1:DGRSLT_"^"_$G(DGDIALOG))
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGPFAPI2 4744 printed Dec 13, 2024@02:47:27 Page 2
DGPFAPI2 ;ALB/RBS - PRF EXTERNAL API'S ; 6/7/05 4:44pm
+1 ;;5.3;Registration;**554,650**;Aug 13, 1993;Build 3
+2 ;
+3 ;no direct entry
QUIT
+4 ;
STOTIU(DGDFN,DGAIEN,DGHIEN,DGTIUIEN) ;store TIU Progress Note link
+1 ;This function is used to update the TIU PN LINK (#.06) field of
+2 ;the PRF ASSIGNMENT HISTORY (#26.14) file with the IEN of the
+3 ;TIU Progress Note in the TIU DOCUMENT (#8925) file.
+4 ;
+5 ; Associated DBIA: #4384 - DGPF FILE/DELETE TIU PN LINK
+6 ; Supported DBIA: #4380 - $$CHKDOC^TIUPRF - TIU API's for PRF
+7 ;
+8 ; Input:
+9 ; DGDFN - [Required] IEN of PATIENT (#2) file
+10 ; DGAIEN - [Required] IEN of PRF ASSIGNMENT (#26.13) file
+11 ; DGHIEN - [Required] IEN of PRF ASSIGNMENT HISTORY (#26.14) file
+12 ; DGTIUIEN - [Required] IEN of TIU DOCUMENT (#8925) file
+13 ;
+14 ; Output:
+15 ; Function result - returns 1 on success
+16 ; - returns two piece string on failure
+17 ; Format: 0^error text generated from EZBLD^DIALOG
+18 ;
+19 ;failure reason generated from EZBLD^DIALOG
NEW DGDIALOG
+20 ;flag assignment array
NEW DGPFA
+21 ;flag assignment history array
NEW DGPFAH
+22 ;function result
NEW DGRSLT
+23 ;
+24 SET DGDFN=+$GET(DGDFN)
+25 SET DGAIEN=+$GET(DGAIEN)
+26 SET DGHIEN=+$GET(DGHIEN)
+27 SET DGTIUIEN=+$GET(DGTIUIEN)
+28 ;
+29 SET DGRSLT=0
+30 ;
+31 ;drops out on error condition
Begin DoDot:1
+32 ;
+33 IF '$$CHKDOC^TIUPRF(DGTIUIEN)
SET DGDIALOG=$$EZBLD^DIALOG(261104)
QUIT
+34 ;
+35 ;check if progress note already setup (x-ref "ATIUPN")
+36 IF $DATA(^DGPF(26.14,"ATIUPN",DGTIUIEN))
SET DGDIALOG=$$EZBLD^DIALOG(261109)
QUIT
+37 ;
+38 ;get history record that is being updated
+39 IF '$$GETHIST^DGPFAAH(DGHIEN,.DGPFAH)
SET DGDIALOG=$$EZBLD^DIALOG(261101)
QUIT
+40 ;
+41 ;check if correct history record of the patient assignment
+42 IF $PIECE($GET(DGPFAH("ASSIGN")),U)'=DGAIEN
SET DGDIALOG=$$EZBLD^DIALOG(261101)
QUIT
+43 ;
+44 ;check for existing entry
+45 IF +$PIECE($GET(DGPFAH("TIULINK")),U)
SET DGDIALOG=$$EZBLD^DIALOG(261109)
QUIT
+46 ;
+47 ;get assignment record
+48 IF '$$GETASGN^DGPFAA(DGAIEN,.DGPFA)
SET DGDIALOG=$$EZBLD^DIALOG(261102)
QUIT
+49 ;
+50 ;check if current site is Owner Site
+51 IF '$$ISDIV^DGPFUT($PIECE(DGPFA("OWNER"),U))
SET DGDIALOG=$$EZBLD^DIALOG(261103)
QUIT
+52 ;
+53 ;file the TIU PN LINK
+54 SET DGRSLT=$$STOHIST(DGHIEN,DGTIUIEN)
+55 IF 'DGRSLT
SET DGDIALOG=$PIECE($GET(DGRSLT),"^",2)
QUIT
+56 ;
+57 SET DGRSLT=1
End DoDot:1
+58 ;
+59 QUIT $SELECT(DGRSLT:1,1:DGRSLT_"^"_$GET(DGDIALOG))
+60 ;
STOHIST(DGHIEN,DGTIUIEN) ;update TIU Progress Note link
+1 ;This function is used to update the TIU PN LINK (#.06) field of
+2 ;the PRF ASSIGNMENT HISTORY (#26.14) file.
+3 ;
+4 ; Input:
+5 ; DGHIEN - [Required] IEN of PRF ASSIGNMENT HISTORY (#26.14) file
+6 ; DGTIUIEN - [Required] IEN of TIU DOCUMENT (#8925) file
+7 ;
+8 ; Output:
+9 ; Function result - returns 1 on success
+10 ; - returns two piece string on failure
+11 ; Format: 0^error text generated from EZBLD^DIALOG
+12 ;
+13 ;failure reason generated from EZBLD^DIALOG
NEW DGDIALOG
+14 ;FILE^DIE error array (undefined on filing success)
NEW DGERR
+15 ;FILE^DIE formatted array containing field ien and data
NEW DGFDA
+16 ;file number to file data
NEW DGFIL
+17 ;function result
NEW DGRSLT
+18 ;
+19 SET DGHIEN=+$GET(DGHIEN)
+20 SET DGTIUIEN=+$GET(DGTIUIEN)
+21 ;
+22 SET DGRSLT=0
+23 SET DGFIL=26.14
+24 ;
+25 ;drops out on error condition
Begin DoDot:1
+26 SET DGFDA(DGFIL,DGHIEN_",",.06)=DGTIUIEN
+27 DO FILE^DIE("","DGFDA","DGERR")
+28 IF $DATA(DGERR)
SET DGDIALOG=$$EZBLD^DIALOG(261105)
QUIT
+29 ;
+30 SET DGRSLT=1
End DoDot:1
+31 ;
+32 QUIT $SELECT(DGRSLT:1,1:DGRSLT_"^"_$GET(DGDIALOG))
+33 ;
DELTIU(DGTIUIEN) ;delete TIU Progress Note link
+1 ;This function is used to delete the TIU PN LINK (#.06) field of
+2 ;the PRF ASSIGNMENT HISTORY (#26.14) file.
+3 ;
+4 ; Associated DBIA: #4384 - DGPF FILE/DELETE TIU PN LINK
+5 ; Supported DBIA: #4380 - $$CHKDOC^TIUPRF - TIU API's for PRF
+6 ;
+7 ; Input:
+8 ; DGTIUIEN - [Required] IEN of record in TIU DOCUMENT (#8925) file
+9 ;
+10 ; Output:
+11 ; Function result - returns 1 on success
+12 ; - returns two piece string on failure
+13 ; Format: 0^error text generated from EZBLD^DIALOG
+14 ;
+15 ;failure reason generated from EZBLD^DIALOG
NEW DGDIALOG
+16 ;FILE^DIE error array (undefined on filing success)
NEW DGERR
+17 ;FILE^DIE formatted array containing field ien and data
NEW DGFDA
+18 ;file number to file data
NEW DGFIL
+19 ;IEN of history record
NEW DGHIEN
+20 ;function result
NEW DGRSLT
+21 ;
+22 SET DGTIUIEN=+$GET(DGTIUIEN)
+23 SET (DGRSLT,DGHIEN)=0
+24 SET DGFIL=26.14
+25 ;
+26 ;drops out on error condition
Begin DoDot:1
+27 ;
+28 SET DGHIEN=+$ORDER(^DGPF(DGFIL,"ATIUPN",DGTIUIEN,DGHIEN))
+29 IF '$DATA(^DGPF(DGFIL,DGHIEN,0))
SET DGDIALOG=$$EZBLD^DIALOG(261101)
QUIT
+30 SET DGFDA(DGFIL,DGHIEN_",",.06)="@"
+31 DO FILE^DIE("","DGFDA","DGERR")
+32 IF $DATA(DGERR)
SET DGDIALOG=$$EZBLD^DIALOG(261106)
QUIT
+33 ;
+34 SET DGRSLT=1
End DoDot:1
+35 ;
+36 QUIT $SELECT(DGRSLT:1,1:DGRSLT_"^"_$GET(DGDIALOG))