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

PRSNRAS0.m

Go to the documentation of this file.
  1. PRSNRAS0 ;WOIFO/DAM - Group Activity - Summary and Detailed;9/10/2009
  1. ;;4.0;PAID;**126**;Sep 21, 1995;Build 59
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. DEP ; Entry point for Data Entry Personnel
  1. N GROUP
  1. D ACCESS^PRSNUT02(.GROUP,"E",DT,1)
  1. ; quit if any error during group selection
  1. I $P($G(GROUP(0)),U,2)="E" D Q
  1. .W !,$P(GROUP(0),U,3)
  1. D MAIN
  1. Q
  1. ;
  1. DAP ; Entry point for Data Approval Personnel
  1. N GROUP
  1. D ACCESS^PRSNUT02(.GROUP,"A",DT,1)
  1. ; quit if any error during group selection
  1. I $P($G(GROUP(0)),U,2)="E" D Q
  1. .W !,$P(GROUP(0),U,3)
  1. D MAIN
  1. Q
  1. ;
  1. COORD ;Entry point for VANOD Coordinator
  1. ; Coordinator has no access limits so let them pick any group
  1. N GROUP
  1. D PIKGROUP^PRSNUT04(.GROUP,"",1)
  1. ; quit if any error during group selection
  1. I $P($G(GROUP(0)),U,2)="E" D Q
  1. .W !,$P(GROUP(0),U,3)
  1. D MAIN
  1. ;
  1. Q
  1. ;
  1. MAIN ;
  1. N RANGE,BEG,END,EXTBEG,EXTEND,STOP
  1. N DAYBEG,DAYEND
  1. N TYPE,BEG,END
  1. S STOP=0
  1. D TYPE
  1. Q:STOP
  1. D DATE
  1. Q:STOP
  1. D QUE
  1. Q
  1. ;
  1. REPORT ;for group of location or t&l
  1. ;
  1. N PRSIEN,PRSNGLB,PRSNG,PICK,PRSNGA,PRSNGB,PG,STOP
  1. N PRSNARY,PRSNAME,PRSNTL
  1. K ^TMP($J,"PRSNR")
  1. U IO
  1. S (PICK,STOP)=0
  1. F S PICK=$O(GROUP(PICK)) Q:PICK=""!STOP D
  1. . S PRSNG=GROUP(0)_"^"_PICK_"^"_GROUP(PICK)
  1. . S PRSNGLB=$S($P(PRSNG,U,2)="N":$NA(^NURSF(211.8,"D",$P(PRSNG,U,7))),1:$NA(^PRSPC("ATL"_$P(PRSNG,U,3))))
  1. . S PRSNGA=""
  1. . F S PRSNGA=$O(@PRSNGLB@(PRSNGA)) QUIT:PRSNGA=""!STOP D
  1. .. S PRSNGB=0
  1. .. F S PRSNGB=$O(@PRSNGLB@(PRSNGA,PRSNGB)) QUIT:'PRSNGB!STOP D
  1. ... I $P(PRSNG,U,2)="N",+$P(PRSNG,U,4)'=+$$PRIMLOC^PRSNUT03(PRSNGB) Q
  1. ... S PRSIEN=$S($P(PRSNG,U,2)="N":+$G(^VA(200,PRSNGB,450)),1:PRSNGB)
  1. ... Q:'+$$ISNURSE^PRSNUT01(PRSIEN)
  1. ... S PRSNARY=$G(^PRSPC(PRSIEN,0))
  1. ... S PRSNAME=$P(PRSNARY,U) ;Nurse Name
  1. ... S PRSNTL=$P(PRSNARY,U,8) ;Nurse T&L
  1. ... S ^TMP($J,"PRSNR",PICK,PRSNAME,PRSIEN)=""
  1. ;
  1. S PG=0,TODAY=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
  1. I TYPE="S" D HDR^PRSNRAS1(EXTBEG,EXTEND)
  1. I TYPE="D" D HDR^PRSNRAD0
  1. S PICK=""
  1. F S PICK=$O(^TMP($J,"PRSNR",PICK)) Q:PICK=""!STOP D
  1. . S GHD="Location: "_PICK
  1. . S TAB=IOM-$L(GHD)/2-5
  1. . W !!,?TAB,GHD,!
  1. . W ?TAB F I=1:1:$L(GHD) W "-"
  1. . S PRSNAME=""
  1. . Q:STOP
  1. . F S PRSNAME=$O(^TMP($J,"PRSNR",PICK,PRSNAME)) Q:PRSNAME=""!STOP D
  1. .. S PRSIEN=""
  1. .. F S PRSIEN=$O(^TMP($J,"PRSNR",PICK,PRSNAME,PRSIEN)) Q:PRSIEN=""!STOP D
  1. ... I TYPE="S" D
  1. .... ;summary report
  1. .... D DSPLY^PRSNRAS1(PRSIEN,BEG,END,EXTBEG,EXTEND,.STOP)
  1. ... I TYPE="D" D
  1. .... ;detailed report
  1. .... D DSPLY^PRSNRAD0(PRSIEN,BEG,END,.STOP)
  1. W !!,"End of Report"
  1. D ^%ZISC
  1. K ^TMP($J,"PRSNR")
  1. Q
  1. ;
  1. TYPE ;Choose summary or detailed group activity report
  1. ;
  1. N DIR,DIRUT,X,Y
  1. S DIR(0)="S^S:Summary Report;D:Detailed Report"
  1. S DIR("A")="Enter Selection"
  1. S DIR("?")="Enter whether you want to select a Summary or Detailed Group Activity Report"
  1. D ^DIR
  1. I $D(DIRUT) S STOP=1 Q
  1. S TYPE=Y
  1. Q
  1. ;
  1. DATE ; User is prompted for a date range
  1. ;
  1. S RANGE=$$POCRANGE^PRSNUT01()
  1. ; QUIT HERE IF RANGE=0
  1. I +$G(RANGE)'>0 S STOP=1
  1. ;
  1. S BEG=$P(RANGE,U)
  1. S END=$P(RANGE,U,2)
  1. S EXTBEG=$P(RANGE,U,3)
  1. S EXTEND=$P(RANGE,U,4)
  1. ;
  1. Q
  1. ;
  1. QUE ;call to generate and display report for individual activity
  1. N %ZIS,POP,IOP
  1. S %ZIS="MQ"
  1. D ^%ZIS
  1. Q:POP
  1. I $D(IO("Q")) D
  1. . K IO("Q")
  1. . N ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTUCI,ZTCPU,ZTPRI,ZTKIL,ZTSYNC
  1. . S ZTDESC="GROUP ACTIVITY "_TYPE_" REPORT"
  1. . S ZTRTN="REPORT^PRSNRAS0"
  1. . S ZTSAVE("GROUP")=""
  1. . S ZTSAVE("GROUP(")=""
  1. . S ZTSAVE("TYPE")=""
  1. . S ZTSAVE("BEG")=""
  1. . S ZTSAVE("END")=""
  1. . S ZTSAVE("EXTBEG")=""
  1. . S ZTSAVE("EXTEND")=""
  1. . D ^%ZTLOAD
  1. . I $D(ZTSK) S ZTREQ="@" W !,"Request "_ZTSK_" queued."
  1. E D
  1. . D REPORT
  1. Q