TIUP134P ; SLC/JAK,RMO - Post-Install for TIU*1*134 Cont.;7/8/02@13:15:47
;;1.0;TEXT INTEGRATION UTILITIES;**134**;Jun 20, 1997
PRINT ; -- Device Selection
W !!,"This routine will print ALL records processed to date by the"
W !,"auto-link routine independent of the date range selected at"
W !,"processing time."
W !!,*7,"This report requires a column width of 132.",!
S %ZIS="Q" D ^%ZIS I POP K POP G PRINTQ
I $D(IO("Q")) K IO("Q") D Q
. S ZTRTN="LIST^TIUP134P"
. S ZTDESC="TIU*1*134 AUTO-LINK MISSING VISIT TO DOCUMENT RESULTS"
. D ^%ZTLOAD W !,$S($D(ZTSK):"Request queued",1:"Request Cancelled!")
. K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,%ZIS
. D HOME^%ZIS
U IO D LIST,^%ZISC
PRINTQ Q
;
LIST ; -- Entry point to generate list
N TIUDA,TIULNK,TIUOUT S TIUOUT=0
I $D(ZTQUEUED) S ZTREQ="@"
D HDR
I +$O(^XTMP("TIUP134","LNK",0))'>0 W !?4,"No records in list." G LISTQ
S TIUDA=0
F S TIUDA=$O(^XTMP("TIUP134","LNK",TIUDA)) Q:'TIUDA!(TIUOUT) S TIULNK=$G(^(TIUDA)) D LISTONE(TIUDA,TIULNK)
LISTQ Q
;
LISTONE(TIUDA,TIULNK) ;Entry point to list one record
; Input -- TIUDA TIU Document file (#8925) IEN
; TIULNK 1st piece= 1=Linked and 0=Not Linked
; 2nd piece= Exception type if not linked
; 3rd piece= Visit file (#9000010) IEN if linked
; Output -- None
N DFN,TIUEX,VADM,VAIP,VAIN,VA
I $Y>(IOSL-4) D ASK G LISTONEQ:TIUOUT D HDR
S DFN=+$P($G(^TIU(8925,+TIUDA,0)),U,2)
S TIUEX=+$P($G(TIULNK),U,2)
D OERR^VADPT
W !,$E($G(VADM(1)),1,20)_" ("_$G(VA("BID"))_")"
W ?30,TIUDA
W ?42,$E($P($G(^TIU(8925.1,+$G(^TIU(8925,+TIUDA,0)),0)),U,1),1,10)
W ?53,$$DATE^TIULS(+$P($G(^TIU(8925,+TIUDA,13)),U,1),"MM/DD/CCYY HR:MIN")
I +$G(TIULNK),$P(TIULNK,U,3) D
. N DA,DIC,DIQ,DR,TIUVISIT
. S DIC="^AUPNVSIT(",DIQ="TIUVISIT",DIQ(0)="E",DA=+$P(TIULNK,U,3)
. S DR=".01;.22" D EN^DIQ1
. W ?70,$E($G(TIUVISIT(9000010,DA,.22,"E")),1,15)
. W ?86,$G(TIUVISIT(9000010,DA,.01,"E"))
. W ?109,"Yes-Visit #"_$P(TIULNK,U,3)
ELSE D
. W ?109,"No-"
. W $S(TIUEX=1:"Multiple Visits",TIUEX=2:"Entry in Use",TIUEX=3:"No Matching Visit",1:"")
LISTONEQ Q
;
ASK ; -- End of Page
I IO=IO(0),$E(IOST)="C" D
. W ! N DIR,X,Y S DIR(0)="E"
. D ^DIR I $D(DUOUT)!$D(DTOUT) S TIUOUT=1
Q
;
HDR ; -- Header for report
N LNE,TIUNOW
D NOW^%DTC S Y=% X ^DD("DD") S TIUNOW=Y
W @IOF,"TIU*1*134 AUTO-LINK MISSING VISIT TO DOCUMENT LIST - Printed: ",TIUNOW
W !,"Patient",?30,"Document #",?42,"Title",?53,"Reference Date",?70,"Visit Location",?86,"Visit Date/Time",?109,"Linked"
W ! S LNE="",$P(LNE,"-",(IOM-1))="" W LNE
Q
;
MAIL ;Send completion message to user who initiated post-install
N XMSUB,XMTEXT,XMDUZ,XMY,XMZ,XMMG
N TIURNG,TIUTXT
S XMDUZ="PATCH TIU*1*134 AUTO-LINK VISIT TO DOCUMENT",XMY(.5)=""
S:$G(DUZ) XMY(DUZ)=""
S TIUTXT(1)="Auto-link missing VISIT field (#.03) in the TIU DOCUMENT file (#8925)"
S TIUTXT(2)="to an existing visit:"
S TIUTXT(3)=""
S TIUTXT(4)="Task Started: "_$$FMTE^XLFDT($G(^XTMP("TIUP134","T0")))
S TIUTXT(5)="Task Ended: "_$$FMTE^XLFDT($G(^XTMP("TIUP134","T1")))
S TIUTXT(6)=""
;
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)))
S TIUTXT(7)="Date Range Processed: "_TIURNG
S TIUTXT(8)=""
S TIUTXT(9)="Number of entries automatically linked: "_+$G(^XTMP("TIUP134","CNT","LNK"))
S TIUTXT(10)=""
S TIUTXT(11)="Number of entries NOT automatically linked: "_+$G(^XTMP("TIUP134","CNT","EX"))
S TIUTXT(12)=" -Number NOT linked because - Multiple Visits: "_+$G(^XTMP("TIUP134","CNT","EX",1))
S TIUTXT(13)=" -Number NOT linked because - Entry in Use: "_+$G(^XTMP("TIUP134","CNT","EX",2))
S TIUTXT(14)=" -Number NOT linked because - No Matching Visit: "_+$G(^XTMP("TIUP134","CNT","EX",3))
S TIUTXT(15)=""
S TIUTXT(16)="TOTAL Number of entries processed: "_+$G(^XTMP("TIUP134","CNT","TOT"))
S TIUTXT(17)=""
I $G(^XTMP("TIUP134","STOP")) D
. S TIUTXT(18)="Task STOPPED: "_$$FMTE^XLFDT($G(^XTMP("TIUP134","STOP")))_"."
ELSE D
. S TIUTXT(18)="Task COMPLETED successfully."
. S TIUTXT(19)=""
. S TIUTXT(20)="To print a detailed listing of ALL records processed invoke D PRINT^TIUP134P."
S XMTEXT="TIUTXT(",XMSUB="TIU*1*134 Auto-link from "_TIURNG
D ^XMD
Q
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
PRINT ; -- Device Selection
+1 WRITE !!,"This routine will print ALL records processed to date by the"
+2 WRITE !,"auto-link routine independent of the date range selected at"
+3 WRITE !,"processing time."
+4 WRITE !!,*7,"This report requires a column width of 132.",!
+5 SET %ZIS="Q"
DO ^%ZIS
IF POP
KILL POP
GOTO PRINTQ
+6 IF $DATA(IO("Q"))
KILL IO("Q")
Begin DoDot:1
+7 SET ZTRTN="LIST^TIUP134P"
+8 SET ZTDESC="TIU*1*134 AUTO-LINK MISSING VISIT TO DOCUMENT RESULTS"
+9 DO ^%ZTLOAD
WRITE !,$SELECT($DATA(ZTSK):"Request queued",1:"Request Cancelled!")
+10 KILL ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,%ZIS
+11 DO HOME^%ZIS
End DoDot:1
QUIT
+12 USE IO
DO LIST
DO ^%ZISC
PRINTQ QUIT
+1 ;
LIST ; -- Entry point to generate list
+1 NEW TIUDA,TIULNK,TIUOUT
SET TIUOUT=0
+2 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 DO HDR
+4 IF +$ORDER(^XTMP("TIUP134","LNK",0))'>0
WRITE !?4,"No records in list."
GOTO LISTQ
+5 SET TIUDA=0
+6 FOR
SET TIUDA=$ORDER(^XTMP("TIUP134","LNK",TIUDA))
IF 'TIUDA!(TIUOUT)
QUIT
SET TIULNK=$GET(^(TIUDA))
DO LISTONE(TIUDA,TIULNK)
LISTQ QUIT
+1 ;
LISTONE(TIUDA,TIULNK) ;Entry point to list one record
+1 ; Input -- TIUDA TIU Document file (#8925) IEN
+2 ; TIULNK 1st piece= 1=Linked and 0=Not Linked
+3 ; 2nd piece= Exception type if not linked
+4 ; 3rd piece= Visit file (#9000010) IEN if linked
+5 ; Output -- None
+6 NEW DFN,TIUEX,VADM,VAIP,VAIN,VA
+7 IF $Y>(IOSL-4)
DO ASK
IF TIUOUT
GOTO LISTONEQ
DO HDR
+8 SET DFN=+$PIECE($GET(^TIU(8925,+TIUDA,0)),U,2)
+9 SET TIUEX=+$PIECE($GET(TIULNK),U,2)
+10 DO OERR^VADPT
+11 WRITE !,$EXTRACT($GET(VADM(1)),1,20)_" ("_$GET(VA("BID"))_")"
+12 WRITE ?30,TIUDA
+13 WRITE ?42,$EXTRACT($PIECE($GET(^TIU(8925.1,+$GET(^TIU(8925,+TIUDA,0)),0)),U,1),1,10)
+14 WRITE ?53,$$DATE^TIULS(+$PIECE($GET(^TIU(8925,+TIUDA,13)),U,1),"MM/DD/CCYY HR:MIN")
+15 IF +$GET(TIULNK)
IF $PIECE(TIULNK,U,3)
Begin DoDot:1
+16 NEW DA,DIC,DIQ,DR,TIUVISIT
+17 SET DIC="^AUPNVSIT("
SET DIQ="TIUVISIT"
SET DIQ(0)="E"
SET DA=+$PIECE(TIULNK,U,3)
+18 SET DR=".01;.22"
DO EN^DIQ1
+19 WRITE ?70,$EXTRACT($GET(TIUVISIT(9000010,DA,.22,"E")),1,15)
+20 WRITE ?86,$GET(TIUVISIT(9000010,DA,.01,"E"))
+21 WRITE ?109,"Yes-Visit #"_$PIECE(TIULNK,U,3)
End DoDot:1
+22 IF '$TEST
Begin DoDot:1
+23 WRITE ?109,"No-"
+24 WRITE $SELECT(TIUEX=1:"Multiple Visits",TIUEX=2:"Entry in Use",TIUEX=3:"No Matching Visit",1:"")
End DoDot:1
LISTONEQ QUIT
+1 ;
ASK ; -- End of Page
+1 IF IO=IO(0)
IF $EXTRACT(IOST)="C"
Begin DoDot:1
+2 WRITE !
NEW DIR,X,Y
SET DIR(0)="E"
+3 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET TIUOUT=1
End DoDot:1
+4 QUIT
+5 ;
HDR ; -- Header for report
+1 NEW LNE,TIUNOW
+2 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET TIUNOW=Y
+3 WRITE @IOF,"TIU*1*134 AUTO-LINK MISSING VISIT TO DOCUMENT LIST - Printed: ",TIUNOW
+4 WRITE !,"Patient",?30,"Document #",?42,"Title",?53,"Reference Date",?70,"Visit Location",?86,"Visit Date/Time",?109,"Linked"
+5 WRITE !
SET LNE=""
SET $PIECE(LNE,"-",(IOM-1))=""
WRITE LNE
+6 QUIT
+7 ;
MAIL ;Send completion message to user who initiated post-install
+1 NEW XMSUB,XMTEXT,XMDUZ,XMY,XMZ,XMMG
+2 NEW TIURNG,TIUTXT
+3 SET XMDUZ="PATCH TIU*1*134 AUTO-LINK VISIT TO DOCUMENT"
SET XMY(.5)=""
+4 IF $GET(DUZ)
SET XMY(DUZ)=""
+5 SET TIUTXT(1)="Auto-link missing VISIT field (#.03) in the TIU DOCUMENT file (#8925)"
+6 SET TIUTXT(2)="to an existing visit:"
+7 SET TIUTXT(3)=""
+8 SET TIUTXT(4)="Task Started: "_$$FMTE^XLFDT($GET(^XTMP("TIUP134","T0")))
+9 SET TIUTXT(5)="Task Ended: "_$$FMTE^XLFDT($GET(^XTMP("TIUP134","T1")))
+10 SET TIUTXT(6)=""
+11 ;
+12 SET TIURNG=$$FMTE^XLFDT($PIECE($GET(^XTMP("TIUP134","CHKPT")),U,2))_" thru "_$SELECT($GET(^XTMP("TIUP134","STOP")):$$FMTE^XLFDT($PIECE($GET(^XTMP("TIUP134","CHKPT")),U,1)),1:$$FMTE^XLFDT($PIECE($GET(^XTMP("TIUP134","CHKPT")),U,3)))
+13 SET TIUTXT(7)="Date Range Processed: "_TIURNG
+14 SET TIUTXT(8)=""
+15 SET TIUTXT(9)="Number of entries automatically linked: "_+$GET(^XTMP("TIUP134","CNT","LNK"))
+16 SET TIUTXT(10)=""
+17 SET TIUTXT(11)="Number of entries NOT automatically linked: "_+$GET(^XTMP("TIUP134","CNT","EX"))
+18 SET TIUTXT(12)=" -Number NOT linked because - Multiple Visits: "_+$GET(^XTMP("TIUP134","CNT","EX",1))
+19 SET TIUTXT(13)=" -Number NOT linked because - Entry in Use: "_+$GET(^XTMP("TIUP134","CNT","EX",2))
+20 SET TIUTXT(14)=" -Number NOT linked because - No Matching Visit: "_+$GET(^XTMP("TIUP134","CNT","EX",3))
+21 SET TIUTXT(15)=""
+22 SET TIUTXT(16)="TOTAL Number of entries processed: "_+$GET(^XTMP("TIUP134","CNT","TOT"))
+23 SET TIUTXT(17)=""
+24 IF $GET(^XTMP("TIUP134","STOP"))
Begin DoDot:1
+25 SET TIUTXT(18)="Task STOPPED: "_$$FMTE^XLFDT($GET(^XTMP("TIUP134","STOP")))_"."
End DoDot:1
+26 IF '$TEST
Begin DoDot:1
+27 SET TIUTXT(18)="Task COMPLETED successfully."
+28 SET TIUTXT(19)=""
+29 SET TIUTXT(20)="To print a detailed listing of ALL records processed invoke D PRINT^TIUP134P."
End DoDot:1
+30 SET XMTEXT="TIUTXT("
SET XMSUB="TIU*1*134 Auto-link from "_TIURNG
+31 DO ^XMD
+32 QUIT