source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUSUPN2.m@ 724

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1TIUSUPN2 ;SLC/TT - DAILY SEARCH FOR SIGNED DOCUMENT WITH UNSIGNED STATUS; 11/29/04
2 ;;1.0; TEXT INTEGRATION UTILITIES;**180**;Jun 20, 1997
3 ;
4 Q
5EN ;Entry point to send mail
6 D SNDMAIL
7 Q
8 ;
9SNDMAIL ; SEND MAIL
10 ;
11 N TIUSTDT,TIUEDT,TIUTOTAL,TIUINFO,TIUDTIME,TIUDA,TIUI,TIUTEXT
12 K ^TMP("TIUP180",$J)
13 S TIUSTDT=DT,TIUEDT=DT+1,TIUTOTAL=0
14 F S TIUSTDT=$O(^TIU(8925,"F",TIUSTDT)) Q:'TIUSTDT!(TIUSTDT>TIUEDT) D
15 .S TIUDA=$O(^TIU(8925,"F",TIUSTDT,0)) S TIUTOTAL=TIUTOTAL+$$GATHER^TIUSUPN2(TIUDA)
16 I TIUTOTAL D
17 .S TIUDTIME=0,TIUI=3
18 .F S TIUDTIME=$O(^TMP("TIUP180",$J,TIUDTIME)) Q:'TIUDTIME D
19 ..S TIUINFO=$G(^TMP("TIUP180",$J,TIUDTIME))
20 ..S TIUI=TIUI+1,TIUTEXT(TIUI)=$P(TIUINFO,U)
21 .D CRTML
22 Q
23 ;
24CRTML ; CREAT MAIL
25 ;
26 N XMSUB,XMTEXT,XMDUZ,XMY
27 S XMDUZ="PATCH TIU*1*180"
28 S XMY("G.TIU SIGNED/UNSIGNED DOC")="",XMY(.5)=""
29 S TIUTEXT(1)="Below "_$S(TIUTOTAL=1:"is IEN for uncosigned or completed document",1:"are IENs for uncosigned/completed documents")_" with unsigned "_$S(TIUTOTAL=1:"status.",1:"statuses.")
30 S TIUTEXT(2)="Please run ""TIU SIGNED/UNSIGNED PN"" option for more detail."
31 S TIUTEXT(3)=""
32 S XMTEXT="TIUTEXT(",XMSUB="TIU SIGNED/UNSIGNED DOCUMENTS"
33 D ^XMD
34 Q
35 ;
36GATHER(TIUIEN) ; GET SIGNED DOCUMENT BUT UNSIGNED STATUS
37 ; Input -- TIUIEN: TIU Document file (#8925) IEN
38 ; Output -- CNT: Total documents found
39 ; TIUDOC - TIU DOCUMENT NAME
40 ; TIUPTN - PATIENT NAME
41 ; TIUSIGDT - SIGNATURE DATE/TIME
42 ;
43 N TIUD0,TIUD15,TIUDOC,TIUPTN,TIUSIGDT,TIUCNT
44 S TIUCNT=0
45 I TIUIEN'>0 Q 0
46 I '$D(^TIU(8925,TIUIEN,0))!('$D(^TIU(8925,TIUIEN,15))) Q 0
47 S TIUD0=$G(^TIU(8925,TIUIEN,0)),TIUD15=$G(^TIU(8925,TIUIEN,15))
48 I $P(TIUD0,U,5)=5,$P(TIUD15,U,1)>0 D
49 .S TIUSIGDT=$P(TIUD15,U),TIUCNT=TIUCNT+1
50 .S ^TMP("TIUP180",$J,TIUSIGDT)=TIUIEN
51 Q TIUCNT
Note: See TracBrowser for help on using the repository browser.