Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DGPFRAB

DGPFRAB.m

Go to the documentation of this file.
  1. DGPFRAB ;ALB/RBS - PRF APPROVED BY REPORT ; 7/26/05 3:22pm
  1. ;;5.3;Registration;**554,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;This routine will be used for selecting sort parameters to produce
  1. ;the DGPF APPROVED BY REPORT for Patient Record Flags.
  1. ;
  1. ; Selection options will provide the ability to report by:
  1. ; APPROVED BY PERSON
  1. ; CATEGORY
  1. ; STATUS (ASSIGNMENTS)
  1. ; BEGINNING DATE
  1. ; ENDING DATE
  1. ;
  1. ; The following reporting sort array will be built by user prompts:
  1. ; DGSORT("DGAPROV") = pointer to NEW PERSON (#200) file^Person Name
  1. ; or
  1. ; = "A" = All approved by persons
  1. ; DGSORT("DGCAT") = CATEGORY
  1. ; 1^Category I (National)
  1. ; 2^Category II (Local)
  1. ; 3^Both
  1. ; DGSORT("DGSTATUS") = Assignment Status to report on
  1. ; 1^Active
  1. ; 2^Inactive
  1. ; 3^Both
  1. ; DGSORT("DGBEG") = BEGINNING DATE (internal FileMan date)
  1. ; DGSORT("DGEND") = ENDING DATE (internal FileMan date)
  1. ;
  1. ;-- no direct entry
  1. QUIT
  1. ;
  1. EN ;Entry point
  1. ;-- user prompts for report selection sorts
  1. ; Input: none
  1. ; Output: Report generated using user selected parameters
  1. ;
  1. N DGABORT ;abort flag
  1. N DGASK ;return value from $$ANSWER^DGPFUT call
  1. N DGCAT ;flag category to report on
  1. N DGDIRA ;DGDIRA - DIR("A") string
  1. N DGDIRB ;DGDIRB - DIR("B") string
  1. N DGDIRH ;DGDIRH - DIR("?") string
  1. N DGDIRO ;DGDIR0 - DIR(0) string
  1. N DGFIRST ;first assignment date
  1. N DGQ ;quit flag
  1. N DGSEL ;help text var
  1. N DGSORT ;array or report parameters
  1. N ZTSAVE ;open array reference of input parameters used by tasking
  1. ;
  1. ;check for database
  1. S DGFIRST=$P(+$O(^DGPF(26.14,"D","")),".") ;first assignment date
  1. I 'DGFIRST D Q
  1. . W !?2,">>> No Patient Record Flag Assignments have been found.",*7
  1. . I $$ANSWER^DGPFUT("Enter RETURN to continue","","E") ;pause
  1. ;
  1. ;-- prompt for selection of an approved by person
  1. S DGDIRA="Select to report on a (S)ingle Approved By Person or (A)ll"
  1. S DGDIRB="Single"
  1. S DGDIRH="Enter one of the selections to report on"
  1. S DGDIRO="S^S:Single Approved By Person;A:All Approved By Persons"
  1. S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
  1. Q:DGASK=-1!(DGASK=0)
  1. ;
  1. S:DGASK="A" DGSORT("DGAPROV")="A"
  1. ;
  1. D:DGASK="S"
  1. . S (DGQ,DGABORT)=0
  1. . F D Q:(DGQ!DGABORT)
  1. . . S DGASK=$$ANSWER^DGPFUT("Select Approved By Person","","P^200:EMZ","Enter the person approving the record flag assignment","I $D(^DGPF(26.14,""APPRO"",+Y))")
  1. . . I DGASK<1 S DGABORT=1 Q
  1. . . S DGSORT("DGAPROV")=DGASK_U_$$EXTERNAL^DILFD(26.14,.05,"F",DGASK)
  1. . . S DGQ=1
  1. ;
  1. Q:$G(DGABORT)
  1. ;
  1. ;-- prompt for selection of a flag category
  1. S DGDIRA="Select Flag Category"
  1. S DGDIRB="Both"
  1. S DGDIRH="Enter one of the category selections to report on"
  1. S DGDIRO="S^1:Category I (National);2:Category II (Local);3:Both"
  1. S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
  1. Q:(DGASK<1)
  1. S DGCAT=DGASK,DGSORT("DGCAT")=DGASK_U_$S(DGCAT=1:"Category I (National)",DGCAT=2:"Category II (Local)",DGCAT=3:"Both",1:"")
  1. ;
  1. ;-- prompt for selection of the assignment status to report on
  1. S DGDIRA="Select Assignment Status to report on"
  1. S DGDIRB="Both"
  1. S DGDIRH="Enter one of the status selections to report on"
  1. S DGDIRO="S^1:Active;2:Inactive;3:Both"
  1. S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
  1. Q:(DGASK<1)
  1. S DGSORT("DGSTATUS")=DGASK_U_$S(DGASK=1:"Active",DGASK=2:"Inactive",DGASK=3:"Both",1:3)
  1. ;
  1. ;-- prompt for beginning date
  1. S DGDIRA="Select Beginning Date"
  1. S DGDIRB=""
  1. S DGDIRH="^D HELP^DGPFRAB(1)"
  1. S DGDIRO="D^"_DGFIRST_":DT:EX"
  1. S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
  1. Q:(DGASK=-1)
  1. S DGSORT("DGBEG")=DGASK
  1. ;
  1. ;-- prompt for ending date
  1. S DGDIRA="Select Ending Date"
  1. S DGDIRB=""
  1. S DGDIRH="^D HELP^DGPFRAB(2)"
  1. S DGDIRO="D^"_DGSORT("DGBEG")_":DT:EX"
  1. S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
  1. Q:(DGASK=-1)
  1. S DGSORT("DGEND")=DGASK
  1. ;
  1. K DGCAT,DGDIRA,DGDIRB,DGDIRO,DGDIRH,DGASK,DGQ,DGABORT
  1. ;
  1. ;-- prompt for device
  1. S ZTSAVE("DGSORT(")=""
  1. D EN^XUTMDEVQ("START^DGPFRAB1","Assignments Approved By Report",.ZTSAVE)
  1. D HOME^%ZIS
  1. Q
  1. ;
  1. HELP(DGSEL) ;provide extended DIR("?") help text.
  1. ;
  1. ; Input: DGSEL - prompt var for help text word selection
  1. ; Output: none
  1. ;
  1. W !," Enter the "_$S(DGSEL=1:"earliest",1:"latest")_" Assignment Date to include in the report."
  1. W !," Please enter a date from the specified date range displayed."
  1. Q