source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCDMBWL2.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1RCDMBWL2 ;WISC/RFJ-diagnostic measures workload report (to super) ;1 Jan 01
2 ;;4.5;Accounts Receivable;**167,197**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6 ;
7REPORT ; called by RCDMBWLR to generate the report
8 N %,DATA,RCASSIGN,RCCLERK,RCCOUNT,RCDATA,RCDESC,RCLINE,RCTMPDAT,RCTODAY,X,XMDUN,XMY,XMZ,Y,IBHOLDER
9 D NOW^%DTC S Y=X D DD^%DT S RCTODAY=Y,RCTODAY=$$DOW^XLFDT(X)_" "_RCTODAY
10 ;
11 ; initialize counts for summary of all assignments
12 S RCCOUNT("allbills")=0
13 S RCCOUNT("allbillstotal")=0
14 ;
15 ; generate mailmessage to each supervisor
16 ; show heading at top of mailman message
17 K ^TMP($J,"RCRJRCORMM")
18 ; don't send supervisor message if no to-do lists generated
19 I '$D(^TMP("RCDMBWL1",$J)) Q
20 S RCLINE=0
21 D BUILDMM("The following mailman message is your Accounts Receivable supervisor list.")
22 D BUILDMM(" "_RCTODAY_".")
23 D BUILDMM(" ")
24 ;
25 S RCCLERK("name")="" F S RCCLERK("name")=$O(^TMP("RCDMBWL1",$J,RCCLERK("name"))) Q:RCCLERK("name")="" D
26 . S RCCLERK=0 F S RCCLERK=$O(^TMP("RCDMBWL1",$J,RCCLERK("name"),RCCLERK)) Q:'RCCLERK D
27 . . S RCASSIGN=0 F S RCASSIGN=$O(^TMP("RCDMBWL1",$J,RCCLERK("name"),RCCLERK,RCASSIGN)) Q:'RCASSIGN D
28 . . . S RCTMPDAT=^TMP("RCDMBWL1",$J,RCCLERK("name"),RCCLERK,RCASSIGN,"SUMM")
29 . . . D BUILDMM(" ")
30 . . . D BUILDMM("CLERK: "_$E(RCCLERK("name")_" ",1,20)_" ASSIGN #: "_$E(RCASSIGN_" ",1,5)_"COUNT: "_$J($P(RCTMPDAT,"^"),6)_" TOTAL: "_$J($P(RCTMPDAT,"^",2),10,2))
31 . . . ; show the condition of the assignment
32 . . . S RCDATA=" CONDITION: IF "
33 . . . ; print conditions [condition 1][condition 2][...]
34 . . . S RCDESC=^TMP("RCDMBWL1",$J,RCCLERK("name"),RCCLERK,RCASSIGN,"DESC")
35 . . . F %=2:1 D I DATA="" Q
36 . . . . S DATA=$P($P(RCDESC,"[",%),"]")
37 . . . . I DATA="" Q
38 . . . . D BUILDMM($S(RCDATA'="":RCDATA,1:" and ")_DATA)
39 . . . . ; do not show "condition: if" more than once
40 . . . . S RCDATA=""
41 . . . ;
42 . . . ; total all bills
43 . . . S RCCOUNT("allbills")=RCCOUNT("allbills")+$P(RCTMPDAT,"^")
44 . . . S RCCOUNT("allbillstotal")=RCCOUNT("allbillstotal")+$P(RCTMPDAT,"^",2)
45 ;
46 ; show bill count for all clerks
47 D BUILDMM(" ")
48 D BUILDMM("TOTAL BILL COUNT FOR ALL CLERKS: "_RCCOUNT("allbills"))
49 D BUILDMM("TOTAL BILL DOLLARS FOR ALL CLERKS: "_$J(RCCOUNT("allbillstotal"),0,2))
50 ;
51 ; send mail message ; extrinsic function needs to be outside the
52 ; dot structure so that only 1 mailman message is generated and
53 ; sent to all recipients of the IBJD Workload Assignment key.
54 S IBHOLDER=0 F S IBHOLDER=$O(^XUSEC("IBJD WORKLOAD ASSIGNMENT",IBHOLDER)) Q:'IBHOLDER D
55 . S XMY(IBHOLDER)=""
56 S XMZ=$$SENDMSG^RCRJRCOR("AR Supervisor List for "_$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3),.XMY)
57 K ^TMP($J,"RCRJRCORMM")
58 Q
59 ;
60 ;
61BUILDMM(DATA) ; build mailman message
62 S RCLINE=RCLINE+1
63 S ^TMP($J,"RCRJRCORMM",RCLINE)=DATA
64 Q
Note: See TracBrowser for help on using the repository browser.