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

DGPFRPI.m

Go to the documentation of this file.
  1. DGPFRPI ;ALB/RBS - PRF PRINCIPAL INVEST REPORT ; 7/26/05 3:39pm
  1. ;;5.3;Registration;**554,730,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;This routine will be used for selecting sort parameters to produce
  1. ;the DGPF PRINCIPAL INVEST REPORT for Patient Record Flags.
  1. ;
  1. ; Selection options will provide the ability to report by:
  1. ; PRINCIPAL INVESTIGATOR
  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("DGPRINC") = pointer to NEW PERSON (#200) file^Person Name
  1. ; or
  1. ; = "A" = All Principal Investigator's
  1. ; DGSORT("DGCAT") = CATEGORY
  1. ; 2^Category II (Local)
  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 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 DGDIRS ;DGDIRS - DIR("S") 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 Principal Investigator or (A)ll"
  1. S DGDIRB="Single"
  1. S DGDIRH="Enter one of the selections to report on"
  1. S DGDIRO="S^S:Single Principal Investigator;A:All Principal Investigators"
  1. S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
  1. Q:DGASK=-1!(DGASK=0)
  1. ;
  1. S:DGASK="A" DGSORT("DGPRINC")="A"
  1. ;
  1. D:DGASK="S"
  1. .S (DGQ,DGABORT)=0
  1. .N DIC,D,X,Y,I
  1. .S DIC="^DGPF(26.11,"
  1. .S DIC(0)="AEQZ"
  1. .S D="C"
  1. .S DIC("A")="Select Principal Investigator's name: "
  1. .D IX^DIC
  1. .I Y<0 S DGABORT=1 Q
  1. .S I=0
  1. .F S I=$O(^DGPF(26.11,+Y,2,"B",I)) Q:'I I $P(^VA(200,I,0),U)[X Q
  1. .I '$G(I) S DGABORT=1 Q
  1. .S DGSORT("DGPRINC")=I_U_$$EXTERNAL^DILFD(26.112,.01,"F",I)
  1. .S DGQ=1
  1. ;
  1. Q:$G(DGABORT)
  1. ;
  1. ;-- prompt for selection of a flag category
  1. ; only Cat II (Local) file (#26.11) has Research Flags
  1. S DGSORT("DGCAT")=2_U_"Category II (Local)"
  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^DGPFRPI(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^DGPFRPI(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 DGDIRA,DGDIRB,DGDIRO,DGDIRH,DGDIRS,DGASK,DGQ,DGABORT
  1. ;
  1. ;-- prompt for device
  1. S ZTSAVE("DGSORT(")=""
  1. D EN^XUTMDEVQ("START^DGPFRPI1","Assignments By Principle Investigator 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