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

RABUL2.m

Go to the documentation of this file.
  1. RABUL2 ;HISC/FPT,GJC-'RAD/NUC MED REPORT UNVERIFIED' Bulletin ;11/10/97 11:01
  1. ;;5.0;Radiology/Nuclear Medicine;**8**;Mar 16, 1998
  1. ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1. ; The variables DA and RAX must be defined. RAX must be equal to 'V',
  1. ; and the value of DA (IEN of the record in file 74) must be greater
  1. ; than 0. These conditions must exist for the RAD/NUC MED REPORT
  1. ; UNVERIFIED bulletin to execute.
  1. ; Called From: ^DD(74,5,1,1,0-"DT") xref nodes
  1. ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1. ; ***** Variable List *****
  1. ; 'DIFQ' -> Variable used to check if we are installing the
  1. ; Radiology Package. If we are, do not fire off
  1. ; bulletins.
  1. ; 'RADFN' -> IEN of the patient in the PATIENT file (2)
  1. ; 'RAEXAM' -> IEN of a record in the Examinations multiple
  1. ; of the Radiology/Nuclear Medicine Patient file. (70)
  1. ; 'RAEXAM(0)'-> Zero node of a record in the Examinations multiple
  1. ; of the Radiology/Nuclear Medicine Patient file. (70)
  1. ; 'RARXAM(0)'-> Zero node of a record in the Registered Exam multiple
  1. ; of the Radiology/Nuclear Medicine Patient file. (70)
  1. ; 'RAFN1' -> internal format of a FM date/time data element
  1. ; { internal format pointer value }
  1. ; 'RAFN2' -> FM data definition for RAFN1, used in XTERNAL^RAUTL5
  1. ; 'A' -> Zero node of the RADIOLOGY/NUCLEAR MEDICINE REPORTS
  1. ; file (74) { node: ^RARPT(DA,0) }
  1. ;
  1. ; Format: Data to be fired;local var name;XMB array representation
  1. ; Patient ; RANAME ; XMB(1) <---> Desired Date ; RADDT ; XMB(5)
  1. ; Patient SSN ; RASSN ; XMB(2) <---> Report Status ; RASTAT ; XMB(6)
  1. ; Case Number ; RACASE ; XMB(3)<---> Req. Physician ; RARPHY ; XMB(7)
  1. ; Exam Date ; RAXDT ; XMB(4) <---> Rad. Procedure ; RAPROC ; XMB(8)
  1. ; Imag. Loc. ; RAILOC ; XMB(9) <---> Pri. Int'g Staff ; RASTF ; XMB(10)
  1. ; Pri. Int'g Resident ; RARES ; XMB(11)
  1. ;
  1. ; Quit if we are installing the software, current report status is
  1. ; verified, or if we are deleting the report.
  1. ; 'RADELRPT' is defined in the entry action of the RA DELETERPT option.
  1. Q:$D(DIFQ)!($D(RADELRPT))
  1. N RAX S RAX=X
  1. Q:RAX'="V"!(+$G(DA)'>0)
  1. N A,RACASE,RACN,RADDT,RADTI,RADFN,RAEXAM,RAFN1,RAFN2,RAILOC,RANAME
  1. N RAPROC,RARES,RARPHY,RARXAM,RASSN,RASTAT,RASTF,RAXDT,X,Y
  1. S A=$G(^RARPT(DA,0)) Q:$P(A,"^",5)="V" ; quit if the rpt is v'fied
  1. S Y=DA D RASET^RAUTL2 ; Derive case/exam data from file 70
  1. S RADFN(0)=RADFN
  1. S (RADFN,RANAME)=+$P(A,U,2)
  1. S RANAME=$S($D(^DPT(RANAME,0)):$P(^(0),U),1:"Unknown")
  1. S RASSN=$$SSN^RAUTL() S RADFN=RADFN(0)
  1. S RACASE=$$RPTCSE(A,DA)
  1. S RAFN1=$P(A,U,3),RAFN2=$P($G(^DD(74,3,0)),U,2)
  1. S RAXDT=$$XTERNAL^RAUTL5(RAFN1,RAFN2)
  1. S RAXDT=$S(RAXDT]"":RAXDT,1:"Unknown")
  1. S RARXAM(0)=$G(^RADPT(+$G(RADFN),"DT",+$G(RADTI),0))
  1. S RAEXAM=$O(^RADPT(+$G(RADFN),"DT",+$G(RADTI),"P","B",+$G(RACN),0))
  1. S RAEXAM(0)=$G(^RADPT(+$G(RADFN),"DT",+$G(RADTI),"P",+$G(RAEXAM),0))
  1. S RAFN1=$P(RAEXAM(0),U,21),RAFN2=$P($G(^DD(70.03,21,0)),U,2)
  1. S RADDT=$$XTERNAL^RAUTL5(RAFN1,RAFN2)
  1. S RADDT=$S(RADDT]"":RADDT,1:"Unknown")
  1. S RAFN1=$P(RAEXAM(0),U,14),RAFN2=$P($G(^DD(70.03,14,0)),U,2)
  1. S RARPHY=$$XTERNAL^RAUTL5(RAFN1,RAFN2)
  1. S RARPHY=$S(RARPHY]"":RARPHY,1:"Unknown")
  1. S RAFN1=$P(RAEXAM(0),U,2),RAFN2=$P($G(^DD(70.03,2,0)),U,2)
  1. S RAPROC=$$XTERNAL^RAUTL5(RAFN1,RAFN2)
  1. S RAPROC=$E($S(RAPROC]"":RAPROC,1:"Unknown"),1,37)
  1. S RAFN1=$P(A,"^",5),RAFN2=$P($G(^DD(74,5,0)),U,2)
  1. S RASTAT=$S(RAFN1']"":"Unknown",1:$$XTERNAL^RAUTL5(RAFN1,RAFN2))
  1. S RASTAT=$S(RASTAT]"":RASTAT,1:"Unknown")
  1. S RAFN1=$P(RARXAM(0),U,4),RAFN2=$P($G(^DD(70.02,4,0)),U,2)
  1. S RAILOC=$S(RAFN1']"":"Unknown",1:$$XTERNAL^RAUTL5(RAFN1,RAFN2))
  1. S RAFN1=$P(RAEXAM(0),U,15),RAFN2=$P($G(^DD(70.03,15,0)),U,2)
  1. S RASTF=$S(RAFN1']"":"Unknown",1:$$XTERNAL^RAUTL5(RAFN1,RAFN2))
  1. S RAFN1=$P(RAEXAM(0),U,12),RAFN2=$P($G(^DD(70.03,12,0)),U,2)
  1. S RARES=$S(RAFN1']"":"Unknown",1:$$XTERNAL^RAUTL5(RAFN1,RAFN2))
  1. S XMB(1)=RANAME,XMB(2)=RASSN,XMB(3)=RACASE,XMB(4)=RAXDT
  1. S XMB(5)=RADDT,XMB(6)=RASTAT,XMB(7)=RARPHY,XMB(8)=RAPROC
  1. S XMB(9)=RAILOC,XMB(10)=RASTF,XMB(11)=RARES
  1. S XMB="RAD/NUC MED REPORT UNVERIFIED"
  1. ; if called from RAHLO1, then use remote user's duz as sender
  1. ; var RATRANSC is only defined in RAHL* routines
  1. S:$D(RATRANSC) XMDUZ=$S($G(RAVERF):RAVERF,$G(RATRANSC):RATRANSC,1:DUZ)
  1. D ^XMB:$D(^XMB(3.6,"B",XMB))
  1. K XMB,XMB0,XMC0,XMDT,XMM,XMMG
  1. Q
  1. RPTCSE(RAA,RADA) ; Determine the case number for this report.
  1. ; There may be more than one case associated with a given report.
  1. ; If this is the case, all associated case numbers will be returned.
  1. ; Input Variables: 'RAA' - zero node of the Rad/Nuc Reports data global
  1. ; 'RADA'- ien of the entry in the Rad/Nuc Reports file
  1. ; Returns: a single case number or numerous case numbers
  1. Q:'+$O(^RARPT(RADA,1,0)) $S($P(RAA,U)]"":$P(RAA,U),1:"Unknown") ;single
  1. N I,J,RASTR S RASTR=$S($P(RAA,U)]"":$P(RAA,U),1:"Unknown"),I=0
  1. F S I=$O(^RARPT(RADA,1,I)) Q:I'>0 D
  1. . S J=$G(^RARPT(RADA,1,I,0))
  1. . S RASTR=RASTR_","_$S($P(J,U)]"":$P(J,U),1:"Unknown")
  1. . Q
  1. Q RASTR