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

PSSDSEXD.m

Go to the documentation of this file.
PSSDSEXD ;BIR/CMF-Exceptions for Dose call Continuation ;02/24/09
 ;;1.0;PHARMACY DATA MANAGEMENT;**178,206,224**;9/30/97;Build 3
 ;
 ;Called from PSSDSEXC, this routine takes the results from the call to First DataBank and creates displayable TMP
 ;globals for the calling applications. Typically, PSSDBASA indicates a CPRS call, and PSSDBASB indicates a pharmacy call
 ;
 ;PSSDBCAR ARRAY pieces, set mostly in PSSDSAPD are described in PSSDSEXC:
 ;
 ;PSSDBCAX holds the errors to show
 ;
CONTINUE ;;
 S:$G(PSSDBDS("CONTEXT"))="" PSSDBDS("CONTEXT")=$S(+PSSDSWHE=1:"CPRS-UD",1:"OP-UD")
 D TWEAK4^PSSDSEXE
 D TWEAK0
 D:($P($G(PSSDBDS("CONTEXT")),"-",1,2)="IP-IV")!($P($G(PSSDBDS("CONTEXT")),"-",1,2)="IP-UD") TWEAK1
 D:($P($G(PSSDBDS("CONTEXT")),"-",1,2)="CPRS-IV")!($P($G(PSSDBDS("CONTEXT")),"-",1,2)="CPRS-UD") TWEAK2
 D:$P($G(PSSDBDS("CONTEXT")),"-",2,3)="IV-I" TWEAK3
 Q
 ;;
TWEAK0 ;; loop through ERROR global remove/convert certain duplicates
 N PSSDWLP,PSSDWL1
 S PSSDWLP=""
 F  S PSSDWLP=$O(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP)) Q:PSSDWLP=""  D 
 .S PSSDWL1=""
 .F  S PSSDWL1=$O(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1)) Q:PSSDWL1=""  D 
 ..Q:$$TWEAK001(PSSDWLP,PSSDWL1)
 ..Q:$$TWEAK01(PSSDWLP,PSSDWL1)
 ..Q:$$TWEAK02(PSSDWLP,PSSDWL1)
 ..Q:$$TWEAK03(PSSDWLP,PSSDWL1)
 ..Q:$$TWEAK04(PSSDWLP,PSSDWL1)
 Q
 ;;
TWEAK001(PSSDWLP,PSSDWL1) ;;
 Q $$TWEAK27^PSSDSEXE(PSSDWLP,PSSDWL1)
 ;;
TWEAK01(PSSDWLP,PSSDWL1) ;; remove dummy and duplicate weight required errors
 N REASON,MESSAGE,FLAG,PSSDWLX,PSSDWE2,PSSREPL
 S REASON=$P($G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")),".",1)
 S (FLAG,FLAG(1))=0
 D:REASON="Weight required"
 .;; first, wipe out if obtained from dummy data
 .I $P(PSSDBCAR(PSSDWLP),U,6)=1 K ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1) S FLAG=1 Q
 .;; then, look for & scrub duplicates
 .S MESSAGE=$G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG"))
 .S PSSDWLX=PSSDWL1
 .F  S PSSDWLX=$O(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX)) Q:'PSSDWLX  D 
 ..S REASON(1)=$P($G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX,"TEXT")),".",1)
 ..Q:REASON'=REASON(1)
 ..S MESSAGE(1)=$G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX,"MSG"))
 ..S:MESSAGE'=MESSAGE(1) FLAG(1)=1 ;; if different message, set Dosing Checks message
 ..K ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX)
 ..K:PSSDBASA ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX)
 ..K:PSSDBASB ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWLX)
 ..S FLAG=1
 .;; finally, alter reason for calls from CPRS
 .D:+$G(PSSDSWHE)=1!(FLAG(1)=1)
 ..S:FLAG(1)=1 MESSAGE=$$CHECKMSG(PSSDWLP)_" could not be "_$S(PSSDSWHE=1:"done",1:"performed")_" for Drug: "_$P(PSSDBCAR(PSSDWLP),U,2)
 ..D:PSSDSWHE=1
 ...S PSSREPL("performed")="done"
 ...S MESSAGE=$$REPLACE^XLFSTR(MESSAGE,.PSSREPL)_"."
 ...S PSSREPL(":.")="."
 ...S MESSAGE=$$REPLACE^XLFSTR(MESSAGE,.PSSREPL)
 ..S REASON=$S(+$G(PSSDSWHE)=0:"Weight required.",1:"No weight documented for patient.")
 ..S ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG")=MESSAGE
 ..S ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")=REASON
 ..D:PSSDBASA 
 ...S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG")=MESSAGE
 ...S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")="Reason(s): "_REASON
 ..D:PSSDBASB 
 ...S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"MSG")=MESSAGE
 ...S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"TEXT")="Reason(s): "_REASON
 ..Q
 .D:$$SHOGEN(PSSDWLP) GETGNRL(PSSDWLP)
 .S $P(PSSDBCAR(PSSDWLP),U,25)=1
 .S $P(PSSDBCAR(PSSDWLP),U,27)=1
 .Q
 Q FLAG
 ;;
