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

RAFLH2.m

Go to the documentation of this file.
  1. RAFLH2 ;HISC/GJC-Utility determines if flash cards print. ;4/3/97 07:57
  1. ;;5.0;Radiology/Nuclear Medicine;**47**;Mar 16, 1998;Build 21
  1. ;
  1. ;Integration Agreements
  1. ;----------------------
  1. ;$$NS^XUAF4(2171); $$KSP^XUPARAM(2541)
  1. ;
  1. PRINT(RADIV,RALOC,RAPRC) ;
  1. ; Pass in 'RAMDIV', 'RAMLC' & proc. array i.e, 'RAPX'.
  1. ; Pass back '0' if the print is to be aborted, '>0' to print.
  1. N I,RA71,RA79,RA791,RAFLG,X,X1
  1. S RA79(.1)=$G(^RA(79,RADIV,.1)),RA791(0)=$G(^RA(79.1,+RALOC,0))
  1. S RA79(.12)=$S($P(RA79(.1),"^",2)']"":0,"Nn"[$P(RA79(.1),"^",2):0,1:1)
  1. S RA79(.18)=$S($P(RA79(.1),"^",8)']"":0,"Nn"[$P(RA79(.1),"^",8):0,1:1)
  1. S RA791(2)=$S('+$P(RA791(0),"^",2):0,1:1) ; '0' if null or zero
  1. S RA791(4)=$S('+$P(RA791(0),"^",4):0,1:1) ; '0' if null or zero
  1. S RA791(8)=$S('+$P(RA791(0),"^",8):0,1:1) ; '0' if null or zero
  1. ; 'RAPRC' in format of: Case #_^_$G(^RAMIS(71,proc,0))
  1. ; where 'proc' is the procedure IEN. created in [RA REGISTER]
  1. S I=0 F S I=$O(RAPRC(I)) Q:I'>0 D
  1. . S X=$G(RAPRC(I)),X1=$P(X,"^",5)
  1. . S RA71=+$G(RA71)+($S(X1']"":0,1:1))
  1. . Q
  1. S RAFLG=+$G(RA71)+RA791(2)+RA791(4)+RA791(8)+RA79(.12)+RA79(.18)
  1. Q RAFLG
  1. KILFLH(X) ; Kill Flash Card Formats variables.
  1. ; X -> IEN of file of the Label Print Fields file.
  1. ; Called from 6^RAMAIN & Q^RAFLH1
  1. Q:$G(^RA(78.7,X,0))']"" S RA787(0)=$G(^RA(78.7,X,0))
  1. K @$P(RA787(0),"^",5),RA787(0)
  1. Q
  1. SETFLH(Y) ; Set Flash Card Formats variables.
  1. ; Y -> IEN of file of the Label Print Fields file.
  1. ; Called from 6^RAMAIN & START^RAFLH1
  1. Q:$G(^RA(78.7,Y,0))']"" S RA787(0)=$G(^RA(78.7,Y,0))
  1. I $P(RA787(0),U)="LONG CASE NUMBER" D LONGCASE(RA787(0)) Q
  1. S @$P(RA787(0),"^",5)=$P(RA787(0),"^",4)
  1. Q
  1. XECFLH(X,Y) ; Execute the "E" node for the Flash Card Formats file (78.2).
  1. ; X -> IEN of the top level ; Y -> IEN at the first subfile level.
  1. ; Called from RAFLH & RAFLH1
  1. N I S I=0
  1. F S I=$O(RAIND1(I)) Q:'+I S ^TMP($J,"RA FLASH",I)=RAIND1(I)
  1. I '$D(RATEST) X ^RA(78.2,X,"E",Y,0) Q
  1. N RASAV,RATMP S RASAV=$G(^RA(78.2,X,"E",Y,0))
  1. S RATMP=$P(RASAV,"@")_$P(RASAV,"@",2) X RATMP
  1. S ^RA(78.2,X,"E",Y,0)=RASAV
  1. Q
  1. ;
  1. LONGCASE(X) ;Set the INTERNAL VARIABLE (78.7 field 5) to the TEST VALUE (78.7 field 4)
  1. ;when the LABEL PRINT FIELD record is: LONG CASE NUMBER (p47)
  1. ;
  1. ;Input: X-zero node of a file 78.7 record
  1. ;
  1. ;"081194-234" is generic; it is not a direct reference to any specific patient exam.
  1. ;
  1. N RAI S RAI=$$USESSAN^RAHLRU1() ;if RAI use LONG CASE NUMBER w/site prefix
  1. S @$P(X,U,5)=$S(RAI:$E($P($$NS^XUAF4($$KSP^XUPARAM("INST")),U,2),1,3)_"-",1:"")_"081194-234"
  1. Q
  1. ;