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

TIUPNCV7.m

Go to the documentation of this file.
  1. TIUPNCV7 ;SLC/DJP ;PNs ==> TIU cnv rtns ;5-7-97
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**3**;Jun 20, 1997
  1. ;
  1. HELP10 ;Help text for GMRP IEN prompt
  1. W !!?5,"Enter the Internal Entry Number (IEN)) of the last progress"
  1. W !?5,"note you want to convert. By entering an IEN, you can run"
  1. W !?5,"this conversion while users continue to use the Progress Note"
  1. W !?5,"options."
  1. W !!?5,"To complete the conversion, use the RESTART option."
  1. Q
  1. ;
  1. FIX ;Will back records out of ^TIU(8925
  1. ;TIU("HERE") must be set to the starting IEN
  1. S DIK="^TIU(8925,",CTR=0
  1. S BK=TIU("HERE") F S BK=$O(^TIU(8925,BK)) Q:'BK D
  1. . Q:$P(^TIU(8925,BK,13),U,3)'="C"
  1. . S DA=BK D ^DIK S CTR=CTR+1
  1. W !!,"COMPLETED... "_CTR_" RECORDS DELETED."
  1. Q
  1. ;
  1. PNHALT ;Options allows site to stop conversion
  1. W !!?12,"****** REQUEST TO HALT CONVERSION ******",!
  1. I '$P($G(^TIU(8925.97,1,0)),U,5)
  1. I W !!?5,"The Progress Note Conversion is not currently running.",! Q
  1. I $P(^TIU(8925.97,1,2),U,3)>0
  1. I W !!?5,"Progress Note Conversion has been stopped."
  1. I W !?5,"Use the RESTART option to begin again.",! Q
  1. W !! K DIR S DIR(0)="Y"
  1. S DIR("A")="Do you want to HALT the Progress Note Conversion"
  1. S DIR("B")="NO",DIR("?")="^D HALTHELP^TIUPNCV7" D ^DIR K DIR
  1. I $D(DIRUT)!(Y=0) W !!?5,"Okay. Conversion will continue to run.",! Q
  1. S $P(^TIU(8925.97,1,2),U,3)=1
  1. W !!?15,"!!!!!!!! CONVERSION STOPPED !!!!!!!!",!
  1. S TIUPNLST=$P(^TIU(8925.97,1,0),U,5)
  1. W !?5,"Last Progress Note record processed is: ^GMR(121,"_TIUPNLST
  1. K TIUPNLST
  1. Q
  1. ;
  1. HALTHELP ;Help Prompt for Halt action
  1. W !!?5,"Answering ""YES"" to this question will stop the Progress Note"
  1. W !?5,"Conversion before completion. ""NO"" will allow the conversion"
  1. W !?5,"to continue.",!
  1. Q
  1. ;
  1. MONITOR ;Monitor progress notes conversion
  1. ;
  1. W !!?12,"****** MONITORING PROGRESS NOTE CONVERSION ******",!
  1. I $P($G(^TIU(8925.97,1,0)),U,3)>0 D Q
  1. . W !?5,"This conversion has been run..."
  1. . W !?5,"This option is only for use during the running of the Progress"
  1. . W !?5,"Notes conversion from ^GMR(121 to ^TIU(8925."
  1. . H 5 Q
  1. ;
  1. AGAIN ;Redisplay monitor information
  1. N NODE,START,CURRENT,STIME,CNTR,ERRORS,TIME,ETIME,NTIME,BYE,PERMIN
  1. N PERHR,MIN,NUM,LEFT,ESECS
  1. D SETVAR
  1. D DISPLAY
  1. D RETURN Q:$D(BYE)
  1. W @IOF W !!?12,"**** MONITORING PROGRESS NOTE CONVERSION ****",!
  1. G AGAIN
  1. Q
  1. ;
  1. SETVAR ;Using File ^TIU(8925.97, to set and compute variables
  1. S NODE=^TIU(8925.97,1,0)
  1. S START=$P(NODE,U,4),CURRENT=$P(NODE,U,5),STIME=$P(NODE,U,2)
  1. S CNTR=$P(NODE,U,6),ERRORS=$P(NODE,U,7) S:ERRORS'>0 ERRORS=0
  1. S TIME=$$FMTE^XLFDT(STIME,"1P")
  1. S NTIME=$$NOW^XLFDT
  1. S ETIME=$$FMDIFF^XLFDT(NTIME,STIME,3)
  1. S ESECS=$$FMDIFF^XLFDT(NTIME,STIME,2)
  1. S MIN=ESECS/60
  1. S PERMIN=CNTR/+$S(MIN>0:MIN,1:1),PERHR=PERMIN*60
  1. S NUM=$P(^GMR(121,0),U,4)-$P(^TIU(8925,0),U,4)
  1. S LEFT=NUM/PERHR,DAYS=LEFT/24
  1. S REMAIN1=$P(^GMR(121,0),U,4)-CURRENT ;in file
  1. Q
  1. ;
  1. DISPLAY ;Displays known information
  1. W !?5," Conversion began: ",TIME
  1. W !?5," Starting record: ",START
  1. W !?5," Processing record: ",CURRENT
  1. W !?5," Records processed: ",CNTR
  1. W !?5,"Current # of error: ",ERRORS
  1. W !?5," Elapsed time: ",ETIME
  1. W !?5," Notes per hour: ",$P(PERHR,".")
  1. I LEFT>24 W !?5," Days left: ",$E(DAYS,1,5)
  1. E W !?5," Hours left: ",$E(LEFT,1,5)
  1. W !!?2,"Notes left to convert: ",REMAIN1
  1. W !!
  1. Q
  1. ;
  1. RETURN ;Issues RETURN prompt
  1. N DIR,Y
  1. F TIULN=1:1:(IOSL-$Y-4) W !
  1. S DIR(0)="E" D ^DIR I $D(DIRUT) S BYE=1 Q
  1. Q
  1. ;