TWEAK02(PSSDWLP,PSSDWL1) ;; massage BSA required errors
 N REASON,MESSAGE,FLAG,PSSDWLX,PSSDWE2
 S REASON=$P($G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")),".",1)
 S (FLAG,FLAG(1))=0
 D:REASON="Body surface area required"
 .;; first, wipe out if obtained from dummy data
 .I $P(PSSDBCAR(PSSDWLP),U,6)=1 K ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1) S FLAG=1 Q
 .;; then, look for & scrub duplicates
 .S MESSAGE=$G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG"))
 .S PSSDWLX=PSSDWL1
 .F  S PSSDWLX=$O(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX)) Q:'PSSDWLX  D 
 ..S REASON(1)=$P($G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX,"TEXT")),".",1)
 ..Q:REASON'=REASON(1)
 ..S MESSAGE(1)=$G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX,"MSG"))
 ..S:MESSAGE'=MESSAGE(1) FLAG(1)=1 ;; if different message, set Dosing Checks message
 ..K ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX)
 ..K:PSSDBASA ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWLX)
 ..K:PSSDBASB ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWLX)
 ..S FLAG=1
 .;; finally, alter reason for calls from CPRS
 .D:+$G(PSSDSWHE)=1!(FLAG(1)=1) 
 ..S:FLAG(1)=1 MESSAGE=$$CHECKMSG(PSSDWLP)_" could not be "_$S(PSSDSWHE=1:"done",1:"performed")_" for Drug: "_$P(PSSDBCAR(PSSDWLP),U,2)
 ..D:PSSDSWHE=1
 ...S PSSREPL("performed")="done"
 ...S MESSAGE=$$REPLACE^XLFSTR(MESSAGE,.PSSREPL)_"."
 ...S PSSREPL(":.")="."
 ...S MESSAGE=$$REPLACE^XLFSTR(MESSAGE,.PSSREPL)
 ..S REASON=$S(+$G(PSSDSWHE)=0:"Body surface area required.",1:"No weight and/or height documented for patient.")
 ..S ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG")=MESSAGE
 ..S ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")=REASON
 ..D:PSSDBASA 
 ...S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG")=MESSAGE
 ...S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")="Reason(s): "_REASON
 ..D:PSSDBASB 
 ...S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"MSG")=MESSAGE
 ...S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"TEXT")="Reason(s): "_REASON
 ..Q
 .D:$$SHOGEN(PSSDWLP) GETGNRL(PSSDWLP)
 .S $P(PSSDBCAR(PSSDWLP),U,26)=1
 .S $P(PSSDBCAR(PSSDWLP),U,27)=1
 .Q
 Q FLAG
 ;;
