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

PRSNRDN1.m

Go to the documentation of this file.
  1. PRSNRDN1 ;WOIFO/KJS - GROUP SUMMARY ACTIVITY DIRECT AND NON DIRECT II REPORT ;080411
  1. ;;4.0;PAID;**126**;Sep 21, 1995;Build 59
  1. ;;Per VHA Directive 2004-038, this routine should not be modified
  1. ;
  1. ;
  1. ;
  1. GATHER(SKILMIX,GRP,PRSIEN,BEG,END) ;Entry point to gather POC data from 451
  1. ;INPUT:
  1. ; SKILMIX: ARRAY containing totals for various types of work
  1. ; subscripted by nurse role (or skill mix)
  1. ; GRP: Nurse default location or T&L Unit
  1. ; PRSIEN: Nurse ien 450
  1. ; BEG,END: FileMan begin and end dates for report
  1. ;
  1. N INDEX,CNT,DAYNODE,FMDT,PPIEN,PRSNDAY
  1. S FMDT=BEG-.1
  1. S (INDEX,CNT)=0
  1. F S FMDT=$O(^PRST(458,"AD",FMDT)) Q:FMDT>END!(FMDT'>0)!STOP D
  1. .S DAYNODE=$G(^PRST(458,"AD",FMDT))
  1. .S PPIEN=+DAYNODE
  1. .S PRSNDAY=$P(DAYNODE,U,2)
  1. .K POCD ;array to hold POC data
  1. .D L1^PRSNRUT1(.POCD,PPIEN,PRSIEN,PRSNDAY)
  1. .Q:$G(POCD(0))=0
  1. .D DATA(.SKILMIX,GRP)
  1. ;
  1. Q
  1. ;
  1. ;
  1. DATA(SKILMIX,GRP) ;Extract data from POCD array
  1. ;
  1. N PRSL,ST,SP,MEAL,HOURS,TT,TIEN,POC,POC1,WIEN,TW,TWD,TYPETM,TYPEWK
  1. ;
  1. S PRSL=0
  1. F S PRSL=$O(POCD(PRSL)) Q:PRSL'>0 D
  1. .;
  1. .;Start and stop time and mealtime
  1. .S ST=$P(POCD(PRSL),U),SP=$P(POCD(PRSL),U,2),MEAL=$P(POCD(PRSL),U,3)
  1. .;
  1. .;Get elapsed time
  1. .S HOURS=$$AMT^PRSPSAPU(ST,SP,MEAL)
  1. .;
  1. .;Type of Time code IEN
  1. .S (TIEN,TYPETM)=""
  1. .S TT=$P(POCD(PRSL),U,4)
  1. .I TT'="" D
  1. ..;
  1. ..;Type of Time code
  1. ..S TIEN=$O(^PRST(457.3,"B",TT,TIEN))
  1. ..Q:TIEN=""
  1. ..;
  1. ..;Description for Type of Time code
  1. ..S TYPETM=$P(^PRST(457.3,TIEN,0),U,2) ;eg, Direct Care, AL
  1. ..;
  1. .S POC1=""
  1. .S POC=$P(POCD(PRSL),U,5)
  1. .I POC'="" D
  1. ..S POC1=$P($$ISACTIVE^PRSNUT01(DT,POC),U,2) ;Location
  1. .;
  1. .;Type of Work Code IEN
  1. .S (TW,TWD)=""
  1. .S WIEN=$P(POCD(PRSL),U,6)
  1. .I WIEN'="" D
  1. ..;
  1. ..;Type of Work Code
  1. ..S TW=$P(^PRSN(451.5,WIEN,0),U)
  1. ..;
  1. ..;Description for Type of Work code
  1. ..S TWD=$P(^PRSN(451.5,WIEN,0),U,2)
  1. .
  1. .; save skill mix, hours and type of work into SKILMIX array
  1. .Q:(TYPETM="")!(POC1="")
  1. .;
  1. .S TYPEWK=$S(TW="DC":"Direct",1:"Non Direct")
  1. .S SKILMIX(GRP,TYPETM,TYPEWK)=$G(SKILMIX(GRP,TYPETM,TYPEWK))+HOURS
  1. Q
  1. HDR(EXTBEG,EXTEND) ;Display header for report of Individual Nurse Activity
  1. ;
  1. W @IOF
  1. S PG=PG+1,PRTGP=1
  1. W ?17,"GROUP SUMMARY ACTIVITY DIRECT AND NON DIRECT REPORT"
  1. W !,?15,EXTBEG_" - "_EXTEND,?45,"Run Date: ",TODAY,?70,"Page: ",$J(PG,3)
  1. W ! ;blank line
  1. W !,"Location",?22,"Type of Time",?44,"Type of Work",?75,"Hours"
  1. W !,"--------------------------------------------------------------------------------"
  1. ;
  1. Q
  1. PRTLP(EXTBEG,EXTEND) ;Order through SKILMIX array, total data & display
  1. N RNDC,LNDC,UNDC,GP,TNDC,TYPEWK,TYPETM
  1. S GP=0
  1. F S GP=$O(SKILMIX(GP)) Q:GP=""!STOP D
  1. .S TYPETM="",PRTGP=1
  1. .F S TYPETM=$O(SKILMIX(GP,TYPETM)) Q:TYPETM=""!STOP D
  1. ..S (RNDC,LNDC,UNDC,TNDC)=0
  1. ..S TYPEWK=""
  1. ..F S TYPEWK=$O(SKILMIX(GP,TYPETM,TYPEWK)) Q:TYPEWK=""!STOP D
  1. ...S TOTHRS=$P(SKILMIX(GP,TYPETM,TYPEWK),U)
  1. ...D PPP(.STOP,EXTBEG,EXTEND)
  1. Q
  1. PPP(STOP,EXTBEG,EXTEND) ;
  1. I PRTGP W !,GP S PRTGP=0
  1. W ?22,TYPETM,?44,TYPEWK,?72,$J(TOTHRS,8,2),!
  1. I (IOSL-5)<$Y S STOP=$$ASK^PRSLIB00() I 'STOP D HDR(EXTBEG,EXTEND)
  1. Q