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

DGPFRPA.m

Go to the documentation of this file.
  1. DGPFRPA ;ALB/RBS - PRF PATIENT ASSIGNMENTS REPORT ; 5/11/04 3:35pm
  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 PATIENT ASSIGNMENTS REPORT for Patient Record Flags.
  1. ;
  1. ; Selection options will provide the ability to report by:
  1. ; PATIENT
  1. ; STATUS (ASSIGNMENTS)
  1. ;
  1. ; The following reporting sort array will be built by user prompts:
  1. ; DGSORT("DGDFN") = Patient IEN of (#2) file to report on
  1. ; DGSORT("DGSTATUS") = Assignment Status to report on
  1. ; 1^Active
  1. ; 2^Inactive
  1. ; 3^Both
  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 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 DGIEN ;assignment ien
  1. N DGIENS ;array of ien's of the patients assignment records
  1. N DGOK ;ok flag for finding assignments to report on
  1. N DGPFA ;assignment array
  1. N DGQ ;quit flag
  1. N DGSORT ;array or report parameters
  1. N SAVEXQY0 ;temp save var
  1. N ZTSAVE ;open array reference of input parameters used by tasking
  1. ;
  1. ;-- prompt for patient to report on
  1. ; suppress display of Active Record Flags in DISPPRF^DGPFAPI
  1. ; save variable before temporarily deleting it so that the
  1. ; code, Q:'$D(XQY0), in DISPPRF^DGPFAPI will suppress the display
  1. ;
  1. K SAVEXQY0
  1. I $D(XQY0) S SAVEXQY0=XQY0 K XQY0 ;save original
  1. ;
  1. D SELPAT^DGPFUT1(.DGASK)
  1. ;
  1. I $D(SAVEXQY0) S XQY0=SAVEXQY0 K SAVEXQY0 ;restore original
  1. ;
  1. Q:(DGASK<1)
  1. ; get all assignment ien's for the patient
  1. I '$$GETALL^DGPFAA(DGASK,.DGIENS) D Q
  1. . W !?2,">>> Selected patient has no record flag assignments on file.",*7
  1. ;
  1. S DGSORT("DGDFN")=DGASK
  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 DGQ=0
  1. I DGASK'=3 D
  1. . S (DGIEN,DGOK)=0
  1. . F S DGIEN=$O(DGIENS(DGIEN)) Q:'DGIEN D Q:(DGOK!DGQ)
  1. . . ;-get assignment
  1. . . K DGPFA
  1. . . I $$GETASGN^DGPFAA(DGIEN,.DGPFA),$P(DGPFA("STATUS"),U)=DGASK S DGOK=1 Q
  1. . Q:DGOK
  1. . S DGQ=1
  1. . W !?2,">>> Selected patient has no '"_$S(DGASK=1:"Active",1:"Inactive")_"' record flag assignments on file.",*7
  1. ;
  1. Q:DGQ
  1. S DGSORT("DGSTATUS")=DGASK_U_$S(DGASK=1:"Active",DGASK=2:"Inactive",DGASK=3:"Both",1:3)
  1. ;
  1. K DGASK,DGOK,DGQ,DGIEN,DGIENS,DGDIRA,DGDIRB,DGDIRO,DGDIRH
  1. ;
  1. ;-- prompt for device
  1. S ZTSAVE("DGSORT(")=""
  1. D EN^XUTMDEVQ("START^DGPFRPA1","Patient Assignments Report",.ZTSAVE)
  1. D HOME^%ZIS
  1. Q