TWEAK03(PSSDWLP,PSSDWL1) ;; convert 'Not screened' fdb messages, remove all exceptions
 N SEVERITY,ROUTE,REASON,MESSAGE,FLAG
 S SEVERITY=$P($G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"SEV")),".",1)
 S FLAG=0
 D:SEVERITY="NotScreened" 
 .S $P(PSSDBCAR(PSSDWLP),U,30)=1
 .S MESSAGE=$$CHECKMSG(PSSDWLP)_" could not be "_$S(+$G(PSSDSWHE)=1:"done",1:"performed")_" for Drug: "_$P(PSSDBCAR(PSSDWLP),U,2)_$S(+$G(PSSDSWHE)=1:"",1:":")
 .D:+$G(PSSDSWHE)=0 
 ..;S MESSAGE=$$CHECKMSG(PSSDWLP)_" could not be performed for Drug: "_$P(PSSDBCAR(PSSDWLP),U,2)
 ..S REASON=$G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT"))
 .D:+$G(PSSDSWHE)=1 
 ..S MESSAGE=MESSAGE_", please complete a manual check for appropriate Dosing."
 ..;S MESSAGE=$$CHECKMSG(PSSDWLP)_" could not be done for Drug: "_$P(PSSDBCAR(PSSDWLP),U,2)_", please complete a manual check for appropriate Dosing."
 ..S REASON=""
 .K ^TMP($J,PSSDBASE,"OUT","EXCEPTIONS",PSSDWLP)
 .K ^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWLP)
 .D:PSSDBASA 
 ..S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG")=MESSAGE
 ..S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")=REASON
 ..K ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWLP)
 .D:PSSDBASB 
 ..S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"MSG")=MESSAGE
 ..S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"TEXT")="Reason(s): "_REASON
 ..K ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"EXCEPTIONS")
 .S FLAG=1
 .S $P(PSSDBCAR(PSSDWLP),U,27)=1
 .Q
 Q FLAG
 ;;
TWEAK04(PSSDWLP,PSSDWL1) ;; convert/set warning fdb messages
 N SEVERITY,REASON,MESSAGE,FLAG
 S SEVERITY=$P($G(^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"SEV")),".",1)
 S FLAG=0
 D:SEVERITY="Warning" 
 .S MESSAGE=$$DOSEMSG^PSSHRVL1($P(PSSDBCAR(PSSDWLP),U,2),$S(($P(PSSDBCAR(PSSDWLP),U,1)="S")&(+$P(PSSDBCAR(PSSDWLP),U,8)=0):"S",$P(PSSDBCAR(PSSDWLP),U,15)=1:"S",1:""),"W")
 .S ^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG")=MESSAGE
 .S REASON=^TMP($J,PSSDBASE,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")
 .; IP/OP/CPRS messages are the same
 .D:PSSDBASA 
 ..S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"MSG")=MESSAGE
 ..S ^TMP($J,PSSDBASF,"OUT","DOSE","ERROR",PSSDWLP,PSSDWL1,"TEXT")=REASON
 .D:PSSDBASB 
 ..S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"MSG")=MESSAGE
 ..S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"ERROR",PSSDWL1,"TEXT")=REASON
 .S FLAG=1
 .S $P(PSSDBCAR(PSSDWLP),U,27)=1
 .Q
 Q FLAG
 ;;
SHOGEN(PSSDWE5) ;;
 N PSSDWGFB
 S PSSDWGFB=0
 Q $$SHOGEN^PSSDSEXC()
 ;;
GETGNRL(PSSDWLP) ;; set General Dosing info for missing weight/BSA
 N DRUGNAME,DRUGIEN,MESSAGE
 S DRUGNAME=$P(PSSDBCAR(PSSDWLP),U,2)
 S DRUGIEN=$P(PSSDBCAR(PSSDWLP),U,3)
 Q:(DRUGNAME="")!(DRUGIEN="")
 D:'$D(^TMP($J,PSSDBASE,"OUT","DOSE",PSSDWLP,DRUGNAME,"GENERAL","MESSAGE",DRUGIEN)) 
 .K ^TMP($J,"PSSDSEXD")
 .M ^TMP($J,"PSSDSEXD","IN")=^TMP($J,PSSDBASE,"IN")
 .S:+^TMP($J,"PSSDSEXD","IN","DOSE","BSA")'>0 ^("BSA")=1
 .S:+^TMP($J,"PSSDSEXD","IN","DOSE","WT")'>0 ^("WT")=1
 .D IN^PSSHRQ2("PSSDSEXD")
 .Q:$D(^TMP($J,"PSSDSEXD","OUT","EXCEPTIONS"))
 .S ^TMP($J,PSSDBASE,"OUT","DOSE",PSSDWLP,DRUGNAME,"GENERAL","MESSAGE",DRUGIEN)=^TMP($J,"PSSDSEXD","OUT","DOSE",PSSDWLP,DRUGNAME,"GENERAL","MESSAGE",DRUGIEN)
 I $D(^TMP($J,"PSSDSEXD","OUT","EXCEPTIONS")) K ^TMP($J,"PSSDSEXD") Q
 S MESSAGE=^TMP($J,PSSDBASE,"OUT","DOSE",PSSDWLP,DRUGNAME,"GENERAL","MESSAGE",DRUGIEN)
 I PSSDBASA S ^TMP($J,PSSDBASF,"OUT","DOSE",PSSDWLP,DRUGNAME,"3_GENERAL","MESSAGE",DRUGIEN,1)=MESSAGE
 I PSSDBASB S ^TMP($J,PSSDBASG,"OUT",PSSDWLP,"MESSAGE","3_GENERAL",DRUGIEN,1)=MESSAGE
 K ^TMP($J,"PSSDSEXD")
 Q
 ;;
