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

TIUP134P.m

Go to the documentation of this file.
  1. TIUP134P ; SLC/JAK,RMO - Post-Install for TIU*1*134 Cont.;7/8/02@13:15:47
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**134**;Jun 20, 1997
  1. PRINT ; -- Device Selection
  1. W !!,"This routine will print ALL records processed to date by the"
  1. W !,"auto-link routine independent of the date range selected at"
  1. W !,"processing time."
  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^TIUP134P"
  1. . S ZTDESC="TIU*1*134 AUTO-LINK MISSING VISIT TO DOCUMENT 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,TIULNK,TIUOUT S TIUOUT=0
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. D HDR
  1. I +$O(^XTMP("TIUP134","LNK",0))'>0 W !?4,"No records in list." G LISTQ
  1. S TIUDA=0
  1. F S TIUDA=$O(^XTMP("TIUP134","LNK",TIUDA)) Q:'TIUDA!(TIUOUT) S TIULNK=$G(^(TIUDA)) D LISTONE(TIUDA,TIULNK)
  1. LISTQ Q
  1. ;
  1. LISTONE(TIUDA,TIULNK) ;Entry point to list one record
  1. ; Input -- TIUDA TIU Document file (#8925) IEN
  1. ; TIULNK 1st piece= 1=Linked and 0=Not Linked
  1. ; 2nd piece= Exception type if not linked
  1. ; 3rd piece= Visit file (#9000010) IEN if linked
  1. ; Output -- None
  1. N DFN,TIUEX,VADM,VAIP,VAIN,VA
  1. I $Y>(IOSL-4) D ASK G LISTONEQ:TIUOUT D HDR
  1. S DFN=+$P($G(^TIU(8925,+TIUDA,0)),U,2)
  1. S TIUEX=+$P($G(TIULNK),U,2)
  1. D OERR^VADPT
  1. W !,$E($G(VADM(1)),1,20)_" ("_$G(VA("BID"))_")"
  1. W ?30,TIUDA
  1. W ?42,$E($P($G(^TIU(8925.1,+$G(^TIU(8925,+TIUDA,0)),0)),U,1),1,10)
  1. W ?53,$$DATE^TIULS(+$P($G(^TIU(8925,+TIUDA,13)),U,1),"MM/DD/CCYY HR:MIN")
  1. I +$G(TIULNK),$P(TIULNK,U,3) D
  1. . N DA,DIC,DIQ,DR,TIUVISIT
  1. . S DIC="^AUPNVSIT(",DIQ="TIUVISIT",DIQ(0)="E",DA=+$P(TIULNK,U,3)
  1. . S DR=".01;.22" D EN^DIQ1
  1. . W ?70,$E($G(TIUVISIT(9000010,DA,.22,"E")),1,15)
  1. . W ?86,$G(TIUVISIT(9000010,DA,.01,"E"))
  1. . W ?109,"Yes-Visit #"_$P(TIULNK,U,3)
  1. ELSE D
  1. . W ?109,"No-"
  1. . W $S(TIUEX=1:"Multiple Visits",TIUEX=2:"Entry in Use",TIUEX=3:"No Matching Visit",1:"")
  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*134 AUTO-LINK MISSING VISIT TO DOCUMENT LIST - Printed: ",TIUNOW
  1. W !,"Patient",?30,"Document #",?42,"Title",?53,"Reference Date",?70,"Visit Location",?86,"Visit Date/Time",?109,"Linked"
  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 TIURNG,TIUTXT
  1. S XMDUZ="PATCH TIU*1*134 AUTO-LINK VISIT TO DOCUMENT",XMY(.5)=""
  1. S:$G(DUZ) XMY(DUZ)=""
  1. S TIUTXT(1)="Auto-link missing VISIT field (#.03) in the TIU DOCUMENT file (#8925)"
  1. S TIUTXT(2)="to an existing visit:"
  1. S TIUTXT(3)=""
  1. S TIUTXT(4)="Task Started: "_$$FMTE^XLFDT($G(^XTMP("TIUP134","T0")))
  1. S TIUTXT(5)="Task Ended: "_$$FMTE^XLFDT($G(^XTMP("TIUP134","T1")))
  1. S TIUTXT(6)=""
  1. ;
  1. S TIURNG=$$FMTE^XLFDT($P($G(^XTMP("TIUP134","CHKPT")),U,2))_" thru "_$S($G(^XTMP("TIUP134","STOP")):$$FMTE^XLFDT($P($G(^XTMP("TIUP134","CHKPT")),U,1)),1:$$FMTE^XLFDT($P($G(^XTMP("TIUP134","CHKPT")),U,3)))
  1. S TIUTXT(7)="Date Range Processed: "_TIURNG
  1. S TIUTXT(8)=""
  1. S TIUTXT(9)="Number of entries automatically linked: "_+$G(^XTMP("TIUP134","CNT","LNK"))
  1. S TIUTXT(10)=""
  1. S TIUTXT(11)="Number of entries NOT automatically linked: "_+$G(^XTMP("TIUP134","CNT","EX"))
  1. S TIUTXT(12)=" -Number NOT linked because - Multiple Visits: "_+$G(^XTMP("TIUP134","CNT","EX",1))
  1. S TIUTXT(13)=" -Number NOT linked because - Entry in Use: "_+$G(^XTMP("TIUP134","CNT","EX",2))
  1. S TIUTXT(14)=" -Number NOT linked because - No Matching Visit: "_+$G(^XTMP("TIUP134","CNT","EX",3))
  1. S TIUTXT(15)=""
  1. S TIUTXT(16)="TOTAL Number of entries processed: "_+$G(^XTMP("TIUP134","CNT","TOT"))
  1. S TIUTXT(17)=""
  1. I $G(^XTMP("TIUP134","STOP")) D
  1. . S TIUTXT(18)="Task STOPPED: "_$$FMTE^XLFDT($G(^XTMP("TIUP134","STOP")))_"."
  1. ELSE D
  1. . S TIUTXT(18)="Task COMPLETED successfully."
  1. . S TIUTXT(19)=""
  1. . S TIUTXT(20)="To print a detailed listing of ALL records processed invoke D PRINT^TIUP134P."
  1. S XMTEXT="TIUTXT(",XMSUB="TIU*1*134 Auto-link from "_TIURNG
  1. D ^XMD
  1. Q