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

RATIMBUL.m

Go to the documentation of this file.
RATIMBUL ;BPFO/CLT - BULLETIN BASED ON CREATION DATE ; 12 Sep 2016  1:33 PM
 ;;5.0;Radiology/Nuclear Medicine;**127**;Mar 16, 1998;Build 119
 ;;Per VHA Directive 10-93-142, this routine should not be modified
 ;
EN ;MAIN ENTRY POINT
 N RAINTER,RASRCH,RAEND,X,X1,X2,Y,RAFAC,RAFN,RADT,RAIEN,CRDT,COMDT
 K ^XTMP("RATIMBUL",$J) S ^XTMP("RATIMBUL",$J,0)=DT_U_DT
 S RAINTER=$P($G(^RAMRPF(71.98,1,0)),U,6)
SET ;SET THE SEARCH DATES BASED ON RAINTER
 S RASRCH=$S(RAINTER="D":1,RAINTER="W":7,RAINTER="M":30,RAINTER="Q":90,RAINTER="S":180,RAINTER="A":360,1:0) Q:RASRCH=0
 S X1=DT,X2=-720 D C^%DTC S RAEND=X
 S X1=DT,X2=-RASRCH,X3=-RASRCH F  D C^%DTC Q:X<RAEND  S ^XTMP("RATIMBUL",$J,X)=-X3 S X3=X3-RASRCH,X1=DT,X2=X3
SRCH ;SEARCH FOR AN ENTY REQUIRING A BULLETIN
 S RADT="" F  S RADT=$O(^RAMIS(71,"CREAT",RADT)) Q:RADT=""  S RAIEN="" F  S RAIEN=$O(^RAMIS(71,"CREAT",RADT,RAIEN)) Q:RAIEN=""   D
 . Q:$P(^RAMIS(71,RAIEN,"NTRT"),U,1)'=""
 . Q:$P(^RAMIS(71,RAIEN,"NTRT"),U,3)=""
 . Q:$P(^RAMIS(71,RAIEN,"NTRT"),U,3)<RAEND
 . I $D(^XTMP("RATIMBUL",$J,$P(^RAMIS(71,RAIEN,"NTRT"),U,3))) D
 .. S XMB="UNMATCHED RADIOLOGY PROCEDURE"
 ..S XMB(1)=^XTMP("RATIMBUL",$J,$P(^RAMIS(71,RAIEN,"NTRT"),U,3))
 .. S XMB(2)=$P(^RAMIS(71,RAIEN,0),U,1)
 .. S XMB(3)=$P(^RAMIS(71,RAIEN,0),U,9)
 .. S RAFAC=$$KSP^XUPARAM("INST"),RAFAC=$$NS^XUAF4(RAFAC)
 .. S RAFN=$P(RAFAC,U,2),RAFAC=$P(RAFAC,U,1)
 .. S XMB(4)=" "_RAFN_" / "_RAFAC
 .. S CRDT=$P(^RAMIS(71,RAIEN,"NTRT"),U,3),COMDT=$P(^RAMIS(71,RAIEN,"NTRT"),U,3)
 .. S XMB(5)=$E(CRDT,4,5)_"/"_$E(CRDT,6,7)_"/"_($E(CRDT,1,3)+1700)
 .. S XMB(6)=$E(COMDT,4,5)_"/"_$E(COMDT,6,7)_"/"_($E(COMDT,1,3)+1700)
 .. S XMB(7)=RAIEN
 .. ;S XMY("G.RADNTRT@CHEY59.FO-BAYPINES.DOMAIN.EXT")=""
 .. ;S XMY("G.RADNTRT")=""
 .. D ^XMB
 .. Q
 . Q
END ;END THE ROUTINE
 K ^XTMP("RATIMBUL",$J),X3,XMB,XMV,XMDUN,XMDUZ
TIMBUL ;QUEUE THE TIME BULLETIN
 S ZTRTN="RATIMBUL",ZTDESC="Radiology new procedure time bulletin"
 S X1=DT,X2=1 D C^%DTC S ZTDTH=X_.0300
 D ^%ZTLOAD
 K ZTSK,ZTRTN,ZTDESC,ZTDTH,X1,X2,X
 Q