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

PRSNRGD0.m

Go to the documentation of this file.
  1. PRSNRGD0 ;WOIFO/KJS - Nursing LOCATION DETAIL Report ;8/2/2011
  1. ;;4.0;PAID;**126**;Sep 21, 1995;Build 59
  1. ;;Per VHA Directive 2004-038, this routine should not be modified
  1. QUIT
  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. I $P($G(GROUP(0)),U,2)="E" D Q
  1. .W !,$P(GROUP(0),U,3)
  1. D MAIN
  1. Q
  1. ;
  1. MAIN ;call to generate and display report for individual activity
  1. ;
  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="Nursing Location Detail Report"
  1. . S ZTRTN="REPORT^PRSNRGD0"
  1. . S ZTSAVE("GROUP(")=""
  1. . S ZTSAVE("TYPE")=""
  1. . D ^%ZTLOAD
  1. . I $D(ZTSK) S ZTREQ="@" W !,"Request "_ZTSK_" Queued."
  1. E D REPORT
  1. ;
  1. Q
  1. ;
  1. REPORT ;for group of location or t&l
  1. ;
  1. N PRSIEN,PRSNGLB,PRSNG,GHD,PICK,SORT,STOP,I,PRSNGA,PRSNGB,TAB,PG,FTEE,TOTNUR,TOTFTEE
  1. U IO
  1. S SORT=$P(GROUP(0),U,2),PG=0,(FTEE,TOTFTEE,TOTNUR)=0
  1. K ^TMP($J)
  1. D HDR^PRSNRGD1
  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. .;
  1. .;
  1. .K ^TMP($J)
  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. ...S NURSE=$$ISNURSE^PRSNUT01(PRSIEN)
  1. ...Q:'+NURSE
  1. ...S JOB=$$GETCODES^PRSNUT01(PRSIEN) ;Job codes
  1. ...S BOC=$P(JOB,U)
  1. ...S OCC=$P(JOB,U,2)
  1. ...D INFO^PRSNRAS1
  1. ...S ^TMP($J,OCC,PRSNAME,PRSIEN)=NURSE
  1. .; display and underline group sub header
  1. .;
  1. .Q:STOP
  1. .S GHD=$S($P(PRSNG,U,2)="N":"LOCATION",1:"T&L UNIT")_": "_$P(PRSNG,U,3)
  1. .S TAB=IOM-$L(GHD)/2-5
  1. .W !!,?TAB,GHD,!
  1. .W ?TAB F I=1:1:$L(GHD) W "-"
  1. .S S1=""
  1. .F S S1=$O(^TMP($J,S1)) Q:S1=""!STOP D
  1. ..S S2=""
  1. ..F S S2=$O(^TMP($J,S1,S2)) Q:S2=""!STOP D
  1. ...S PRSIEN=""
  1. ...F S PRSIEN=$O(^TMP($J,S1,S2,PRSIEN)) Q:PRSIEN=""!STOP D
  1. ....S NURSE=^TMP($J,S1,S2,PRSIEN)
  1. ....D DSPLY^PRSNRGD1(PRSIEN,NURSE,.STOP)
  1. W !!,?40,"Total Nurses: ",$J(TOTNUR,4),?60,"Total FTEE: ",?72,$J(TOTFTEE,8,2)
  1. W !!,"End of Report"
  1. D ^%ZISC
  1. K ^TMP($J)
  1. Q
  1. ;