source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUP149P.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: 4.7 KB
Line 
1TIUP149P ; SLC/JAK,RMO - Post-Install for TIU*1*149 Cont.;10/30/02@09:27:47
2 ;;1.0;TEXT INTEGRATION UTILITIES;**149**;Jun 20, 1997
3PRINT ; -- Device Selection
4 N EXNDBIF,TIUOUT
5 W !!,"This routine will print the results of the clean up routine in patch"
6 W !,"TIU*1*149 which provides a clean up for documents pointing to a different"
7 W !,"patient's visit in the TIU DOCUMENT file (#8925)."
8 ;
9 ;If integrated facility, ask about excluding NDBI fix needed records
10 I $$CHKINF^TIUP149,$$ASKEX(.TIUOUT) S EXNDBIF=1
11 G PRINTQ:$G(TIUOUT)
12 ;
13 W !!,*7,"This report requires a column width of 132.",!
14 S %ZIS="Q" D ^%ZIS I POP K POP G PRINTQ
15 I $D(IO("Q")) K IO("Q") D Q
16 . I $G(EXNDBIF) S ZTSAVE("EXNDBIF")=""
17 . S ZTRTN="LIST^TIUP149P"
18 . S ZTDESC="TIU*1*149 - PRINT CLEAN-UP RESULTS"
19 . D ^%ZTLOAD W !,$S($D(ZTSK):"Request queued",1:"Request Cancelled!")
20 . K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,%ZIS
21 . D HOME^%ZIS
22 U IO D LIST,^%ZISC
23PRINTQ Q
24 ;
25ASKEX(TIUOUT) ;Ask if user would like to exclude NDBI fix needed records
26 ; Input -- None
27 ; Output -- 1=Yes and 0=No
28 ; TIUOUT Timeout or up-arow flag
29 N DIR,DTOUT,DUOUT,Y
30 S DIR("A")="Do you want to exclude 'NDBI Fix Needed' records from the report"
31 S DIR("B")="YES",DIR(0)="Y"
32 W ! D ^DIR
33 I $D(DTOUT)!($D(DUOUT)) S TIUOUT=1
34 Q +$G(Y)
35 ;
36LIST ; -- Entry point to generate list
37 N TIUDA,TIULNK,TIUOUT S TIUOUT=0
38 I $D(ZTQUEUED) S ZTREQ="@"
39 D HDR
40 I +$O(^XTMP("TIUP149","LNK",0))'>0 W !?4,"No records in list." G LISTQ
41 S TIUDA=0
42 F S TIUDA=$O(^XTMP("TIUP149","LNK",TIUDA)) Q:'TIUDA!(TIUOUT) S TIULNK=$G(^(TIUDA)) D LISTONE(TIUDA,TIULNK,$G(EXNDBIF))
43LISTQ K EXNDBIF
44 Q
45 ;
46LISTONE(TIUDA,TIULNK,EXNDBIF) ;Entry point to list one record
47 ; Input -- TIUDA TIU Document file (#8925) IEN
48 ; TIULNK 1st piece= 1=Linked and 0=Not Linked
49 ; 2nd piece= Exception type if not linked
50 ; 3rd piece= Visit file (#9000010) IEN if linked
51 ; EXNDBIF Exclude "NDBI Fix Needed" records flag (Optional)
52 ; Output -- None
53 N DFN,TIUEX,VADM,VAIP,VAIN,VA
54 I $Y>(IOSL-4) D ASK G LISTONEQ:TIUOUT D HDR
55 S DFN=+$P($G(^TIU(8925,+TIUDA,0)),U,2)
56 S TIUEX=+$P($G(TIULNK),U,2)
57 ;
58 ;If exclude NDBI record flag set and NDBI record, exit
59 I $G(EXNDBIF),TIUEX=3 G LISTONEQ
60 D OERR^VADPT
61 W !,$E($G(VADM(1)),1,20)_" ("_$G(VA("BID"))_")"
62 W ?30,TIUDA
63 W ?42,$E($P($G(^TIU(8925.1,+$G(^TIU(8925,+TIUDA,0)),0)),U,1),1,15)
64 I +$G(TIULNK),$P(TIULNK,U,3) D
65 . N DA,DIC,DIQ,DR,TIUVISIT
66 . S DIC="^AUPNVSIT(",DIQ="TIUVISIT",DIQ(0)="E",DA=+$P(TIULNK,U,3)
67 . S DR=".01;.22" D EN^DIQ1
68 . W ?60,$G(TIUVISIT(9000010,DA,.01,"E"))
69 . W ?84,$E($G(TIUVISIT(9000010,DA,.22,"E")),1,20)
70 . W ?106,"Yes - Visit #"_$P(TIULNK,U,3)
71 ELSE D
72 . W ?106,"No - "
73 . W $S(TIUEX=1:"Entry in Use",TIUEX=2:"Unlinked Visit",TIUEX=3:"NDBI Fix Needed",1:"")
74LISTONEQ Q
75 ;
76ASK ; -- End of Page
77 I IO=IO(0),$E(IOST)="C" D
78 . W ! N DIR,X,Y S DIR(0)="E"
79 . D ^DIR I $D(DUOUT)!$D(DTOUT) S TIUOUT=1
80 Q
81 ;
82HDR ; -- Header for report
83 N LNE,TIUNOW
84 D NOW^%DTC S Y=% X ^DD("DD") S TIUNOW=Y
85 W @IOF,"TIU*1*149 TIU DOCUMENTS LINKED TO A DIFFERENT PATIENT'S VISIT CLEAN-UP - Printed: ",TIUNOW
86 W !,"Patient",?30,"Document #",?42,"Title",?60,"Visit Date/Time",?84,"Hospital Location",?106,"Linked"
87 W ! S LNE="",$P(LNE,"-",(IOM-1))="" W LNE
88 Q
89 ;
90MAIL ;Send completion message to user who initiated post-install
91 N XMSUB,XMTEXT,XMDUZ,XMY,XMZ,XMMG
92 N TIURNG,TIUTXT
93 S XMDUZ="PATCH TIU*1*149 TIU DOCUMENT CLEAN-UP RESULTS",XMY(.5)=""
94 S:$G(DUZ) XMY(DUZ)=""
95 S XMY("G.PATIENT SAFETY NOTIFICATIONS")=""
96 S TIUTXT(1)="Clean up TIU Documents linked to a different patient's visit."
97 S TIUTXT(2)=""
98 S TIUTXT(3)="Task Started: "_$$FMTE^XLFDT($G(^XTMP("TIUP149","T0")))
99 S TIUTXT(4)="Task Ended: "_$$FMTE^XLFDT($G(^XTMP("TIUP149","T1")))
100 S TIUTXT(5)=""
101 ;
102 S TIUTXT(6)="Number of entries linked to Correct Visit: "_+$G(^XTMP("TIUP149","CNT","LNK"))
103 S TIUTXT(7)=""
104 S TIUTXT(8)="Number of entries not corrected because Entry in Use: "_+$G(^XTMP("TIUP149","CNT","EX",1))
105 S TIUTXT(9)=""
106 S TIUTXT(10)="Number of entries unlinked from Incorrect Visit: "_+$G(^XTMP("TIUP149","CNT","EX",2))
107 S TIUTXT(11)=""
108 S TIUTXT(12)="TOTAL Number of entries processed: "_+$G(^XTMP("TIUP149","CNT","TOT"))
109 S TIUTXT(13)=""
110 I $G(^XTMP("TIUP149","STOP")) D
111 . S TIUTXT(14)="Task STOPPED: "_$$FMTE^XLFDT($G(^XTMP("TIUP149","STOP")))_"."
112 ELSE D
113 . S TIUTXT(14)="Task COMPLETED successfully."
114 . S TIUTXT(15)=""
115 . S TIUTXT(16)="To print a detailed listing of the clean up invoke D PRINT^TIUP149P."
116 ;
117 I $G(NDBIF) D
118 . S TIUTXT(17)=""
119 . S TIUTXT(18)="SPECIAL NOTE FOR INTEGRATED FACILITIES:"
120 . S TIUTXT(19)=""
121 . S TIUTXT(20)="- Number of entries not corrected because NDBI Fix Needed: "_+$G(^XTMP("TIUP149","CNT","EX",3))
122 S XMTEXT="TIUTXT(",XMSUB="TIU*1*149 TIU Document Clean up for Different Patient's Visit"
123 D ^XMD
124 Q
Note: See TracBrowser for help on using the repository browser.