TWEAK1 ;; loop through EXCEPTION global, test for five IV related tweaks
 N PSSDWEX2,PSSDWE2,NODE
 S PSSDWEX2=""
 F  S PSSDWEX2=$O(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2)) Q:PSSDWEX2=""  D 
 .S PSSDWE2=""
 .F  S PSSDWE2=$O(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2)) Q:PSSDWE2=""  D
 ..S NODE=$G(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2))
 ..Q:NODE=""
 ..Q:$$TWEAK11(NODE)
 ..Q:$$TWEAK12(NODE)
 ..Q:$$TWEAK13(NODE)
 ..Q:$$TWEAK14(NODE)
 ..Q:$$TWEAK15(NODE)
 Q
 ;;
TWEAK11(NODE) ;;
 N REASON,MESSAGE
 S REASON=$$UP^XLFSTR($P(NODE,U,10))
 Q:REASON'="DRUG NOT MATCHED TO NDF" 0
 S MESSAGE=$$CHECKMSG(PSSDWEX2)_" could not be performed for Drug: "_$P(PSSDBCAR(PSSDWEX2),U,2)
 S $P(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2),U,7)=MESSAGE
 S:PSSDBASA ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,1)=MESSAGE
 S:PSSDBASB ^TMP($J,PSSDBASG,"OUT",PSSDWEX2,"EXCEPTIONS",1)=MESSAGE
 S $P(PSSDBCAR(PSSDWEX2),U,27)=1
 Q 1
 ;;
TWEAK12(NODE) ;;
 N REASON
 S REASON=$$UP^XLFSTR($P(NODE,U,10))
 Q:REASON'="NO GCNSEQNO EXISTS FOR VA PRODUCT" 0
 Q:$$EXMT^PSSDSAPI($P(PSSDBCAR(PSSDWEX2),U,3))=0 0
 K ^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2)
 K:PSSDBASA ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2)
 K:PSSDBASB ^TMP($J,PSSDBASG,"OUT",PSSDWEX2,"EXCEPTIONS")
 S $P(PSSDBCAR(PSSDWEX2),U,27)=1
 Q 1
 ;;
TWEAK13(NODE) ;;
 N REASON,MESSAGE
 S REASON=$$UP^XLFSTR($P(NODE,U,10))
 Q:REASON'="NO GCNSEQNO EXISTS FOR VA PRODUCT" 0
 Q:$$EXMT^PSSDSAPI($P(PSSDBCAR(PSSDWEX2),U,3))=1 0
 S MESSAGE=$$CHECKMSG(PSSDWEX2)_" could not be performed for Drug: "_$P(PSSDBCAR(PSSDWEX2),U,2)_", please complete a manual check for appropriate Dosing."
 S $P(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2),U,7)=MESSAGE
 S $P(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2),U,10)=""
 D:PSSDBASA 
 .S ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,1)=MESSAGE
 .S ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,2)=""
 D:PSSDBASB 
 .S ^TMP($J,PSSDBASG,"OUT",PSSDWEX2,"EXCEPTIONS",1)=MESSAGE
 .S ^TMP($J,PSSDBASG,"OUT",PSSDWEX2,"EXCEPTIONS",2)=""
 S $P(PSSDBCAR(PSSDWEX2),U,27)=1
 Q 1
 ;;
