source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUP188P.m@ 1432

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1TIUP188P ; SLC/RMO,TT - Post-Install for TIU*1*188 Cont.; [5/19/04 1:52pm]
2 ;;1.0;TEXT INTEGRATION UTILITIES;**188**;Jun 20, 1997
3PRINT ; -- Device Selection
4 W !!,"This routine will print ALL records processed to date by the"
5 W !,"auto-link routine independent of the date range selected at"
6 W !,"processing time."
7 W !!,$C(7),"This report requires a column width of 132.",!
8 S %ZIS="Q" D ^%ZIS I POP K POP G PRINTQ
9 I $D(IO("Q")) K IO("Q") D Q
10 . S ZTRTN="LIST^TIUP188P"
11 . S ZTDESC="TIU*1*188 AUTO-LINK MISSING VISIT TO DOCUMENT RESULTS"
12 . D ^%ZTLOAD W !,$S($D(ZTSK):"Request queued",1:"Request Cancelled!")
13 . K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,%ZIS
14 . D HOME^%ZIS
15 U IO D LIST,^%ZISC
16PRINTQ Q
17 ;
18LIST ; -- Entry point to generate list
19 N TIUDA,TIULNK,TIUOUT S TIUOUT=0
20 I $D(ZTQUEUED) S ZTREQ="@"
21 D HDR
22 I +$O(^XTMP("TIUP188","LNK",0))'>0 W !?4,"No records in list." G LISTQ
23 S TIUDA=0
24 F S TIUDA=$O(^XTMP("TIUP188","LNK",TIUDA)) Q:'TIUDA!(TIUOUT) S TIULNK=$G(^(TIUDA)) D LISTONE(TIUDA,TIULNK)
25LISTQ Q
26 ;
27LISTONE(TIUDA,TIULNK) ;Entry point to list one record
28 ; Input -- TIUDA TIU Document file (#8925) IEN
29 ; TIULNK 1st piece= 1=Linked and 0=Not Linked
30 ; 2nd piece= Exception type if not linked
31 ; 3rd piece= Visit file (#9000010) IEN if linked
32 ; Output -- None
33 N DFN,TIUEX,VADM,VAIP,VAIN,VA
34 I $Y>(IOSL-4) D ASK G LISTONEQ:TIUOUT D HDR
35 S DFN=+$P($G(^TIU(8925,+TIUDA,0)),U,2)
36 S TIUEX=+$P($G(TIULNK),U,2)
37 D OERR^VADPT
38 W !,$E($G(VADM(1)),1,20)_" ("_$G(VA("BID"))_")"
39 W ?30,TIUDA
40 W ?42,$E($P($G(^TIU(8925.1,+$G(^TIU(8925,+TIUDA,0)),0)),U,1),1,10)
41 W ?53,$$DATE^TIULS(+$P($G(^TIU(8925,+TIUDA,13)),U,1),"MM/DD/CCYY HR:MIN")
42 I +$G(TIULNK),$P(TIULNK,U,3) D
43 . N DA,DIC,DIQ,DR,TIUVISIT
44 . S DIC="^AUPNVSIT(",DIQ="TIUVISIT",DIQ(0)="E",DA=+$P(TIULNK,U,3)
45 . S DR=".01;.22" D EN^DIQ1
46 . W ?70,$E($G(TIUVISIT(9000010,DA,.22,"E")),1,15)
47 . W ?86,$G(TIUVISIT(9000010,DA,.01,"E"))
48 . W ?109,"Yes-Visit #"_$P(TIULNK,U,3)
49 ELSE D
50 . W ?109,"No-"
51 . W $S(TIUEX=1:"Multiple Visits",TIUEX=2:"Entry in Use",TIUEX=3:"No Matching Visit",1:"")
52LISTONEQ Q
53 ;
54ASK ; -- End of Page
55 I IO=IO(0),$E(IOST,1,2)="C-" D
56 . W ! N DIR,X,Y,DUOUT,DTOUT S DIR(0)="E"
57 . D ^DIR I $D(DUOUT)!$D(DTOUT) S TIUOUT=1
58 Q
59 ;
60HDR ; -- Header for report
61 N LNE,TIUNOW
62 D NOW^%DTC S Y=% X ^DD("DD") S TIUNOW=Y
63 W @IOF,"TIU*1*188 AUTO-LINK MISSING VISIT TO DOCUMENT LIST - Printed: ",TIUNOW
64 W !,"Patient",?30,"Document #",?42,"Title",?53,"Reference Date",?70,"Visit Location",?86,"Visit Date/Time",?109,"Linked"
65 W ! S LNE="",$P(LNE,"-",(IOM-1))="" W LNE
66 Q
67 ;
68MAIL ;Send completion message to user who initiated post-install
69 N XMSUB,XMTEXT,XMDUZ,XMY,XMZ,XMMG
70 N TIURNG,TIUTXT
71 S XMDUZ="PATCH TIU*1*188 AUTO-LINK VISIT TO DOCUMENT",XMY(.5)=""
72 S:$G(DUZ) XMY(DUZ)=""
73 S TIUTXT(1)="Auto-link missing VISIT field (#.03) in the TIU DOCUMENT file (#8925)"
74 S TIUTXT(2)="to an existing visit:"
75 S TIUTXT(3)=""
76 S TIUTXT(4)="Task Started: "_$$FMTE^XLFDT($G(^XTMP("TIUP188","T0")))
77 S TIUTXT(5)="Task Ended: "_$$FMTE^XLFDT($G(^XTMP("TIUP188","T1")))
78 S TIUTXT(6)=""
79 ;
80 S TIURNG=$$FMTE^XLFDT($P($G(^XTMP("TIUP188","CHKPT")),U,2))_" thru "_$S($G(^XTMP("TIUP188","STOP")):$$FMTE^XLFDT($P($G(^XTMP("TIUP188","CHKPT")),U,1)),1:$$FMTE^XLFDT($P($G(^XTMP("TIUP188","CHKPT")),U,3)))
81 S TIUTXT(7)="Date Range Processed: "_TIURNG
82 S TIUTXT(8)=""
83 S TIUTXT(9)="Number of entries automatically linked: "_+$G(^XTMP("TIUP188","CNT","LNK"))
84 S TIUTXT(10)=""
85 S TIUTXT(11)="Number of entries NOT automatically linked: "_+$G(^XTMP("TIUP188","CNT","EX"))
86 S TIUTXT(12)=" -Number NOT linked because - Multiple Visits: "_+$G(^XTMP("TIUP188","CNT","EX",1))
87 S TIUTXT(13)=" -Number NOT linked because - Entry in Use: "_+$G(^XTMP("TIUP188","CNT","EX",2))
88 S TIUTXT(14)=" -Number NOT linked because - No Matching Visit: "_+$G(^XTMP("TIUP188","CNT","EX",3))
89 S TIUTXT(15)=""
90 S TIUTXT(16)="TOTAL Number of entries processed: "_+$G(^XTMP("TIUP188","CNT","TOT"))
91 S TIUTXT(17)=""
92 I $G(^XTMP("TIUP188","STOP")) D
93 . S TIUTXT(18)="Task STOPPED: "_$$FMTE^XLFDT($G(^XTMP("TIUP188","STOP")))_"."
94 ELSE D
95 . S TIUTXT(18)="Task COMPLETED successfully."
96 . S TIUTXT(19)=""
97 . S TIUTXT(20)="To print a detailed listing of ALL records processed invoke D PRINT^TIUP188P."
98 S XMTEXT="TIUTXT(",XMSUB="TIU*1*188 Auto-link from "_TIURNG
99 D ^XMD
100 Q
Note: See TracBrowser for help on using the repository browser.