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

RA34PST.m

Go to the documentation of this file.
  1. RA34PST ;HOIFO/SWM-Post install to correct entries in file 71 ;1/28/03 07:54
  1. ;;5.0;Radiology/Nuclear Medicine;**34**;Mar 16, 1998
  1. QOFF ;Post-Install queues off File 71 Name correction job
  1. I '$D(XPDNM)#2 D EN^DDIOL("This entry point must be called from the KIDS installation -- Nothing Done.",,"!!,$C(7)") Q
  1. I +$G(DUZ)=0 D EN^DDIOL("DUZ isn't defined -- Nothing Done.",,"!!,$C(7)")
  1. N RATXT,ZTDESC,ZTDTH,ZTIO,ZTRTN S ZTIO=""
  1. S ZTRTN="EN^RA34PST"
  1. S ZTDESC="RA*5.0*34 File 71 Name correction job"
  1. S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT(),0,0,2,0) ;add 2 minutes to 'now'
  1. D ^%ZTLOAD S RATXT(1)=" "
  1. S RATXT(2)="RA*5.0*34 File 71 Name correction is running in background."
  1. S:$G(ZTSK)>0 RATXT(3)="Task: "_ZTSK_"."
  1. S RATXT(4)=" "
  1. S RATXT(5)="The results will be sent to your mailbox."
  1. S RATXT(6)=" "
  1. D MES^XPDUTL(.RATXT)
  1. Q
  1. MANUAL ;manually queue off Name correction job, only use if post-install abends
  1. I +$G(DUZ)=0 D EN^DDIOL("DUZ isn't defined -- Nothing Done.",,"!!,$C(7)") Q
  1. ASKQ K DIR,DIROUT,DIRUT,DTOUT,DUOUT
  1. N RAX
  1. S DIR(0)="Y",DIR("B")="No"
  1. S DIR("?")="Enter 'Y' if you want to queue the File 71 Name correction job."
  1. S DIR("A")="Do you want to start routine RA34PST to correct File 71 procedure names"
  1. D ^DIR
  1. K DIR,DIROUT,DIRUT,DTOUT,DUOUT
  1. Q:'Y ;don't queue if answer is NO
  1. D EN^DDIOL("The results will be sent to your mailmox.",,"!!,$C(7)")
  1. N ZTDESC,ZTDTH,ZTIO,ZTRTN S ZTIO=""
  1. S ZTRTN="EN^RA34PST"
  1. S ZTDESC="MANUAL File 71 Name correction -- routine RA34PST"
  1. S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT(),0,0,2,0) ;add 2 minutes to 'now'
  1. D ^%ZTLOAD
  1. D EN^DDIOL("RA*5.0*34 File 71 Name correction will start in 2 minutes in the background.",,"!,$C(7)")
  1. I $G(ZTSK)>0 S RAX="Task: "_ZTSK D EN^DDIOL(RAX,,"!,$C(7)")
  1. Q
  1. EN ; LOOP THRU FILE 71, FIELD .01
  1. ; remove SEMICOLON from it
  1. ; if proc is active, then call PROC^RAO7MFN to update OI file
  1. N RAI,RAX,RA1,RA2,RA3,RAFDA,RASTAT,RAY,RACTOT,RAC1,RAC2,RABADTOT,RAC
  1. S (RAI,RACTOT,RAC1,RAC2,RABADTOT,RAC)=0
  1. SLOOP S RAI=$O(^RAMIS(71,RAI)) G:'RAI EXLOOP
  1. S RAX=$G(^RAMIS(71,RAI,0)) G:RAX="" SLOOP
  1. S RACTOT=RACTOT+1
  1. S RA1=$P(RAX,"^")
  1. I (RA1[";") D
  1. . L +^RAMIS(71,RAI,0):0 I '$T D Q
  1. .. S RA3="Can't lock ^RAMIS(71,"_RAI_",0), so "_RA1_" isn't changed."
  1. .. D STOR
  1. .. S RABADTOT=RABADTOT+1
  1. .. Q
  1. . S RA2=$TR(RA1,";",",") ; new string
  1. . Q:$O(^RAMIS(71,"B",RA2,0)) ; skip if new string already exists
  1. . S RA3="^RAMIS(71,"_RAI_",0)'s "_RA1_" will be "_RA2 D STOR
  1. . D REMOV,CPRS
  1. . L -^RAMIS(71,RAI,0)
  1. . Q
  1. G SLOOP
  1. EXLOOP S RA3=" " D STOR
  1. S RA3="File 71, RAD/NUC MED PROCEDURES, has been checked." D STOR
  1. S RA3=" " D STOR
  1. S RA3="No. records checked: "_$J(RACTOT,7) D STOR
  1. S RA3="No. records had semicolon corrected: "_$J(RAC1,7) D STOR
  1. S RA3="No. records updated in file 101.43: "_$J(RAC2,7) D STOR
  1. S RA3="No. records locked and not updated: "_$J(RABADTOT,7) D STOR
  1. D MAIL
  1. S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. STOR ; store messages and totals
  1. Q:$G(RA3)=""
  1. S RAC=RAC+1,^TMP($J,"RA34PST",RAC)=RA3
  1. Q
  1. REMOV ; remove ";"
  1. S RAC1=RAC1+1
  1. S RAFDA(71,RAI_",",.01)=RA2
  1. D FILE^DIE("E","RAFDA")
  1. K RAFDA
  1. Q
  1. CPRS ; update record in Orderable Items file 101.43
  1. Q:$$ORQUIK^RAORDU()'=1 ;skip update if no Order Dialog file 101.41
  1. ; skip if inactive
  1. I $S('$D(^RAMIS(71,RAI,"I")):0,^("I")="":0,+^("I")>DT:0,1:1) Q
  1. S RAC2=RAC2+1
  1. S RASTAT="1^1"
  1. S RAY=RAI_"^"_RA2
  1. D PROC^RAO7MFN(0,71,RASTAT,RAY)
  1. Q
  1. MAIL ; Send mail message to the installer
  1. N XMDUZ,XMSUB,XMTEXT,XMY S XMDUZ=.5
  1. S XMTEXT="^TMP($J,""RA34PST""," ;only numeric nodes are mailed
  1. S XMSUB="Results from routine RA34PST"
  1. S XMY(DUZ)="" D ^XMD
  1. Q