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

RAUTL19A.m

Go to the documentation of this file.
  1. RAUTL19A ;HISC/SWM-Utility Routine ;10/29/97 09:33
  1. ;;5.0;Radiology/Nuclear Medicine;**21**;Mar 16, 1998
  1. ;
  1. CKOTHER(A) N E,J,I,RALERT,RAVER,RADETAIL,RAIMPRES,RASTNAM,RANODE,RAER1,RAVER1,RAIMPR1,RATICKET,RAVER2,RAIMPR2,RAPHY
  1. ;RAERR is used by RAUTL19 to signal one or more errors
  1. ;RAER1 stores 5 pieces of error flags for each imaging type :
  1. ; pce 1=1 if more than 1 status has GENERATE EXAM ALERT? set to Y
  1. ; pce 2=1 if verfd rpt req'd, but imprsn not req'd at same/lower status
  1. ; pce 3=1 if detailed proc not req'd in any status
  1. ; pce 4=1 if more than 1 status had PRINT DOSAGE TICKET? set to Y
  1. ; pce 5=1 if staff/resident not req'd in any status
  1. ; only 1 'print dosage ticket' allowed per imaging type
  1. ;
  1. S I=0,E="",RAER1="",RALERT=0,RATICKET=0
  1. S (RAVER1,RAVER2,RAIMPR1,RAIMPR2,RAPHY)=""
  1. F S E=$O(^RA(72,"AA",A,E)) Q:E'=+E D
  1. . S I=$O(^RA(72,"AA",A,E,0)) Q:'I
  1. . S RASTNAM=$P(^RA(72,I,0),U),RANODE(.1)=$G(^RA(72,I,.1))
  1. . S:$$UP^XLFSTR($G(^RA(72,I,"ALERT")))="Y" RALERT=RALERT+1,RALERT(E)=RASTNAM
  1. . S:$$UP^XLFSTR($P($G(^RA(72,I,.6)),U,11))="Y" RATICKET=RATICKET+1,RATICKET(E)=RASTNAM
  1. . S:$$UP^XLFSTR($P($G(^RA(72,I,.1)),U,3))="Y" RADETAIL(E)=""
  1. . S:$$UP^XLFSTR($P($G(^RA(72,I,.1)),U,2))="Y" RAPHY(E)=""
  1. . S RAIMPR1(E)=$P($G(^RA(72,I,.1)),U,16) ;actual value
  1. . S RAVER1(E)=$P($G(^RA(72,I,.1)),U,12)_U_RASTNAM ; actual value
  1. . S:$$UP^XLFSTR($P(RAVER1(E),U))="Y" RAVER2(E)=""
  1. . S:$$UP^XLFSTR($P(RAIMPR1(E),U))="Y" RAIMPR2(E)=""
  1. . Q
  1. S:RALERT>1 $P(RAER1,U)=1 S:RATICKET>1 $P(RAER1,U,4)=1
  1. S:$O(RAPHY(E))'>0 $P(RAER1,U,5)=1
  1. I $O(RAVER2(0))>0 D
  1. . I $O(RAIMPR2(0))>$O(RAVER2(0)) S $P(RAER1,U,2)=1
  1. . I $O(RAIMPR2(0))="" S $P(RAER1,U,2)=1
  1. . Q
  1. S E=""
  1. I '$O(RADETAIL(0)) S $P(RAER1,U,3)=1 ; ignore cancelled status
  1. Q:RAER1="" S RAERR=1
  1. I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. I $P(RAER1,U)=1 D Q:RAOUT
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !!,RADASH,"Checking total number of alerts requested",RADASH,!?11,"within : ",A,!
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !?5,"Statuses requesting '",$P(^DD(72,1,.1),U),"'"
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . S I="" F S I=$O(RALERT(I)) Q:I'=+I W !?20,RALERT(I)
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !!?5,"There should be at most 1 status per imaging type where",!?5,"'",$P(^DD(72,1,.1),U),"' is Y."
  1. I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. I $P(RAER1,U,2)=1 D Q:RAOUT
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !!,RADASH,"Checking verified report required and impression required",RADASH,!?11,"within : ",A,!
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !?5,"'",$P(^DD(72,.112,.1),U),"' was set to 'yes'; but",!?5,"'",$P(^DD(72,.116,.1),U),"' was not set to 'yes' at this and lower status(es) :",!
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . S E="" W !?27,"Verified Rpt req'd",?53,"Impression Required"
  1. . F S E=$O(RAVER1(E)) Q:E'=+E W !?5,$P(RAVER1(E),U,2),?36,$P(RAVER1(E),U),?66,RAIMPR1(E) I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . Q:RAOUT
  1. . W !!?5,"If verified report is required at a particular status,",!?5,"then the impression should also be required at the same or lower status."
  1. I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. I $P(RAER1,U,3)=1 D Q:RAOUT
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !!,RADASH,"Checking presence of detailed procedure required",RADASH,!?11,"within : ",A,!
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !?5,"None of the statuses requires detailed procedure.",!!?5,"A detailed procedure must be required in at least one status",!?5,"for PCE crediting."
  1. I $P(RAER1,U,5)=1 D Q:RAOUT
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !!,RADASH,"Checking presence of resident or staff required",RADASH,!?11,"within : ",A,!
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !?5,"None of the statuses requires resident or staff.",!!?5,"Resident or staff must be required in at least one status",!?5,"for PCE crediting."
  1. I $P(RAER1,U,4)=1 D Q:RAOUT
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !!,RADASH,"Checking total number of print dosage ticket requested",RADASH,!?11,"within : ",A,!
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !?5,"Statuses requesting '",$P(^DD(72,.611,.1),U),"'"
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . S I="" F S I=$O(RATICKET(I)) Q:I'=+I W !?20,RATICKET(I)
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. . W !!?5,"There should be at most 1 status per imaging type, where",!?5,"'",$P(^DD(72,.611,.1),U),"' is Y."
  1. . I $Y>(IOSL-6) S RAOUT=$$EOS^RAUTL5() Q:RAOUT D HEAD^RAUTL11
  1. Q