TWEAK14(NODE) ;;
 N REASON
 S REASON=$$UP^XLFSTR($P(NODE,U,10))
 Q:REASON'="BAD GCNSEQNO ASSIGNED TO VA PRODUCT" 0
 Q:$$EXMT^PSSDSAPI($P(PSSDBCAR(PSSDWEX2),U,3))=0 0
 K ^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2)
 K:PSSDBASA ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2)
 K:PSSDBASB ^TMP($J,PSSDBASG,"OUT",PSSDWEX2,"EXCEPTIONS")
 S $P(PSSDBCAR(PSSDWEX2),U,27)=1
 Q 1
 ;;
TWEAK15(NODE) ;;
 N REASON,MESSAGE
 S REASON=$$UP^XLFSTR($P(NODE,U,10))
 Q:REASON'="BAD GCNSEQNO ASSIGNED TO VA PRODUCT" 0
 Q:$$EXMT^PSSDSAPI($P(PSSDBCAR(PSSDWEX2),U,3))=1 0
 S MESSAGE=$$CHECKMSG(PSSDWEX2)_" could not be performed for Drug: "_$P(PSSDBCAR(PSSDWEX2),U,2)_", please complete a manual check for appropriate Dosing."
 S $P(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2),U,7)=MESSAGE
 S $P(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2),U,10)=""
 D:PSSDBASA 
 .S ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,1)=MESSAGE
 .S ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,2)=""
 D:PSSDBASB 
 .S ^TMP($J,PSSDBASG,"OUT",PSSDWEX2,"EXCEPTIONS",1)=MESSAGE
 .S ^TMP($J,PSSDBASG,"OUT",PSSDWEX2,"EXCEPTIONS",2)=""
 S $P(PSSDBCAR(PSSDWEX2),U,27)=1
 Q 1
 ;;
TWEAK2 ;; loop through exception global, look for OR related tweaks
 D TWEAK2^PSSDSEXE
 Q
 ;;
TWEAK3  ;; ensure itermittent with certain exceptions have general dosing info
 N PSSDWEX2,PSSDWE2,NODE
 S PSSDWEX2=""
 F  S PSSDWEX2=$O(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2)) Q:PSSDWEX2=""  D 
 .S PSSDWE2=""
 .F  S PSSDWE2=$O(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2)) Q:PSSDWE2=""  D
 ..S NODE=$G(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2))
 ..Q:NODE=""
 ..Q:$$TWEAK31(NODE)
 Q
 ;;
TWEAK31(NODE) ;; itermittent with bad frequency
 N REASON,MESSAGE
 S REASON=$$UP^XLFSTR($P(NODE,U,10))
 Q:REASON'="INVALID OR UNDEFINED FREQUENCY" 0
 ; -- RTC 165417
 D:PSSDBASA 
 . S MESSAGE="Max Daily Dose Check could not be done for Drug: "_$P(PSSDBCAR(PSSDWEX2),U,2)_", please complete a manual check for appropriate Dosing."
 . S $P(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2),U,7)=MESSAGE
 . S $P(^TMP($J,PSSDBASE,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,PSSDWE2),U,10)=""
 . S ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,1)=MESSAGE
 . S ^TMP($J,PSSDBASF,"OUT","EXCEPTIONS","DOSE",PSSDWEX2,2)=""
 D:$$SHOGEN(PSSDWEX2) GETGNRL3^PSSDSEXE(PSSDWEX2)
 S $P(PSSDBCAR(PSSDWEX2),U,27)=1
 Q 1
 ;;
CHECKMSG(PSSLOOP) ;; max single if single dose, excluded or complex, else dosing
 Q $S(($P(PSSDBCAR(PSSLOOP),U,5)=0)!($P(PSSDBCAR(PSSLOOP),U,15)=1)!($$ISCMPLEX(PSSLOOP)):"Maximum Single Dose Check",$P(PSSDBCAR(PSSLOOP),U,30)=1:"Dosing Order Checks",1:$$ISCMPLET^PSSDSEXE(PSSLOOP))  ;;,1)"Dosing Checks")
 ;;
ISCMPLEX(PSSLOOP) ;; is complex order
 Q $S($P(PSSDBCAR(PSSLOOP),U,16)=1:1,$P(PSSLOOP,";",5):1,1:0)
 ;;