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

PRSEEMP3.m

Go to the documentation of this file.
  1. PRSEEMP3 ;WIRMFO/JAH-STUDENT TRAINING REPORT BY SERVICE ;7/2/97
  1. ;;4.0;PAID;**25**;Sep 21, 1995
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1. EN1 ;
  1. N PRSE132,CCORG,PRSERV,ZZ,SERVIEN,CLOCK,HWIDE,X,DATSEL,POUT
  1. N CEU,PRESEL,SERCNT,EMPCNT,CCOCNT,YRST,YREND,REPDT
  1. ;set spin clock counter
  1. S CLOCK=1
  1. ;
  1. ;If user has PRSE CORD key/programmer continue
  1. I '(+$$EN4^PRSEUTL3($G(DUZ))!(DUZ(0)["@")) D MSG22^PRSEMSG S ZZ=$$ASK^PRSLIB00(1) Q
  1. ;
  1. ;Check 2 make sure Educ. Track. is Online
  1. S X=$G(^PRSE(452.7,1,"OFF"))
  1. I X=""!(X=1) D MSG6^PRSEMSG S ZZ=$$ASK^PRSLIB00(1) Q
  1. ;
  1. S (POUT,NPC,NSW1)=0,HOLD=1
  1. ;
  1. ;Ask date range/fiscal/calender year. YRST, YREND returned as range.
  1. W ! S DATSEL="N+"
  1. D DATSEL^PRSEUTL G:$G(POUT) EXIT^PRSEEMP4
  1. ;
  1. ;Ask type of training 2 search. Code 4 search returned in PRSESEL.
  1. ;M:Mandatory C:Continuing Educ O:Other W:Ward/Unit-Locat
  1. ;A:All ;L:All without Mandatory
  1. D INS2^PRSEUTL G EXIT^PRSEEMP4:$G(POUT)
  1. ;
  1. ;set flag when selection contains CEU type classes.
  1. S CEU=0
  1. I PRSESEL="C"!(PRSESEL="A")!(PRSESEL="L")!(PRSESEL="H") S CEU=1
  1. ;
  1. ; find hospital wide classes 2 screen out of report
  1. I PRSESEL="H" D HWLIST^PRSEEMP4,HASHLIST^PRSEEMP4
  1. ;
  1. ;call 2 select 1,many,all services.
  1. N DIC,Y
  1. S DIC="^PRSP(454.1,"
  1. S VAUTSTR="Service"
  1. S VAUTNI=2,VAUTVB="PRSERV"
  1. D FIRST^VAUTOMA
  1. ;
  1. ;quit if user ^ at service prompt
  1. Q:Y<0
  1. ;
  1. W ! S ZTRTN="START^PRSEEMP3",ZTDESC="TRAINING REPORT BY SERVICE" D L,DEV^PRSEUTL G:POP!($D(ZTSK)) EXIT^PRSEEMP4
  1. START ;
  1. U IO
  1. ;initialize temp global and set unknown entry in job table.
  1. K ^TMP($J),^TMP("JOBS",$J)
  1. S ^TMP("JOBS",$J,0)="unknown"
  1. ;
  1. I $E(IOST,1,2)="C-" D
  1. . D MSSG^PRSLIB00(.MSG)
  1. . D MONOGRPH^PRSLIB00(MSG)
  1. S (PHRS,PHRS("CEU"),PHRS("CON"),PCOUNT)=0,PRSE132=$S(IOM'<132:132,1:0)
  1. ;
  1. ;If user selects all services then fill up PRSERV array
  1. I PRSERV=1 D ALLSERV(.PRSERV)
  1. ;
  1. ;Drive thru services user has selected. They may select 1,many,all
  1. ;or abort. If user selects 1 or 1+, PRSERV(ien)=selection(s),
  1. ;PRSERV=0. If user selects ALL, PRSERV=1
  1. N SERVICE,SERVIEN,EMPIEN,EMPNAME,CCIEN,CCORG
  1. S (SERVIEN,POUT,SRVCNT)=0
  1. F S SERVIEN=$O(PRSERV(SERVIEN)) Q:SERVIEN=""!(POUT) D
  1. . S SRVCNT=SRVCNT+1
  1. . S SERVICE=PRSERV(SERVIEN)
  1. .;
  1. .;There r many Cost Ctrs 4 each service. Use cost ctrs
  1. .;2 find all employees in service.
  1. . S CCIEN=0
  1. . F S CCIEN=$O(^PRSP(454,1,"ORG","C",SERVIEN,CCIEN)) Q:CCIEN=""!(POUT) D
  1. .. S CCORG=$P(^PRSP(454,1,"ORG",CCIEN,0),"^",1)
  1. .. S CCORG=$P(CCORG,":",1)_$P(CCORG,":",2)
  1. ..;
  1. ..; Get employees w/in cost ctr
  1. .. S EMPIEN=0
  1. .. F S EMPIEN=$O(^PRSPC("ACC",CCORG,EMPIEN)) Q:EMPIEN=""!(POUT) D
  1. ... S EMPNAME=$P($G(^PRSPC(EMPIEN,0)),"^",1)
  1. ... S EMPOINT=$G(^PRSPC(EMPIEN,200))
  1. ... I EMPOINT'="" D SORT^PRSEEMP4(EMPOINT)
  1. ;
  1. S (SERCNT,EMPCNT,CCOCNT)=0
  1. ;get date for report
  1. S X="T" D ^%DT S REPDT=+Y
  1. ;Drive thru services & cost ctr/orgs 2 print output 4 employees
  1. S SERVIEN=0
  1. F S SERVIEN=$O(^TMP($J,SERVIEN)) Q:SERVIEN'>0!(POUT) D
  1. . S SERVICE=PRSERV(SERVIEN)
  1. . S SERCNT=SERCNT+1
  1. .;Initialize cost ctr global & counters
  1. . D INITCC(.CCORG)
  1. . F S CCORG=$O(^TMP($J,SERVIEN,CCORG)) Q:CCORG=""!(POUT) D
  1. .. S CCOCNT=CCOCNT+1
  1. .. S EMPIEN=""
  1. .. F S EMPIEN=$O(^TMP($J,SERVIEN,CCORG,EMPIEN)) Q:EMPIEN=""!(POUT) D
  1. ... D INITEMP^PRSEEMP3 ;initialize course counters 4 employee
  1. ... S EMPCNT=EMPCNT+1
  1. ... S EMPNODE=^TMP($J,SERVIEN,CCORG,EMPIEN,0)
  1. ... S DATA=$P(EMPNODE,"^",1)
  1. ... S JOBCODE=$P(EMPNODE,"^",2)
  1. ... S EMPNAME=$P(EMPNODE,"^",3)
  1. ... D OUTPUT^PRSEEMP4(EMPIEN,.POUT,JOBCODE,EMPNAME)
  1. I POUT S ^TMP("EORM",$J,2)="- Incomplete report. User aborted."
  1. D STATS,MSSGS
  1. D EXIT^PRSEEMP4
  1. Q
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1. STATS ;
  1. N HDR,UND,TAB1,PTAB
  1. S HDR="END OF TRAINING REPORT BY SERVICE"
  1. S UND="================================="
  1. S PTAB=(IOM-9)
  1. S TAB1=($G(IOM)/2-($L(HDR)/2)) ;center hdr on page
  1. W @IOF,?PTAB,"PAGE ",NPC+1
  1. W !,?TAB1,HDR,!,?TAB1,UND
  1. W !,"Employees counted: ",EMPCNT
  1. W !,"Services counted: ",SERCNT
  1. W !,"Cost Centers counted: ",CCOCNT
  1. Q
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1. MSSGS ;Write any messages that we've created during processing.
  1. N EOR
  1. W !,"----------------",!
  1. ;
  1. S EOR="" F S EOR=$O(^TMP("EORM",$J,EOR)) Q:EOR="" D
  1. .W !,^TMP("EORM",$J,EOR)
  1. W !
  1. Q
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1. ALLSERV(PRSERV) ; Put all services in PAID COST CTR/ORGANIZATION file
  1. ;in2 PRSERV() array, subscripted by IEN = "service name".
  1. S SERVICE=""
  1. F S SERVICE=$O(^PRSP(454.1,"B",SERVICE)) Q:SERVICE="" D
  1. .S SERVIEN=0,SERVIEN=$O(^PRSP(454.1,"B",SERVICE,SERVIEN))
  1. .I SERVIEN'="",$G(^PRSP(454.1,SERVIEN,0))'="" S PRSERV(SERVIEN)=SERVICE
  1. Q
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1. INITCC(CCORG) ;INITIALIZE COST CTR STUFF
  1. K ^TMP($J,"CC")
  1. S CCORG=""
  1. Q
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1. INITEMP ;initialize all counters 4 an employee
  1. S (PCOUNT,PHRS,PHRS("CEU"),PHRS("CON"))=0
  1. Q
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1. L F X="PHRS*","PCOUNT","PYR","PRDA","YRST","YREND","HOLD","PRSECLS","PRSESEL","POUT","NPC","NSW1","TYP","PRSERV*","PRSERV(","CEU" S ZTSAVE(X)=""
  1. Q
  1. ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%