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

TIUEDITR.m

Go to the documentation of this file.
  1. TIUEDITR ; SLC/JER - Enter/Edit a Document for Transcriber ;01-Aug-2011 11:29;MGH
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**7,41,48,100,109,112,1009**;Jun 20, 1997;Build 22
  1. ; 2/2: Update DIE from TIUEDIT to TIUEDI4
  1. ;IHS/ITSC/LJF 02/26/2003 added code to edit visit and update V Note file
  1. MAIN(TIUCLASS) ; Control Branching
  1. N TIUPREF,TIUOUT,TIUAUTH
  1. ; --- Get user's preferences ---
  1. S TIUPREF=$$PERSPRF^TIULE(DUZ)
  1. ; --- Get the author to be used for multiple patients
  1. S TIUAUTH=+$$AUTHOR^TIULA2
  1. I TIUAUTH'>0 Q
  1. F D Q:+$G(TIUOUT)
  1. . N DFN,TIUREL,TIUCHK,TIUDA,TIUEDIT,TIUY,TIUNEW,TIUTYP,TIUDPRM
  1. . N TIUASK,TIU,VAIN,VADM,TIULMETH,TIUVMETH,TIUENTRY,TIUEXIT,TIUCMMTX
  1. . N DA ;10/3/00
  1. . ;Removed with TIU*1*41 - Joel didn't think it was appropriate
  1. . ;I $P(TIUPREF,U,6)="M" D MAIN^TIUEDIM(TIUCLASS,.TIUOUT) Q
  1. . ; --- Get a patient ---
  1. . S DFN=+$$PATIENT^TIULA I +DFN'>0 S TIUOUT=1 Q
  1. . S TIUCLASS=$G(TIUCLASS,38)
  1. . ; --- Get a document type ---
  1. . D DOCSPICK^TIULA2(.TIUTYP,TIUCLASS,"1A","LAST","","$P(^TIU(8925.1,+Y,0),U,7)'=13,+$$CANENTR^TIULP(+Y)")
  1. . I +$G(TIUTYP)'>0 S TIUOUT=1 Q
  1. . S TIUTYP=+$P($G(TIUTYP(1)),U,2)
  1. . ; --- Re-direct surgical reports ---
  1. . I +$$ISA^TIULX(TIUTYP,+$$CLASS^TIUSROI("SURGICAL REPORTS")) D ENTEROP^TIUSROI(DFN,TIUTYP) Q
  1. . ; --- Initialize document parameters ---
  1. . D DOCPRM^TIULC1(TIUTYP,.TIUDPRM)
  1. . ; --- If an ENTRY ACTION exists, execute it ---
  1. . S TIUENTRY=$$GETENTRY^TIUEDI2(+TIUTYP)
  1. . I $L(TIUENTRY) X TIUENTRY
  1. . Q:+$G(TIUOUT) ; If entry action sets TIUOUT=1 Abort Entry
  1. . ; --- Get associated visit ---
  1. . I +$$SUPPVSIT^TIULC1(TIUTYP)'>0 D I 1
  1. . . S TIULMETH=$$GETLMETH^TIUEDI1(TIUTYP)
  1. . . I '$L(TIULMETH) D S TIUOUT=1 Q
  1. . . . W !,$C(7),"No Visit Linkage Method defined for "
  1. . . . W $$PNAME^TIULC1(TIUTYP),".",!,"Please contact IRM..."
  1. . . X TIULMETH
  1. . E D
  1. . . D EVENT^TIUSRVP1(.TIU,DFN)
  1. . I $S($D(DIROUT):1,$D(DTOUT):1,1:0) S TIUQUIT=1 Q
  1. . I '$D(TIU("VSTR")) D Q
  1. . . W !,$C(7),"Patient & Visit required." H 2
  1. . ; --- Validate Selection ---
  1. . S TIUVMETH=$$GETVMETH^TIUEDI1(TIUTYP)
  1. . I '$L(TIUVMETH) D S TIUOUT=1 Q
  1. . . W !,$C(7),"No Validation Method defined for "
  1. . . W $$PNAME^TIULC1(TIUTYP),".",!,"Please contact IRM..."
  1. . X TIUVMETH
  1. . ;
  1. . D VEDIT^BTIUED("") ;IHS/ITSC/LJF 02/26/2003 added call to edit visit
  1. . ;
  1. . I $D(TIU),+$G(TIUASK) D
  1. . . ;S DA=$$GETREC^TIUEDI1(DFN,.TIU,1,.TIUNEW,.TIUDPRM,1)
  1. . . S DA=$$GETRECNW^TIUEDI3(DFN,.TIU,TIUTYP(1),.TIUNEW,.TIUDPRM,1)
  1. . . I +DA'>0 W !,"Unable to enter/edit." Q
  1. . . S TIUEDIT=$S('+$G(TIUNEW):$$CANDO^TIULP(DA,"EDIT RECORD"),1:1)
  1. . . I '+TIUEDIT D Q
  1. . . . W !,$P(TIUEDIT,U,2) ; Echo denial message
  1. . . . D ADDENDUM^TIUADD(DA,"",.TIUCHNG)
  1. . . N TIUQUIT,TIUADD
  1. . . D DIE^TIUEDI4(DA,.TIUQUIT) Q:+$G(TIUQUIT)=2 ; **100**
  1. . . ;If (CP) and (Timeout or Not Select Consult) and (Consult Associated), Quit before EMPTYDOC check
  1. . . I +$$ISA^TIULX(TIUTYP,+$$CLASS^TIUCP),+$G(TIUQUIT)=1,+$P($G(^TIU(8925,+DA,14)),U,5)>0 Q
  1. . . I $$EMPTYDOC^TIULF(DA) D DELETE^TIUEDIT(DA,0) S:'+$G(TIUNEW) TIUCHNG("DELETE")=1 H:'+$G(TIUNEW) 2 Q
  1. . . Q:+$G(TIUQUIT)
  1. . . I +$G(TIUONCE) S TIUNDA(+$G(DA))=""
  1. . . I +$G(TIU("STOP")) D DEFER^TIUVSIT(DA,TIU("STOP")) I 1
  1. . . E D QUE^TIUPXAP1
  1. . . ;
  1. . . ; --- Link PN to V Note file ---
  1. . . D VNOTE^BTIUPCC(DA,+TIU("VISIT"),DFN,"ADD") ;IHS/ITSC/LJF 02/26/2003
  1. . . ;
  1. . . ; --- Execute COMMIT procedure ---
  1. . . S TIUCMMTX=$$COMMIT^TIULC1(+$G(^TIU(8925,+DA,0)))
  1. . . I TIUCMMTX]"" X TIUCMMTX
  1. . . ; --- Execute RELEASE procedure ---
  1. . . D RELEASE^TIUT(DA)
  1. . . ; --- Execute VERIFY procedure ---
  1. . . D VERIFY^TIUT(DA)
  1. . . ; --- Execute SIGNATURE procedure ---
  1. . . D EDSIG^TIURS(DA)
  1. . . ; --- If an EXIT ACTION exists, execute it ---
  1. . . S TIUEXIT=$$GETEXIT^TIUEDI2(+$P(TIUTYP(1),U,2))
  1. . . I $L(TIUEXIT) X TIUEXIT
  1. . . ; --- If required, prompt for print
  1. . . I +$P($G(TIUDPRM(0)),U,8) D PRINT^TIUEPRNT(DA)
  1. Q