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

TIUPNCV4.m

Go to the documentation of this file.
  1. TIUPNCV4 ;SLC/DJP ;2/26/98 13:30
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**9**;Jun 20, 1997
  1. ;
  1. ENTRY ;Entry point to set-up conversion
  1. N DIC,TIUQUEUE
  1. I $G(DUZ)'>0 W !!,"DUZ must be defined as an active user!",! Q
  1. S TIU("DUZ")=DUZ
  1. D INTRO^TIUPNCV5 I $G(TIU("QUIT")) K TIU Q
  1. I $P($G(^TIU(8925.97,1,0)),U,3) W !!,"Conversion has been completed.",! K TIU Q
  1. W ! S DIR(0)="Y",DIR("A")="Are you sure everything is okay"
  1. S DIR("B")="NO",DIR("?")="^D HELP1^TIUPNCV4" D ^DIR Q:$D(DIRUT)!(Y=0)
  1. S TIUQUEUE=$$READ^TIUU("Y","Would you like to QUEUE this Process","NO")
  1. I +TIUQUEUE D PNDEVICE Q
  1. W !!?9,$C(7),"Progress Notes Conversion Running in Foreground",!
  1. D DRIVER^TIUPNCV
  1. Q
  1. ;
  1. PNDEVICE ;Permits site to queue conversion
  1. N %,ZTDTH,ZTDESC,ZTIO,ZTSAVE,ZTSK,ZTRTN
  1. S ZTSAVE("TIU*")="",ZTSAVE("GMRP*")=""
  1. S:'$D(ZTDESC) ZTDESC="TIU PN CONVERSION"
  1. S ZTRTN="DRIVER^TIUPNCV",ZTIO="" D ^%ZTLOAD
  1. W !,$S($D(ZTSK):"Request Queued!",1:"Request Cancelled."),!
  1. D ^%ZISC
  1. Q
  1. ;
  1. REPORT ;sends bulletin to initiator of conversion
  1. I '$D(TIUUSER) S TIUUSER=DUZ
  1. S XMY(TIUUSER)=""
  1. S XMB="TIU PRN CONVERSION "_$S(GMRPCTR:"ERRORS",1:"CLEAN")
  1. S XMDUZ="TIU PROGRESS NOTE CONVERSION"
  1. S XMB(1)=TIUSTRT,XMB(2)=TIUEND,XMB(3)=TIUCTR
  1. I ERRCTR S XMB(4)=ERRCTR,XMTEXT="^GMR(121,""ERROR"","
  1. D ^XMB,KILL^XM K TIUEND,TIUSTRT,ERRCTR
  1. Q
  1. ;
  1. RESTART ;Permit restarting of conversion from last successfully processed note.
  1. W !
  1. K DIR W @IOF
  1. W !!?10,"****** RESTART PROGRESS NOTE/TIU CONVERSION ******",!!
  1. S GMRPST1=$P($G(^TIU(8925.97,1,0)),U,5)
  1. I GMRPST1'>0 W !?5,"Conversion has NOT been previously run",!?5,"Please use the CONVERT PROGRESS NOTE option." K GMRPST1 Q
  1. K DIR S DIR(0)="Y",DIR("A")="Do you wish to restart the conversion"
  1. S DIR("B")="YES",DIR("?")="^D HELP2^TIUPNCV4" D ^DIR Q:$D(DIRUT)!(Y=0)
  1. W !!?5,"A mail message documenting discrepancies encountered during "
  1. W !,?5,"processing will be sent to you.",!
  1. S TIU("DUZ")=DUZ
  1. D MAIL^TIUPNCV5
  1. S GMRPST=(GMRPST1+1)
  1. W !!,"Restarting Progress Note Conversion at Record #"_GMRPST_"...",!
  1. S $P(^TIU(8925.97,1,0),U,3)=""
  1. S GMRPST=(GMRPST-1),RESTARTD=$$NOW^XLFDT
  1. S ^GMR(121,"RESTART",GMRPST)=RESTARTD ;Records restart date/time
  1. S ZTDESC="RESTART PN CONVERSION"
  1. D PNDEVICE
  1. Q
  1. ;
  1. INDY ;Converts individual Progress Notes based on IEN in ^GMR(121
  1. S TIUFPRIV=1
  1. W @IOF W !!?18,"***** INDIVIDUAL RECORD CONVERSION *****",!
  1. ;
  1. ENINDY ;Entry of IEN
  1. K DIR S DIR(0)="NO^1:9999999"
  1. S DIR("A")="Enter IEN of Note to be converted"
  1. S DIR("?")="^D HELP4^TIUPNCV4" D ^DIR I $D(DIRUT) K DIR Q
  1. I '$D(^GMR(121,Y)) W !,"Entry ",Y," not found in file 121",$C(7) G ENINDY
  1. I +$P($G(^GMR(121,Y,1)),U,3)&($P($G(^GMR(121,Y,5)),U)=1) S TIUECS=$$ASKCOS^TIUPNCVU Q:'TIUECS ;If signed and uncosigned need to ask for expected cosigner, quit if none entered.
  1. ;
  1. EMERG ;Emergency entrance - must pass "Y" and "EMER"
  1. S GMRPIFN=Y,TIU("INDY")=1,GMRPCTR=0,TIUCTR=0
  1. I $D(^GMR(121,"CNV",GMRPIFN)) W !?5,"Progress Note IEN "_GMRPIFN_" was converted in a prior session.",! K GMRPIFN,TIU("INDY") G ENINDY:'$D(EMER)
  1. S NEWNODE=1 W:'$D(EMER) !!?5,"Now converting Progress Note "_GMRPIFN_"...",!
  1. D MAIN^TIUPNCV8
  1. I '$D(^GMR(121,"CNV",GMRPIFN)),$D(^GMR(121,"ERROR",GMRPIFN)) D G KILINDY
  1. . W !!,"*****Progress Note "_GMRPIFN_" NOT converted*****",!
  1. . W ^GMR(121,"ERROR",GMRPIFN),!
  1. W:'$D(EMER) !,"Progress Note "_GMRPIFN_" successfully converted",!
  1. ;
  1. KILINDY ;Cleans up the debris
  1. K GMRPIFN,TIU("INDY"),DIR,NEWNODE,BADREC,TIUCTR
  1. I $D(EMER) Q
  1. G ENINDY
  1. ;
  1. HELP1 ;Help for are you sure prompt
  1. W !!,"Enter Yes if you're ready to start the conversion."
  1. W !,"Press return or enter NO to stop this process."
  1. Q
  1. HELP2 ;Help for RESTART prompt
  1. W !!?5,"Enter YES to re-start/re-queue the conversion."
  1. W !?5,"Press <ret> or enter NO to stop this option."
  1. Q
  1. ;
  1. HELP3 ;Help for IEN prompt
  1. W !!?5,"The default is the next expected Internal File Number (IEN)"
  1. W " for a note."
  1. W !?5,"If another starting point is required, enter the IEN for that"
  1. W " note."
  1. W !?5,"Enter ""^"" to stop option without processing."
  1. Q
  1. ;
  1. HELP4 ;Help for INDY prompt
  1. W !!?5,"Enter the Internal Entry Number (IEN) of the single Progress"
  1. W !?5,"you wish to convert to TIU.",!
  1. Q
  1. ;