- PRSEEMP3 ;WIRMFO/JAH-STUDENT TRAINING REPORT BY SERVICE ;7/2/97
- ;;4.0;PAID;**25**;Sep 21, 1995
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- EN1 ;
- N PRSE132,CCORG,PRSERV,ZZ,SERVIEN,CLOCK,HWIDE,X,DATSEL,POUT
- N CEU,PRESEL,SERCNT,EMPCNT,CCOCNT,YRST,YREND,REPDT
- ;set spin clock counter
- S CLOCK=1
- ;
- ;If user has PRSE CORD key/programmer continue
- I '(+$$EN4^PRSEUTL3($G(DUZ))!(DUZ(0)["@")) D MSG22^PRSEMSG S ZZ=$$ASK^PRSLIB00(1) Q
- ;
- ;Check 2 make sure Educ. Track. is Online
- S X=$G(^PRSE(452.7,1,"OFF"))
- I X=""!(X=1) D MSG6^PRSEMSG S ZZ=$$ASK^PRSLIB00(1) Q
- ;
- S (POUT,NPC,NSW1)=0,HOLD=1
- ;
- ;Ask date range/fiscal/calender year. YRST, YREND returned as range.
- W ! S DATSEL="N+"
- D DATSEL^PRSEUTL G:$G(POUT) EXIT^PRSEEMP4
- ;
- ;Ask type of training 2 search. Code 4 search returned in PRSESEL.
- ;M:Mandatory C:Continuing Educ O:Other W:Ward/Unit-Locat
- ;A:All ;L:All without Mandatory
- D INS2^PRSEUTL G EXIT^PRSEEMP4:$G(POUT)
- ;
- ;set flag when selection contains CEU type classes.
- S CEU=0
- I PRSESEL="C"!(PRSESEL="A")!(PRSESEL="L")!(PRSESEL="H") S CEU=1
- ;
- ; find hospital wide classes 2 screen out of report
- I PRSESEL="H" D HWLIST^PRSEEMP4,HASHLIST^PRSEEMP4
- ;
- ;call 2 select 1,many,all services.
- N DIC,Y
- S DIC="^PRSP(454.1,"
- S VAUTSTR="Service"
- S VAUTNI=2,VAUTVB="PRSERV"
- D FIRST^VAUTOMA
- ;
- ;quit if user ^ at service prompt
- Q:Y<0
- ;
- W ! S ZTRTN="START^PRSEEMP3",ZTDESC="TRAINING REPORT BY SERVICE" D L,DEV^PRSEUTL G:POP!($D(ZTSK)) EXIT^PRSEEMP4
- START ;
- U IO
- ;initialize temp global and set unknown entry in job table.
- K ^TMP($J),^TMP("JOBS",$J)
- S ^TMP("JOBS",$J,0)="unknown"
- ;
- I $E(IOST,1,2)="C-" D
- . D MSSG^PRSLIB00(.MSG)
- . D MONOGRPH^PRSLIB00(MSG)
- S (PHRS,PHRS("CEU"),PHRS("CON"),PCOUNT)=0,PRSE132=$S(IOM'<132:132,1:0)
- ;
- ;If user selects all services then fill up PRSERV array
- I PRSERV=1 D ALLSERV(.PRSERV)
- ;
- ;Drive thru services user has selected. They may select 1,many,all
- ;or abort. If user selects 1 or 1+, PRSERV(ien)=selection(s),
- ;PRSERV=0. If user selects ALL, PRSERV=1
- N SERVICE,SERVIEN,EMPIEN,EMPNAME,CCIEN,CCORG
- S (SERVIEN,POUT,SRVCNT)=0
- F S SERVIEN=$O(PRSERV(SERVIEN)) Q:SERVIEN=""!(POUT) D
- . S SRVCNT=SRVCNT+1
- . S SERVICE=PRSERV(SERVIEN)
- .;
- .;There r many Cost Ctrs 4 each service. Use cost ctrs
- .;2 find all employees in service.
- . S CCIEN=0
- . F S CCIEN=$O(^PRSP(454,1,"ORG","C",SERVIEN,CCIEN)) Q:CCIEN=""!(POUT) D
- .. S CCORG=$P(^PRSP(454,1,"ORG",CCIEN,0),"^",1)
- .. S CCORG=$P(CCORG,":",1)_$P(CCORG,":",2)
- ..;
- ..; Get employees w/in cost ctr
- .. S EMPIEN=0
- .. F S EMPIEN=$O(^PRSPC("ACC",CCORG,EMPIEN)) Q:EMPIEN=""!(POUT) D
- ... S EMPNAME=$P($G(^PRSPC(EMPIEN,0)),"^",1)
- ... S EMPOINT=$G(^PRSPC(EMPIEN,200))
- ... I EMPOINT'="" D SORT^PRSEEMP4(EMPOINT)
- ;
- S (SERCNT,EMPCNT,CCOCNT)=0
- ;get date for report
- S X="T" D ^%DT S REPDT=+Y
- ;Drive thru services & cost ctr/orgs 2 print output 4 employees
- S SERVIEN=0
- F S SERVIEN=$O(^TMP($J,SERVIEN)) Q:SERVIEN'>0!(POUT) D
- . S SERVICE=PRSERV(SERVIEN)
- . S SERCNT=SERCNT+1
- .;Initialize cost ctr global & counters
- . D INITCC(.CCORG)
- . F S CCORG=$O(^TMP($J,SERVIEN,CCORG)) Q:CCORG=""!(POUT) D
- .. S CCOCNT=CCOCNT+1
- .. S EMPIEN=""
- .. F S EMPIEN=$O(^TMP($J,SERVIEN,CCORG,EMPIEN)) Q:EMPIEN=""!(POUT) D
- ... D INITEMP^PRSEEMP3 ;initialize course counters 4 employee
- ... S EMPCNT=EMPCNT+1
- ... S EMPNODE=^TMP($J,SERVIEN,CCORG,EMPIEN,0)
- ... S DATA=$P(EMPNODE,"^",1)
- ... S JOBCODE=$P(EMPNODE,"^",2)
- ... S EMPNAME=$P(EMPNODE,"^",3)
- ... D OUTPUT^PRSEEMP4(EMPIEN,.POUT,JOBCODE,EMPNAME)
- I POUT S ^TMP("EORM",$J,2)="- Incomplete report. User aborted."
- D STATS,MSSGS
- D EXIT^PRSEEMP4
- Q
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- STATS ;
- N HDR,UND,TAB1,PTAB
- S HDR="END OF TRAINING REPORT BY SERVICE"
- S UND="================================="
- S PTAB=(IOM-9)
- S TAB1=($G(IOM)/2-($L(HDR)/2)) ;center hdr on page
- W @IOF,?PTAB,"PAGE ",NPC+1
- W !,?TAB1,HDR,!,?TAB1,UND
- W !,"Employees counted: ",EMPCNT
- W !,"Services counted: ",SERCNT
- W !,"Cost Centers counted: ",CCOCNT
- Q
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- MSSGS ;Write any messages that we've created during processing.
- N EOR
- W !,"----------------",!
- ;
- S EOR="" F S EOR=$O(^TMP("EORM",$J,EOR)) Q:EOR="" D
- .W !,^TMP("EORM",$J,EOR)
- W !
- Q
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- ALLSERV(PRSERV) ; Put all services in PAID COST CTR/ORGANIZATION file
- ;in2 PRSERV() array, subscripted by IEN = "service name".
- S SERVICE=""
- F S SERVICE=$O(^PRSP(454.1,"B",SERVICE)) Q:SERVICE="" D
- .S SERVIEN=0,SERVIEN=$O(^PRSP(454.1,"B",SERVICE,SERVIEN))
- .I SERVIEN'="",$G(^PRSP(454.1,SERVIEN,0))'="" S PRSERV(SERVIEN)=SERVICE
- Q
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- INITCC(CCORG) ;INITIALIZE COST CTR STUFF
- K ^TMP($J,"CC")
- S CCORG=""
- Q
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- INITEMP ;initialize all counters 4 an employee
- S (PCOUNT,PHRS,PHRS("CEU"),PHRS("CON"))=0
- Q
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- L F X="PHRS*","PCOUNT","PYR","PRDA","YRST","YREND","HOLD","PRSECLS","PRSESEL","POUT","NPC","NSW1","TYP","PRSERV*","PRSERV(","CEU" S ZTSAVE(X)=""
- Q
- ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRSEEMP3 5467 printed Feb 18, 2025@23:53:09 Page 2
- PRSEEMP3 ;WIRMFO/JAH-STUDENT TRAINING REPORT BY SERVICE ;7/2/97
- +1 ;;4.0;PAID;**25**;Sep 21, 1995
- +2 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- EN1 ;
- +1 NEW PRSE132,CCORG,PRSERV,ZZ,SERVIEN,CLOCK,HWIDE,X,DATSEL,POUT
- +2 NEW CEU,PRESEL,SERCNT,EMPCNT,CCOCNT,YRST,YREND,REPDT
- +3 ;set spin clock counter
- +4 SET CLOCK=1
- +5 ;
- +6 ;If user has PRSE CORD key/programmer continue
- +7 IF '(+$$EN4^PRSEUTL3($GET(DUZ))!(DUZ(0)["@"))
- DO MSG22^PRSEMSG
- SET ZZ=$$ASK^PRSLIB00(1)
- QUIT
- +8 ;
- +9 ;Check 2 make sure Educ. Track. is Online
- +10 SET X=$GET(^PRSE(452.7,1,"OFF"))
- +11 IF X=""!(X=1)
- DO MSG6^PRSEMSG
- SET ZZ=$$ASK^PRSLIB00(1)
- QUIT
- +12 ;
- +13 SET (POUT,NPC,NSW1)=0
- SET HOLD=1
- +14 ;
- +15 ;Ask date range/fiscal/calender year. YRST, YREND returned as range.
- +16 WRITE !
- SET DATSEL="N+"
- +17 DO DATSEL^PRSEUTL
- if $GET(POUT)
- GOTO EXIT^PRSEEMP4
- +18 ;
- +19 ;Ask type of training 2 search. Code 4 search returned in PRSESEL.
- +20 ;M:Mandatory C:Continuing Educ O:Other W:Ward/Unit-Locat
- +21 ;A:All ;L:All without Mandatory
- +22 DO INS2^PRSEUTL
- if $GET(POUT)
- GOTO EXIT^PRSEEMP4
- +23 ;
- +24 ;set flag when selection contains CEU type classes.
- +25 SET CEU=0
- +26 IF PRSESEL="C"!(PRSESEL="A")!(PRSESEL="L")!(PRSESEL="H")
- SET CEU=1
- +27 ;
- +28 ; find hospital wide classes 2 screen out of report
- +29 IF PRSESEL="H"
- DO HWLIST^PRSEEMP4
- DO HASHLIST^PRSEEMP4
- +30 ;
- +31 ;call 2 select 1,many,all services.
- +32 NEW DIC,Y
- +33 SET DIC="^PRSP(454.1,"
- +34 SET VAUTSTR="Service"
- +35 SET VAUTNI=2
- SET VAUTVB="PRSERV"
- +36 DO FIRST^VAUTOMA
- +37 ;
- +38 ;quit if user ^ at service prompt
- +39 if Y<0
- QUIT
- +40 ;
- +41 WRITE !
- SET ZTRTN="START^PRSEEMP3"
- SET ZTDESC="TRAINING REPORT BY SERVICE"
- DO L
- DO DEV^PRSEUTL
- if POP!($DATA(ZTSK))
- GOTO EXIT^PRSEEMP4
- START ;
- +1 USE IO
- +2 ;initialize temp global and set unknown entry in job table.
- +3 KILL ^TMP($JOB),^TMP("JOBS",$JOB)
- +4 SET ^TMP("JOBS",$JOB,0)="unknown"
- +5 ;
- +6 IF $EXTRACT(IOST,1,2)="C-"
- Begin DoDot:1
- +7 DO MSSG^PRSLIB00(.MSG)
- +8 DO MONOGRPH^PRSLIB00(MSG)
- End DoDot:1
- +9 SET (PHRS,PHRS("CEU"),PHRS("CON"),PCOUNT)=0
- SET PRSE132=$SELECT(IOM'<132:132,1:0)
- +10 ;
- +11 ;If user selects all services then fill up PRSERV array
- +12 IF PRSERV=1
- DO ALLSERV(.PRSERV)
- +13 ;
- +14 ;Drive thru services user has selected. They may select 1,many,all
- +15 ;or abort. If user selects 1 or 1+, PRSERV(ien)=selection(s),
- +16 ;PRSERV=0. If user selects ALL, PRSERV=1
- +17 NEW SERVICE,SERVIEN,EMPIEN,EMPNAME,CCIEN,CCORG
- +18 SET (SERVIEN,POUT,SRVCNT)=0
- +19 FOR
- SET SERVIEN=$ORDER(PRSERV(SERVIEN))
- if SERVIEN=""!(POUT)
- QUIT
- Begin DoDot:1
- +20 SET SRVCNT=SRVCNT+1
- +21 SET SERVICE=PRSERV(SERVIEN)
- +22 ;
- +23 ;There r many Cost Ctrs 4 each service. Use cost ctrs
- +24 ;2 find all employees in service.
- +25 SET CCIEN=0
- +26 FOR
- SET CCIEN=$ORDER(^PRSP(454,1,"ORG","C",SERVIEN,CCIEN))
- if CCIEN=""!(POUT)
- QUIT
- Begin DoDot:2
- +27 SET CCORG=$PIECE(^PRSP(454,1,"ORG",CCIEN,0),"^",1)
- +28 SET CCORG=$PIECE(CCORG,":",1)_$PIECE(CCORG,":",2)
- +29 ;
- +30 ; Get employees w/in cost ctr
- +31 SET EMPIEN=0
- +32 FOR
- SET EMPIEN=$ORDER(^PRSPC("ACC",CCORG,EMPIEN))
- if EMPIEN=""!(POUT)
- QUIT
- Begin DoDot:3
- +33 SET EMPNAME=$PIECE($GET(^PRSPC(EMPIEN,0)),"^",1)
- +34 SET EMPOINT=$GET(^PRSPC(EMPIEN,200))
- +35 IF EMPOINT'=""
- DO SORT^PRSEEMP4(EMPOINT)
- End DoDot:3
- End DoDot:2
- End DoDot:1
- +36 ;
- +37 SET (SERCNT,EMPCNT,CCOCNT)=0
- +38 ;get date for report
- +39 SET X="T"
- DO ^%DT
- SET REPDT=+Y
- +40 ;Drive thru services & cost ctr/orgs 2 print output 4 employees
- +41 SET SERVIEN=0
- +42 FOR
- SET SERVIEN=$ORDER(^TMP($JOB,SERVIEN))
- if SERVIEN'>0!(POUT)
- QUIT
- Begin DoDot:1
- +43 SET SERVICE=PRSERV(SERVIEN)
- +44 SET SERCNT=SERCNT+1
- +45 ;Initialize cost ctr global & counters
- +46 DO INITCC(.CCORG)
- +47 FOR
- SET CCORG=$ORDER(^TMP($JOB,SERVIEN,CCORG))
- if CCORG=""!(POUT)
- QUIT
- Begin DoDot:2
- +48 SET CCOCNT=CCOCNT+1
- +49 SET EMPIEN=""
- +50 FOR
- SET EMPIEN=$ORDER(^TMP($JOB,SERVIEN,CCORG,EMPIEN))
- if EMPIEN=""!(POUT)
- QUIT
- Begin DoDot:3
- +51 ;initialize course counters 4 employee
- DO INITEMP^PRSEEMP3
- +52 SET EMPCNT=EMPCNT+1
- +53 SET EMPNODE=^TMP($JOB,SERVIEN,CCORG,EMPIEN,0)
- +54 SET DATA=$PIECE(EMPNODE,"^",1)
- +55 SET JOBCODE=$PIECE(EMPNODE,"^",2)
- +56 SET EMPNAME=$PIECE(EMPNODE,"^",3)
- +57 DO OUTPUT^PRSEEMP4(EMPIEN,.POUT,JOBCODE,EMPNAME)
- End DoDot:3
- End DoDot:2
- End DoDot:1
- +58 IF POUT
- SET ^TMP("EORM",$JOB,2)="- Incomplete report. User aborted."
- +59 DO STATS
- DO MSSGS
- +60 DO EXIT^PRSEEMP4
- +61 QUIT
- +62 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- STATS ;
- +1 NEW HDR,UND,TAB1,PTAB
- +2 SET HDR="END OF TRAINING REPORT BY SERVICE"
- +3 SET UND="================================="
- +4 SET PTAB=(IOM-9)
- +5 ;center hdr on page
- SET TAB1=($GET(IOM)/2-($LENGTH(HDR)/2))
- +6 WRITE @IOF,?PTAB,"PAGE ",NPC+1
- +7 WRITE !,?TAB1,HDR,!,?TAB1,UND
- +8 WRITE !,"Employees counted: ",EMPCNT
- +9 WRITE !,"Services counted: ",SERCNT
- +10 WRITE !,"Cost Centers counted: ",CCOCNT
- +11 QUIT
- +12 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- MSSGS ;Write any messages that we've created during processing.
- +1 NEW EOR
- +2 WRITE !,"----------------",!
- +3 ;
- +4 SET EOR=""
- FOR
- SET EOR=$ORDER(^TMP("EORM",$JOB,EOR))
- if EOR=""
- QUIT
- Begin DoDot:1
- +5 WRITE !,^TMP("EORM",$JOB,EOR)
- End DoDot:1
- +6 WRITE !
- +7 QUIT
- +8 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- ALLSERV(PRSERV) ; Put all services in PAID COST CTR/ORGANIZATION file
- +1 ;in2 PRSERV() array, subscripted by IEN = "service name".
- +2 SET SERVICE=""
- +3 FOR
- SET SERVICE=$ORDER(^PRSP(454.1,"B",SERVICE))
- if SERVICE=""
- QUIT
- Begin DoDot:1
- +4 SET SERVIEN=0
- SET SERVIEN=$ORDER(^PRSP(454.1,"B",SERVICE,SERVIEN))
- +5 IF SERVIEN'=""
- IF $GET(^PRSP(454.1,SERVIEN,0))'=""
- SET PRSERV(SERVIEN)=SERVICE
- End DoDot:1
- +6 QUIT
- +7 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- INITCC(CCORG) ;INITIALIZE COST CTR STUFF
- +1 KILL ^TMP($JOB,"CC")
- +2 SET CCORG=""
- +3 QUIT
- +4 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- INITEMP ;initialize all counters 4 an employee
- +1 SET (PCOUNT,PHRS,PHRS("CEU"),PHRS("CON"))=0
- +2 QUIT
- +3 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- L FOR X="PHRS*","PCOUNT","PYR","PRDA","YRST","YREND","HOLD","PRSECLS","PRSESEL","POUT","NPC","NSW1","TYP","PRSERV*","PRSERV(","CEU"
- SET ZTSAVE(X)=""
- +1 QUIT
- +2 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%