DGPFRFA ;ALB/RBS - PRF FLAG ASSIGNMENT REPORT ; 7/26/05 3:41pm
;;5.3;Registration;**425,555,554,1015**;Aug 13, 1993;Build 21
;
;This routine will be used for selecting sort parameters to produce
; the FLAG ASSIGNMENT REPORT for Patient Record Flags.
;
;Selection options will provide the user with the ability to report
; by:
; CATEGORY:
; 1 Category I (National)
; 2 Category II (Local)
; 3 BOTH
; FLAG:
; S Single Flag
; A All Flags
; BEGINING DATE: FileMan date
; ENDING DATE: FileMan date
;
;-- no direct entry
QUIT
;
EN ;Entry point
;-- user prompts for report selection sorts
; Input: none
; Output: Report generated using user selected parameters
;
N DGASK,DGRSLT,DGDIRA,DGDIRB,DGDIRO,DGDIRH
N DGSORT,DGCAT,DGFIL,DGSEL,DGFIRST
N ZTSAVE,DGQ
;
;check for database
S DGFIRST=$P(+$O(^DGPF(26.14,"D","")),".") ;first assignment date
I 'DGFIRST D Q
. W !?2,">>> No Patient Record Flag Assignments have been found.",*7
. I $$ANSWER^DGPFUT("Enter RETURN to continue","","E") ;pause
;
;-- prompt for selection of a flag category
S DGDIRA="Select Flag Category"
S DGDIRB=""
S DGDIRH="Enter one of the category selections to report on"
S DGDIRO="S^1:Category I (National);2:Category II (Local);3:Both"
S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
Q:(DGASK<1)
S DGCAT=DGASK,DGSORT("DGCAT")=DGASK_U_$S(DGCAT=1:"Category I (National)",DGCAT=2:"Category II (Local)",DGCAT=3:"Both",1:"")
;
;-- prompt for selection of a single flag or all flags
S DGSEL=""
;list (A)ll flags if user selects Both Category's
I DGCAT=3 D
. S DGSORT("DGFLAG")="A"
;
D:DGCAT'=3 ;only prompt if user selects a Category I or II
. S DGDIRA="Select to report on a (S)ingle flag or (A)ll flags"
. S DGDIRB="Single Flag"
. S DGDIRO="S^S:Single Flag;A:All Flags"
. S DGDIRH="Enter one of the flag selections to report on"
. S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
. Q:(DGASK=-1)
. S DGSEL=DGASK
. S DGSORT("DGFLAG")=DGASK
Q:(DGASK=-1)
;
;-- prompt for selection of a record flag name - only if (S)ingle
D:DGSEL="S"
. S DGQ=0
. S DGDIRA="Select Record Flag Name",DGDIRB=""
. S DGDIRO=$S(DGCAT=1:"P^26.15,.01:EMZ",1:"P^26.11,.01:EMZ")
. F D Q:DGQ
. . S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO)
. . I DGASK=-1 S DGQ=1 Q
. . ;set data string = pointer value (5;DGPF(26.11,) ^ external name
. . S DGFIL=DGASK_$S(DGCAT=1:";DGPF(26.15,",1:";DGPF(26.11,")
. . ;if (S)ingle flag selected, check for any flag assignments
. . I '$$ASGNCNT^DGPFLF6(DGFIL) D Q
. . . W !?2,">>> No Patient Record Flag Assignments have been found. Select another flag.",*7
. . ;a good one to report on
. . S DGSORT("DGFLAG")=DGFIL_U_$$EXTERNAL^DILFD(26.13,.02,"F",DGFIL)
. . S DGQ=1
;
Q:(DGASK=-1)
;
;-- prompt for beginning date
S DGDIRA="Select Beginning Date"
S DGDIRB=""
S DGDIRH="^D HELP^DGPFRFA(1)"
S DGDIRO="D^"_DGFIRST_":DT:EX"
S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
Q:(DGASK=-1)
S DGSORT("DGBEG")=DGASK
;
;-- prompt for ending date
S DGDIRA="Select Ending Date"
S DGDIRB=""
S DGDIRH="^D HELP^DGPFRFA(2)"
S DGDIRO="D^"_DGSORT("DGBEG")_":DT:EX"
S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
Q:(DGASK=-1)
S DGSORT("DGEND")=DGASK
;
K DGCAT,DGFIL,DGSEL,DGDIRA,DGDIRB,DGDIRO,DGDIRH
K DGASK,DGRSLT,DGFIRST
;
;-- prompt for device
S ZTSAVE("DGSORT(")=""
D EN^XUTMDEVQ("START^DGPFRFA1","Patient Record Flag Assignment Report",.ZTSAVE)
D HOME^%ZIS
Q
;
HELP(DGSEL) ;provide extended DIR("?") help text.
;
; Input: DGSEL - prompt var for help text word selection
; Output: none
;
W !," Enter the "_$S(DGSEL=1:"earliest",1:"latest")_" Assignment Date to include in the report."
W !," Please enter a date from the specified date range displayed."
Q
DGPFRFA ;ALB/RBS - PRF FLAG ASSIGNMENT REPORT ; 7/26/05 3:41pm
+1 ;;5.3;Registration;**425,555,554,1015**;Aug 13, 1993;Build 21
+2 ;
+3 ;This routine will be used for selecting sort parameters to produce
+4 ; the FLAG ASSIGNMENT REPORT for Patient Record Flags.
+5 ;
+6 ;Selection options will provide the user with the ability to report
+7 ; by:
+8 ; CATEGORY:
+9 ; 1 Category I (National)
+10 ; 2 Category II (Local)
+11 ; 3 BOTH
+12 ; FLAG:
+13 ; S Single Flag
+14 ; A All Flags
+15 ; BEGINING DATE: FileMan date
+16 ; ENDING DATE: FileMan date
+17 ;
+18 ;-- no direct entry
+19 QUIT
+20 ;
EN ;Entry point
+1 ;-- user prompts for report selection sorts
+2 ; Input: none
+3 ; Output: Report generated using user selected parameters
+4 ;
+5 NEW DGASK,DGRSLT,DGDIRA,DGDIRB,DGDIRO,DGDIRH
+6 NEW DGSORT,DGCAT,DGFIL,DGSEL,DGFIRST
+7 NEW ZTSAVE,DGQ
+8 ;
+9 ;check for database
+10 ;first assignment date
SET DGFIRST=$PIECE(+$ORDER(^DGPF(26.14,"D","")),".")
+11 IF 'DGFIRST
Begin DoDot:1
+12 WRITE !?2,">>> No Patient Record Flag Assignments have been found.",*7
+13 ;pause
IF $$ANSWER^DGPFUT("Enter RETURN to continue","","E")
End DoDot:1
QUIT
+14 ;
+15 ;-- prompt for selection of a flag category
+16 SET DGDIRA="Select Flag Category"
+17 SET DGDIRB=""
+18 SET DGDIRH="Enter one of the category selections to report on"
+19 SET DGDIRO="S^1:Category I (National);2:Category II (Local);3:Both"
+20 SET DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
+21 IF (DGASK<1)
QUIT
+22 SET DGCAT=DGASK
SET DGSORT("DGCAT")=DGASK_U_$SELECT(DGCAT=1:"Category I (National)",DGCAT=2:"Category II (Local)",DGCAT=3:"Both",1:"")
+23 ;
+24 ;-- prompt for selection of a single flag or all flags
+25 SET DGSEL=""
+26 ;list (A)ll flags if user selects Both Category's
+27 IF DGCAT=3
Begin DoDot:1
+28 SET DGSORT("DGFLAG")="A"
End DoDot:1
+29 ;
+30 ;only prompt if user selects a Category I or II
IF DGCAT'=3
Begin DoDot:1
+31 SET DGDIRA="Select to report on a (S)ingle flag or (A)ll flags"
+32 SET DGDIRB="Single Flag"
+33 SET DGDIRO="S^S:Single Flag;A:All Flags"
+34 SET DGDIRH="Enter one of the flag selections to report on"
+35 SET DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
+36 IF (DGASK=-1)
QUIT
+37 SET DGSEL=DGASK
+38 SET DGSORT("DGFLAG")=DGASK
End DoDot:1
+39 IF (DGASK=-1)
QUIT
+40 ;
+41 ;-- prompt for selection of a record flag name - only if (S)ingle
+42 IF DGSEL="S"
Begin DoDot:1
+43 SET DGQ=0
+44 SET DGDIRA="Select Record Flag Name"
SET DGDIRB=""
+45 SET DGDIRO=$SELECT(DGCAT=1:"P^26.15,.01:EMZ",1:"P^26.11,.01:EMZ")
+46 FOR
Begin DoDot:2
+47 SET DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO)
+48 IF DGASK=-1
SET DGQ=1
QUIT
+49 ;set data string = pointer value (5;DGPF(26.11,) ^ external name
+50 SET DGFIL=DGASK_$SELECT(DGCAT=1:";DGPF(26.15,",1:";DGPF(26.11,")
+51 ;if (S)ingle flag selected, check for any flag assignments
+52 IF '$$ASGNCNT^DGPFLF6(DGFIL)
Begin DoDot:3
+53 WRITE !?2,">>> No Patient Record Flag Assignments have been found. Select another flag.",*7
End DoDot:3
QUIT
+54 ;a good one to report on
+55 SET DGSORT("DGFLAG")=DGFIL_U_$$EXTERNAL^DILFD(26.13,.02,"F",DGFIL)
+56 SET DGQ=1
End DoDot:2
IF DGQ
QUIT
End DoDot:1
+57 ;
+58 IF (DGASK=-1)
QUIT
+59 ;
+60 ;-- prompt for beginning date
+61 SET DGDIRA="Select Beginning Date"
+62 SET DGDIRB=""
+63 SET DGDIRH="^D HELP^DGPFRFA(1)"
+64 SET DGDIRO="D^"_DGFIRST_":DT:EX"
+65 SET DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
+66 IF (DGASK=-1)
QUIT
+67 SET DGSORT("DGBEG")=DGASK
+68 ;
+69 ;-- prompt for ending date
+70 SET DGDIRA="Select Ending Date"
+71 SET DGDIRB=""
+72 SET DGDIRH="^D HELP^DGPFRFA(2)"
+73 SET DGDIRO="D^"_DGSORT("DGBEG")_":DT:EX"
+74 SET DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
+75 IF (DGASK=-1)
QUIT
+76 SET DGSORT("DGEND")=DGASK
+77 ;
+78 KILL DGCAT,DGFIL,DGSEL,DGDIRA,DGDIRB,DGDIRO,DGDIRH
+79 KILL DGASK,DGRSLT,DGFIRST
+80 ;
+81 ;-- prompt for device
+82 SET ZTSAVE("DGSORT(")=""
+83 DO EN^XUTMDEVQ("START^DGPFRFA1","Patient Record Flag Assignment Report",.ZTSAVE)
+84 DO HOME^%ZIS
+85 QUIT
+86 ;
HELP(DGSEL) ;provide extended DIR("?") help text.
+1 ;
+2 ; Input: DGSEL - prompt var for help text word selection
+3 ; Output: none
+4 ;
+5 WRITE !," Enter the "_$SELECT(DGSEL=1:"earliest",1:"latest")_" Assignment Date to include in the report."
+6 WRITE !," Please enter a date from the specified date range displayed."
+7 QUIT