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

TIUPNCVU.m

Go to the documentation of this file.
  1. TIUPNCVU ;SLC/DAN - Final pass through ^GMR(121 for conversion ;4/22/98@14:08:17
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**9**;Jun 20, 1997
  1. EN ; Entry Point
  1. I +$$VERSION^XPDUTL("TIU")'>0 W !,"YOU MUST INSTALL TIU BEFORE RUNNING THIS OPTION!",$C(7) Q ;Make sure TIU is installed first.
  1. WHY F TIUWN=1:1 S TIULINE=$P($T(@("EXPLAIN+"_TIUWN)),";;",2) Q:TIULINE="STOP" W !,TIULINE
  1. S TIURUN=$$READ^TIUU("Y","Are you sure you want to run this","NO")
  1. I '+TIURUN W !,"Ok, come back when you're sure." D CLEAN Q
  1. ;Agreed to run it, now check to see if PN conversion is currently running.
  1. I $P(^TIU(8925.97,1,0),U,3)="" W !!,"It appears as though the Progress Notes conversion is running.",!,"Please run this after the conversion finishes." D CLEAN Q
  1. W !! S TIUECS=$$ASKCOS I 'TIUECS D CLEAN Q
  1. ;
  1. DEVICE ;Allows user to queue this option
  1. S %ZIS="Q" D ^%ZIS I POP D CLEAN Q
  1. I $D(IO("Q")) S ZTDESC="Final conversion pass",ZTRTN="DQ^TIUPNCVU",ZTIO=ION,ZTSAVE("TIUECS")="" D ^%ZTLOAD W !,"Request ",$S($D(ZTSK):"Queued",1:"Cancelled"),! D ^%ZISC,CLEAN,HOME^%ZIS Q
  1. ;
  1. DQ ;Move through ^GMR(121 and convert any remaining notes
  1. W:$E(IOST,1,2)="C-" !,"Working..." S (TIUATC,TIUCVTED)=0
  1. S GMRIEN=0 F S GMRIEN=$O(^GMR(121,GMRIEN)) Q:'+GMRIEN D:'$D(^GMR(121,"CNV",GMRIEN)) CONVERT(GMRIEN) W:$E(IOST,1,2)="C-"&'(GMRIEN#1000) "." ;Convert if not already done.
  1. W !!,"CONVERSION IS COMPLETE!"
  1. W !!,"Total entries processed: ",$P(^GMR(121,0),"^",4),!,"Attempted to convert: ",TIUATC,!,"Converted: ",TIUCVTED
  1. ;
  1. CLEAN ;KILL VARIABLES
  1. K TIUWN,TIULINE,TIURUN,TIUECS,%ZIS,POP,IO("Q"),ZTRTN,ZTDESC,ZTIO,ZTSAVE,GMRIEN,TIU,EMER,Y,TIUATC,TIUCVTED,DIR,ZTSK
  1. Q
  1. ;
  1. CONVERT(Y) ;Sets needed variables and calls the convert individual note process
  1. N DPTIEN S EMER=1 S DPTIEN=$P(^GMR(121,Y,0),"^",2) I DPTIEN,$E($P(^DPT(DPTIEN,0),"^",9),1,4)'="0000" S TIUATC=TIUATC+1
  1. D EMERG^TIUPNCV4
  1. I $D(^GMR(121,"CNV",GMRIEN)) S TIUCVTED=TIUCVTED+1
  1. S:GMRIEN>$P(^TIU(8925.97,1,0),"^",5) $P(^TIU(8925.97,1,0),"^",5)=GMRIEN ;Update PN last entry processed
  1. Q
  1. ;
  1. ASKCOS() ;Ask for cosigner to be used for notes that are signed but uncosigned and req cosignature
  1. W !,"For notes that are signed but are uncosigned, an expected",!,"cosigner must be identified before notes can be moved to TIU."
  1. W !!,"Please identify a user who will become the expected cosigner for",!,"these notes. The clinical coordinator is recommended.",!
  1. W !,"Once these are moved to TIU the above named cosigner can edit the notes",!,"and put in the correct expected cosigner.",!
  1. N DIR,Y S DIR(0)="P^200:AEMQ",DIR("A")="Enter EXPECTED COSIGNER" D ^DIR
  1. Q +Y
  1. ;
  1. EXPLAIN ;Explain what this option does
  1. ;;This option will process all remaining unconverted progress notes.
  1. ;;Notes that cannot be converted will be identified, along with the
  1. ;;the reason they could not be converted, as the process runs.
  1. ;;It is HIGHLY RECOMMENDED that you queue this option to a printer
  1. ;;so you can review the notes that did not convert.
  1. ;;
  1. ;;This option should be run after you have completed the final progress notes
  1. ;;conversion pass. This will move all remaining notes (including
  1. ;;unsigned and uncosigned) to TIU.
  1. ;;
  1. ;;Notes that are reported as not converting, that you subsequently
  1. ;;fix, should be moved using the SINGLE PROGRES NOTES CONVERSION option.
  1. ;;
  1. ;;STOP