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

RAUTL00.m

Go to the documentation of this file.
  1. RAUTL00 ;HIRMFO/GJC-Utility Routine (linked to RAUTL0) ;11/14/97 12:01
  1. ;;5.0;Radiology/Nuclear Medicine;**93**;Mar 16, 1998;Build 3
  1. ;
  1. ; 07/14/2008 BAY/KAM Rem Call 257549 Mod request for alert text
  1. OENOTE ; Fire off OE/RR notification for [abnormal, amended] rad results
  1. ; back door fires off this notif. regardless of oe/rr version
  1. ; because oe/rr doesn't get abnormal/amended info in HL7 msgs
  1. I $$ORVR^RAORDU()=2.5 D
  1. . N RAWITCH S X1=$S($D(^RAMIS(71,+$P(X,"^",2),0)):$P(^(0),"^"),1:"")
  1. . S ORBPMSG=$S($D(RAAB):"Abnormal ",1:"")_"Imaging Results: "
  1. . S:$D(^RAO(75.1,+$P(X,"^",11),0)) ORIFN=+$P(^(0),"^",7)
  1. . S RAWITCH=$$OE1009() ; determine OE/RR Notification
  1. . Q:RAWITCH=-1 ; invalid OE/RR Notification, quit!
  1. . I RAWITCH=53!(+$O(^RARPT(RARPT,"ERR",0))) D
  1. .. S:$D(RAAB) ORBPMSG="Amended/"_ORBPMSG
  1. .. S:'$D(RAAB) ORBPMSG="Amended "_ORBPMSG
  1. .. Q
  1. . N RAVAR S RAVAR=$L(ORBPMSG),RAVAR=70-RAVAR
  1. . S ORBPMSG=ORBPMSG_$E(X1,1,RAVAR)
  1. . S ORNOTE(RAWITCH)=$S($D(ORIFN):1,1:"") D NOTE^ORX3
  1. . Q
  1. I $$ORVR^RAORDU()'<3 D
  1. . ; Recall RADFN, RADTI & RACNI from the RASAVE array
  1. . S RADFN=$G(RASAVE("RADFN")),RADTI=$G(RASAVE("RADTI"))
  1. . S RACNI=$G(RASAVE("RACNI"))
  1. . D OE3(RADFN,RADTI,RACNI,X)
  1. . Q
  1. Q
  1. OE1009() ; Determine the notification informing OE/RR
  1. ; Output: OE/RR Notification [ ien for ^ORD(100.9, ]
  1. N RANOTY ; used to identify type of OE/RR Notification
  1. S RANOTY=-1 ; initalize to error condition
  1. I $D(RAAB) S RANOTY=25 ; Abnormal Imaging Results
  1. E D
  1. . I '+$O(^RARPT(RARPT,"ERR",0)) S RANOTY=22 ; Imaging Results V'fied
  1. . E S RANOTY=$S($$ORVR^RAORDU'<3:53,1:22) ; Imaging Result Amended
  1. . Q
  1. Q RANOTY
  1. ;
  1. OE3(RADFN,RADTI,RACNI,X) ; Fire off oe/rr notifications, version 3.0+
  1. ; Input: 'RADFN': Patient DFN <-> 'RADTI': exam timestamp (inverse)
  1. ; 'RACNI': Exam ien <-> 'X' : exam zero node
  1. ; *** 'RARPT' is assumed to exist and be a valid ien in file 74. ***
  1. N RA751,RAIENS,RAMSG,RANOTE,RAOIFN,RAREQPHY,X1
  1. S X1=$S($D(^RAMIS(71,+$P(X,"^",2),0)):$P(^(0),"^"),1:"")
  1. S RA751=$G(^RAO(75.1,+$P(X,"^",11),0))
  1. S RAIENS=RADTI_"~"_RACNI
  1. I $D(RAAB) D ; abnormal Dx code associated with report
  1. . S:'+$O(^RARPT(RARPT,"ERR",0)) RANOTE="25^Abnl Imaging Reslt, Needs Attn: "_$E(X1,1,25)
  1. . S:+$O(^RARPT(RARPT,"ERR",0)) RANOTE="53^Amended/Abnormal Imaging Results: "_$E(X1,1,20)
  1. . Q
  1. I '$D(RAAB) D ; no abnormal Dx code with this report
  1. . S:'+$O(^RARPT(RARPT,"ERR",0)) RANOTE="22^Imaging Results,Non Critical: "_$E(X1,1,30)
  1. . S:+$O(^RARPT(RARPT,"ERR",0)) RANOTE="53^Amended Imaging Results: "_$E(X1,1,25)
  1. . Q
  1. S RAMSG=$P($G(RANOTE),"^",2),RAOIFN=$P(RA751,"^",7),RAREQPHY(+$P(X,"^",14))=""
  1. D EN^ORB3(+$G(RANOTE),RADFN,RAOIFN,.RAREQPHY,RAMSG,RAIENS)
  1. Q