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

RASTREQN.m

Go to the documentation of this file.
  1. RASTREQN ;HIRMFO/GJC-Status Requirement check for Radiopharms ;11/18/97 15:13
  1. ;;5.0;Radiology/Nuclear Medicine;**40,65**;Mar 16, 1998;Build 8
  1. ;
  1. ;supported IA #10104 reference to UP^XLFSTR and REPEAT^XLFSTR
  1. ;Supported IA #2056 refernce to GETS^DIQ
  1. ;
  1. ; *** 'RASTREQN' is called from routine: 'RASTREQ' ***
  1. EN1(RADIO,RAJ) ; Check if all the required radiopharmaceutical data has
  1. ; been entered for this particular Examination Status.
  1. ; *=*=*= Kills 'X' if the status cannot be updated =*=*=*
  1. ; Input: 'RADIO' -> .5 node of the examination status (Radiopharms req)
  1. ; 'RAJ' -> 0 node of the examination
  1. ;
  1. ; NOTE: RAMES1 is set in RASTREQ^RASTREQ subroutine. Only the 'Status
  1. ; Tracking Of Exams' option displays which required fields are not
  1. ; populated for the next available Exam Status.
  1. ;
  1. ;----------------------------------------------------------------------
  1. ; Determine if 'Radiopharmaceutical' is required
  1. ; RAPRI defined in [RA STATUS CHANGE] & [RA EXAM EDIT]
  1. ;
  1. Q:"N"[$P(RADIO,"^") ; Rpharms & Dosages NOT Req'd (either 'no' or null)
  1. N RAPROC S RAPROC(0)=$G(^RAMIS(71,+$P(RAJ,"^",2),0))
  1. Q:$P(RAPROC(0),"^",2)=1 ; Never ask Rpharms & Dosages
  1. ;----------------------------------------------------------------------
  1. N RA702 S RA702=+$P(RAJ,"^",28) ; ien in NUC MED EXAM DATA (70.2) file
  1. N RA7021,RACNT,RAI,RAMES2,RAREQ,RAZ S RAI=0
  1. I 'RA702,($P(RADIO,"^")="Y") D Q
  1. . K X S RAZ="Radiopharmaceutical" X:$D(RAMES1) RAMES1
  1. . Q
  1. F S RAI=$O(^RADPTN(RA702,"NUC",RAI)) Q:RAI'>0 D
  1. . S RA7021=$G(^RADPTN(RA702,"NUC",RAI,0)),RACNT=0
  1. . S RAMES2="W:$G(K)=$P($G(^RA(72,+$G(RANXT72),0)),U,3)&('$D(ZTQUEUED)#2) !,""Radiopharmaceutical: "",$$EN1^RAPSAPI(+$P(RA7021,""^""),.01)"
  1. . I $P(RADIO,"^")="Y",($P(RA7021,"^")=""!($P(RA7021,"^",7)="")) D
  1. .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
  1. .. I $P(RA7021,"^")="" S RAZ="Radiopharmaceutical" X:$D(RAMES1) RAMES1
  1. .. I $P(RA7021,"^",7)="" S RAZ="Dosage" X:$D(RAMES1) RAMES1
  1. .. Q
  1. . I $P(RADIO,"^",3)="Y",($P(RA7021,"^",4)="") D
  1. .. S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
  1. .. S RAZ="Activity Drawn" X:$D(RAMES1) RAMES1 K X
  1. .. Q
  1. . I $P(RADIO,"^",4)="Y",($P(RA7021,"^",5)=""!($P(RA7021,"^",6)="")) D
  1. .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
  1. .. I $P(RA7021,"^",5)="" S RAZ="Date/Time Drawn" X:$D(RAMES1) RAMES1
  1. .. I $P(RA7021,"^",6)="" S RAZ="Person Who Measured Dose" X:$D(RAMES1) RAMES1
  1. .. Q
  1. . I $P(RADIO,"^",5)="Y",($P(RA7021,"^",8)=""!($P(RA7021,"^",9)="")) D
  1. .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
  1. .. I $P(RA7021,"^",8)="" S RAZ="Date/Time Dose Administered" X:$D(RAMES1) RAMES1
  1. .. I $P(RA7021,"^",9)="" S RAZ="Person Who Administered Dose" X:$D(RAMES1) RAMES1
  1. .. Q
  1. . I $P(RADIO,"^",7)="Y",($P(RA7021,"^",11)=""!($P(RA7021,"^",12)="")) D
  1. .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
  1. .. I $P(RA7021,"^",11)="" S RAZ="Route Of Administration" X:$D(RAMES1) RAMES1
  1. .. I $P(RA7021,"^",12)="" S RAZ="Site Of Administration" X:$D(RAMES1) RAMES1
  1. .. Q
  1. . I $P(RADIO,"^",8)="Y",($P(RA7021,"^",13)="") D
  1. .. S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
  1. .. S RAZ="Lot No." X:$D(RAMES1) RAMES1 K X
  1. .. Q
  1. . I $P(RADIO,"^",9)="Y",($P(RA7021,"^",14)=""!($P(RA7021,"^",15)="")) D
  1. .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
  1. .. I $P(RA7021,"^",14)="" S RAZ="Volume" X:$D(RAMES1) RAMES1
  1. .. I $P(RA7021,"^",15)="" S RAZ="Form" X:$D(RAMES1) RAMES1
  1. .. Q
  1. . Q
  1. Q
  1. NORADIO(RAPRI,RANXT72) ; This function will determine if Rpharm
  1. ; fields from the 'Nuc Med Exam Data' file [ ^RADPTN( ] will be asked.
  1. ; Input : 'RANXT72' -> .6 node of the 'Next' Exam Status
  1. ; : 'RAPRI' -> IEN of the procedure for this exam
  1. ; Output: '1' bypass Rpharm questions, else (0) ask
  1. Q:$TR($$UP^XLFSTR(RANXT72(.6)),"^","")="" 1 ; null or '^'s
  1. ; ------------------- Variable Definitions ----------------------------
  1. ; 'RAPROC(2)': ask Rpharm & Dosages parameter for this procedure
  1. ;----------------------------------------------------------------------
  1. N RAPROC S RAPROC(2)=$P($G(^RAMIS(71,RAPRI,0)),"^",2)
  1. ;----------------------------------------------------------------------
  1. ; * following conditions apply for descendants exams & single exams *
  1. ; * Number 1: Suppress Rpharm = 1 even if 'Rpharms/Dose' Req'd *
  1. ; * Number 2: Suppress Rpharm = null or 0, 'Rpharm/Dose' not req'd *
  1. Q:RAPROC(2)=1 1
  1. Q:"N"[$P(RANXT72(.6),"^") 1
  1. ;----------------------------------------------------------------------
  1. Q 0 ; ask Rpharm & Dosage fields
  1. DISDEF(RADA) ; Display Radiopharmaceutical default data
  1. ; called from input templs: [RASTATUS CHANGE] and [RA EXAM EDIT]
  1. ; Input: RADA -> ien of the Nuc Med Exam Data record
  1. Q:'$O(^RADPTN(RADA,"NUC",0)) ; Radiopharms missing, no data
  1. N RADARY,RADEUC,RAFLDS,RAIENS,RAOPUT,X,Y W !
  1. S RAIENS="" D GETS^DIQ(70.2,RADA_",","**","NE","RADARY")
  1. F S RAIENS=$O(RADARY(70.21,RAIENS)) Q:RAIENS="" D
  1. . Q:$P(RAIENS,",",2)="" ; top-level of the file
  1. . S (RADEUC,RAFLDS)=0
  1. . F S RAFLDS=$O(RADARY(70.21,RAIENS,RAFLDS)) Q:RAFLDS'>0 D Q:$D(DIRUT)
  1. .. I RAFLDS=.01 D
  1. ... S RADEUC=0 W !,$G(RADARY(70.21,RAIENS,RAFLDS,"E"))
  1. ... W !,$$REPEAT^XLFSTR("-",$L($G(RADARY(70.21,RAIENS,RAFLDS,"E")))),!
  1. ... Q
  1. .. E D
  1. ... S RADEUC=RADEUC+1
  1. ... S RAOPUT=$$TRAN(RAFLDS)_$G(RADARY(70.21,RAIENS,RAFLDS,"E"))_$S(RAFLDS=2:" mCi",RAFLDS=4:" mCi",RAFLDS=7:" mCi",1:"")
  1. ... W:RADEUC=1 $E(RAOPUT,1,38) W:RADEUC=2 ?39,$E(RAOPUT,1,39)
  1. ... Q
  1. .. W:RADEUC'=2&($O(RADARY(70.21,RAIENS,RAFLDS))="") !
  1. .. W:RADEUC=2 ! S:RADEUC=2 RADEUC=0
  1. .. Q
  1. . Q
  1. Q
  1. TRAN(X) ; Translate field name to a shorter length.
  1. Q:X=2 "Dose (MD Override): " Q:X=3 "Prescriber: "
  1. Q:X=4 "Activity Drawn: " Q:X=5 "Drawn: " Q:X=6 "Measured By: "
  1. Q:X=7 "Dose Adm'd: " Q:X=8 "Date Adm'd: " Q:X=9 "Adm'd By: "
  1. Q:X=10 "Witness: " Q:X=11 "Route: " Q:X=12 "Site: "
  1. Q:X=12.5 "Site Text: " Q:X=13 "Lot #: " Q:X=14 "Volume: "
  1. Q:X=15 "Form: "
  1. VALDOS(RALOW,RAHI,X,RABACKTO,RAGOTO,RALASTAG,RAWARN) ;validate drawn/dose
  1. ; Called from [RA STATUS CHANGE] and [RA EXAM EDIT] input templates.
  1. ; Validate the value for either :
  1. ; ACTIVITY DRAWN (fld 4, DD: 70.21)
  1. ; DOSE (fld 7, DD: 70.21)
  1. ; If there are limits on the Dosage, validate.
  1. ; If validate fails, ask user if the invalid value is to be accepted.
  1. ; If yes, proceed.
  1. ; If no, re-ask DOSE.
  1. ; Input: RAHI = Upper limit on dosage
  1. ; RALOW = Lower limit on dosage
  1. ; X = Value user input
  1. ; RABACKTO = Previous Line tag to loop back to if need re-ask
  1. ; RAGOTO = Default linetag to proceed to if within range
  1. ; RALASTAG = Last linetag in this edit template if early out
  1. ; RAWARN = display/not the warning msg -- 0=no, 1=yes
  1. ;
  1. ; Output: RAY = linetag to proceed to after exiting this check
  1. ;
  1. N RAY,RAYN S RAY="" I X']"" S RAY=RAGOTO G KVAL
  1. S:RALOW=""&(RAHI="") RAY=RAGOTO
  1. S:RALOW]""&(RAHI="")&(X'<RALOW) RAY=RAGOTO
  1. S:RALOW=""&(RAHI]"")&(X'>RAHI) RAY=RAGOTO
  1. S:RALOW]""&(RAHI]"")&(X'<RALOW)&(X'>RAHI) RAY=RAGOTO
  1. I RAY="" D
  1. . F D Q:RAY]""
  1. .. I $O(^RA(79,RAMDIV,"RWARN",0)) D:RAWARN
  1. ... N I S I=0
  1. ... F S I=$O(^RA(79,RAMDIV,"RWARN",I)) Q:I'>0 W !,$G(^(I,0))
  1. ... Q
  1. .. E D:RAWARN
  1. ... W !,"This dose requires a written, dated and signed directive by"
  1. ... W !,"a physician."
  1. ... Q
  1. .. W !!?3,"Are you sure (Y/N)?: N//" R RAYN:DTIME
  1. .. I '$T!(RAYN["^") S RAY=RALASTAG Q
  1. .. S RAYN=$S(RAYN']"":"N",1:$$UP^XLFSTR($E(RAYN)))
  1. .. S RAY=$S(RAYN="N":RABACKTO,RAYN="Y":RAGOTO,1:"")
  1. .. I RAY="" W !!?3,"Enter 'Yes' if this value is acceptable, or 'No' if this field is to be",!?3,"re-edited.",$C(7)
  1. .. Q
  1. . Q
  1. KVAL K RABACKTO,RAGOTO,RALASTAG,RAWARN
  1. Q RAY