Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: TIUP146P

TIUP146P.m

Go to the documentation of this file.
  1. TIUP146P ; SLC/JAK,RMO - Post-Install for TIU*1*146 Cont.;9/9/02@13:15:47
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**146**;Jun 20, 1997
  1. PRINT ; -- Device Selection
  1. W !!,"This routine will print the results of the search routine in patch"
  1. W !,"TIU*1*146 which identifies documents pointing to a different"
  1. W !,"patient's visit in the TIU DOCUMENT file (#8925)."
  1. W !!,*7,"This report requires a column width of 132.",!
  1. S %ZIS="Q" D ^%ZIS I POP K POP G PRINTQ
  1. I $D(IO("Q")) K IO("Q") D Q
  1. . S ZTRTN="LIST^TIUP146P"
  1. . S ZTDESC="TIU*1*146 - PRINT SEARCH RESULTS"
  1. . D ^%ZTLOAD W !,$S($D(ZTSK):"Request queued",1:"Request Cancelled!")
  1. . K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,%ZIS
  1. . D HOME^%ZIS
  1. U IO D LIST,^%ZISC
  1. PRINTQ Q
  1. ;
  1. LIST ; -- Entry point to generate list
  1. N TIUDA,TIUOUT,TIUVSIT S TIUOUT=0
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. D HDR
  1. I +$O(^XTMP("TIUP146","EX",0))'>0 W !?4,"No records in list." G LISTQ
  1. S TIUDA=0
  1. F S TIUDA=$O(^XTMP("TIUP146","EX",TIUDA)) Q:'TIUDA!(TIUOUT) S TIUVSIT=+$G(^(TIUDA)) D LISTONE(TIUDA,TIUVSIT)
  1. LISTQ Q
  1. ;
  1. LISTONE(TIUDA,TIUVSIT) ;Entry point to list one record
  1. ; Input -- TIUDA TIU Document file (#8925) IEN
  1. ; TIUVSIT Visit file (#9000010) IEN
  1. ; Output -- None
  1. N DFN,TIUD0,TIUHL,VADM,VAIP,VAIN,VA
  1. I $Y>(IOSL-4) D ASK G LISTONEQ:TIUOUT D HDR
  1. S TIUD0=$G(^TIU(8925,+TIUDA,0))
  1. S TIUHL=$P($G(^TIU(8925,+TIUDA,12)),U,11)
  1. S DFN=+$P(TIUD0,U,2)
  1. I DFN>0 D OERR^VADPT
  1. W !,TIUDA
  1. W ?12,$E($$UPPER^TIULS($P($G(^TIU(8925.6,+$P(TIUD0,U,5),0)),U)),1,5)
  1. W ?19,$S(DFN>0:$E($G(VADM(1)),1,20)_" ("_$G(VA("BID"))_")",1:"")
  1. W ?48,$E($P($G(^TIU(8925.1,+TIUD0,0)),U,1),1,10)
  1. W ?60,$$DATE^TIULS(+$P($G(^TIU(8925,+TIUDA,13)),U,1),"MM/DD/CCYY HR:MIN")
  1. W ?78,$E($$GET1^DIQ(44,+TIUHL,.01,"E"),1,15)
  1. I TIUVSIT>0 D
  1. . N DA,DIC,DIQ,DR,TIUVISIT
  1. . S DIC="^AUPNVSIT(",DIQ="TIUVISIT",DIQ(0)="E",DA=+TIUVSIT
  1. . S DR=".01" D EN^DIQ1
  1. . W ?95,$G(TIUVISIT(9000010,DA,.01,"E"))
  1. . W ?118,TIUVSIT
  1. LISTONEQ Q
  1. ;
  1. ASK ; -- End of Page
  1. I IO=IO(0),$E(IOST)="C" D
  1. . W ! N DIR,X,Y S DIR(0)="E"
  1. . D ^DIR I $D(DUOUT)!$D(DTOUT) S TIUOUT=1
  1. Q
  1. ;
  1. HDR ; -- Header for report
  1. N LNE,TIUNOW
  1. D NOW^%DTC S Y=% X ^DD("DD") S TIUNOW=Y
  1. W @IOF,"TIU*1*146 TIU DOCUMENTS LINKED TO A DIFFERENT PATIENT'S VISIT - Printed: ",TIUNOW
  1. W !,"Document #",?12,"Status",?19,"Patient in Document",?48,"Title",?60,"Reference Date",?78,"Visit Location",?95,"Incorrect Visit Date &",?118,"Visit #"
  1. W ! S LNE="",$P(LNE,"-",(IOM-1))="" W LNE
  1. Q
  1. ;
  1. MAIL ;Send completion message to user who initiated post-install
  1. N XMSUB,XMTEXT,XMDUZ,XMY,XMZ,XMMG
  1. N TIUTXT
  1. S XMDUZ="PATCH TIU*1*146 TIU DOCUMENT SEARCH RESULTS",XMY(.5)=""
  1. S:$G(DUZ) XMY(DUZ)=""
  1. S XMY("G.PATIENT SAFETY NOTIFICATIONS")=""
  1. S TIUTXT(1)="TIU Documents linked to different patient's visit."
  1. S TIUTXT(2)=""
  1. S TIUTXT(3)="Task Started: "_$$FMTE^XLFDT($G(^XTMP("TIUP146","T0")))
  1. S TIUTXT(4)="Task Ended: "_$$FMTE^XLFDT($G(^XTMP("TIUP146","T1")))
  1. S TIUTXT(5)=""
  1. ;
  1. S TIUTXT(6)="Number of entries linked to Different Patient's Visit: "_+$G(^XTMP("TIUP146","CNT","EX"))
  1. S TIUTXT(7)=""
  1. S TIUTXT(8)="TOTAL Number of entries processed: "_+$G(^XTMP("TIUP146","CNT","TOT"))
  1. S TIUTXT(9)=""
  1. I $G(^XTMP("TIUP146","STOP")) D
  1. . S TIUTXT(10)="Task STOPPED: "_$$FMTE^XLFDT($G(^XTMP("TIUP146","STOP")))_"."
  1. ELSE D
  1. . S TIUTXT(10)="Task COMPLETED successfully."
  1. . S TIUTXT(11)=""
  1. . S TIUTXT(12)="To print a detailed listing of the results invoke D PRINT^TIUP146P."
  1. S XMTEXT="TIUTXT(",XMSUB="TIU*1*146 TIU Documents Linked to Different Patient's Visit"
  1. D ^XMD
  1. Q