PSSHRQ24 ;WOIFO/AV,TS,SG,CF - Parses out drugsNotChecked and DrugDoseCheck XML (cont) ;09/20/07
;;1.0;PHARMACY DATA MANAGEMENT;**178,206,224**;9/30/97;Build 3
;
; @authors - Alex Vazquez, Tim Sabat, Steve Gordon, Chris Flegel
; @date - June 23, 2014
; @version - 1.0
;
QUIT
;
DOSEWRIT(HASH,BASE) ;
; @DESC Handles writing the drug dose output global
;
; @HASH Variable containing drug dose values
; @BASE Base of output global
;
; @RETURNS Nothing
;
NEW I,NODE,QT,IEN,PSSFSCO,PSSFSCB,PSSFSCN,PSSFSCI
;get dose form flag
;
SET QT=""""
SET I=""
FOR SET I=$ORDER(HASH(I)) QUIT:I=""!('I) DO
. SET NODE="^TMP($JOB,BASE,""OUT"",""DOSE"",HASH(I,""orderNumber""),HASH(I,""drugName""))"
. SET IEN=HASH(I,"ien")
. ;
. ; Single values
. I $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseStatus") SET @NODE@("SINGLE","STATUS",IEN)=HASH(I,"singleDoseStatus")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseStatusCode") SET @NODE@("SINGLE","STATUSCODE",IEN)=HASH(I,"singleDoseStatusCode")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseMessage") SET @NODE@("SINGLE","MESSAGE",IEN)=HASH(I,"singleDoseMessage")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseMax") SET @NODE@("SINGLE","MAX",IEN)=HASH(I,"singleDoseMax")
. ; Range values
. I $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseLow") SET @NODE@("RANGE","LOW",IEN)=HASH(I,"rangeDoseLow")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseHigh") SET @NODE@("RANGE","HIGH",IEN)=HASH(I,"rangeDoseHigh")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseStatus") SET @NODE@("RANGE","STATUS",IEN)=HASH(I,"rangeDoseStatus")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseStatusCode") SET @NODE@("RANGE","STATUSCODE",IEN)=HASH(I,"rangeDoseStatusCode")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseMessage") SET @NODE@("RANGE","MESSAGE",IEN)=HASH(I,"rangeDoseMessage")
. ;set general dose form data
. I $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormHigh") SET @NODE@("GENERAL","DOSEFORMHIGH",IEN)=HASH(I,"doseFormHigh")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormHighUnit") SET @NODE@("GENERAL","DOSEFORMHIGHUNIT",IEN)=HASH(I,"doseFormHighUnit")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormLow") SET @NODE@("GENERAL","DOSEFORMLOW",IEN)=HASH(I,"doseFormLow")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormLowUnit") SET @NODE@("GENERAL","DOSEFORMLOWUNIT",IEN)=HASH(I,"doseFormLowUnit")
. ; General subscript values
. SET @NODE@("GENERAL","DOSEHIGH",IEN)=HASH(I,"doseHigh")
. SET @NODE@("GENERAL","DOSEHIGHUNIT",IEN)=HASH(I,"doseHighUnit")
. SET @NODE@("GENERAL","DOSELOW",IEN)=HASH(I,"doseLow")
. SET @NODE@("GENERAL","DOSELOWUNIT",IEN)=HASH(I,"doseLowUnit")
. SET @NODE@("GENERAL","DOSEROUTEDESCRIPTION",IEN)=HASH(I,"doseRouteDescription")
. SET @NODE@("GENERAL","MESSAGE",IEN)=$$BUILDMSG^PSSHRQ25(I,.HASH)
. ; "CHEMO" value, if any
. I $$CHKVAL^PSSHRQ23(.HASH,I,"chemoInjectable") SET @NODE@("CHEMO")=HASH(I,"chemoInjectable")
. ; Daily values
. I $$CHKVAL^PSSHRQ23(.HASH,I,"dailyDoseStatus") SET @NODE@("DAILY","STATUS",IEN)=HASH(I,"dailyDoseStatus")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"dailyDoseStatusCode") SET @NODE@("DAILY","STATUSCODE",IEN)=HASH(I,"dailyDoseStatusCode")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"dailyDoseMessage") SET @NODE@("DAILY","MESSAGE",IEN)=HASH(I,"dailyDoseMessage")
. ; Max Daily values
. I $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseStatus") SET @NODE@("DAILYMAX","STATUS",IEN)=HASH(I,"maxDailyDoseStatus")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseStatusCode") SET @NODE@("DAILYMAX","STATUSCODE",IEN)=HASH(I,"maxDailyDoseStatusCode")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseMessage") SET @NODE@("DAILYMAX","MESSAGE",IEN)=HASH(I,"maxDailyDoseMessage")
. ; general maximum life time dose
. I $$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeDose") SET @NODE@("MAXLIFETIME","DOSE",IEN)=HASH(I,"maxLifetimeDose")
. ; Frequency values, if any
. I $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyStatus") SET @NODE@("FREQ","FREQUENCYSTATUS",IEN)=HASH(I,"frequencyStatus")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyStatusCode") SET @NODE@("FREQ","FREQUENCYSTATUSCODE",IEN)=HASH(I,"frequencyStatusCode")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyMessage") SET @NODE@("FREQ","FREQUENCYMESSAGE",IEN)=HASH(I,"frequencyMessage")
. I $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyHigh") SET @NODE@("FREQ","FREQUENCYHIGH",IEN)=HASH(I,"frequencyHigh") D CSTMFREQ(.HASH,I,NODE,IEN)
. I $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyLow") SET @NODE@("FREQ","FREQUENCYLOW",IEN)=HASH(I,"frequencyLow") D CSTMFREQ(.HASH,I,NODE,IEN)
. ; dose percent elements
. D:$D(HASH(I,"single"))=10 WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"single","","")
. D:$D(HASH(I,"rangeLow"))=10 WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"rangeLow","","")
. D:$D(HASH(I,"rangeHigh"))=10 WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"rangeHigh","","")
. D:$D(HASH(I,"daily"))=10 WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"daily","","")
. D:$D(HASH(I,"maxDaily"))=10 WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"maxDaily","DAILYMAX","")
. D:$D(HASH(I,"maxLifetime"))=10 WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"maxLifetime","","")
. D:$D(HASH(I,"maxLifetimeOrder"))=10 WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"maxLifetimeOrder","","")
. ;;
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeOrderMessage") @NODE@("MAXLIFETIMEORDER","MESSAGE",IEN)=HASH(I,"maxLifetimeOrderMessage")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeOrderStatus") @NODE@("MAXLIFETIMEORDER","STATUS",IEN)=HASH(I,"maxLifetimeOrderStatus")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeOrderStatusCode") @NODE@("MAXLIFETIMEORDER","STATUSCODE",IEN)=HASH(I,"maxLifetimeOrderStatusCode")
. ;;
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDose") @NODE@("MAXSINGLENTE","DOSE",IEN)=HASH(I,"maxSingleNTEDose")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDoseUnit") @NODE@("MAXSINGLENTE","DOSEUNIT",IEN)=HASH(I,"maxSingleNTEDoseUnit")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDoseForm") @NODE@("MAXSINGLENTE","DOSEFORM",IEN)=HASH(I,"maxSingleNTEDoseForm")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDoseFormUnit") @NODE@("MAXSINGLENTE","DOSEFORMUNIT",IEN)=HASH(I,"maxSingleNTEDoseFormUnit")
. ;;
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDose") @NODE@("DAILYMAX","DOSE",IEN)=HASH(I,"maxDailyDose")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseUnit") @NODE@("DAILYMAX","DOSEUNIT",IEN)=HASH(I,"maxDailyDoseUnit")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseForm") @NODE@("DAILYMAX","DOSEFORM",IEN)=HASH(I,"maxDailyDoseForm")
. S:$$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseFormUnit") @NODE@("DAILYMAX","DOSEFORMUNIT",IEN)=HASH(I,"maxDailyDoseFormUnit")
. ;;
.;
.; -- in 2.1 if max daily dose frequency out of range flag=1 perform max daily dose check
. I $G(HASH(I,"orderNumber"))]"",$P($G(PSSDBCAR($G(HASH(I,"orderNumber")))),"^",29) D
. . S PSSFSCO=HASH(I,"orderNumber"),PSSFSCB=BASE,PSSFSCN=HASH(I,"drugName"),PSSFSCI=HASH(I,"ien") D MAXD^PSSDSUTA(PSSFSCO,PSSFSCB,PSSFSCN,PSSFSCI,.PSSDBCAR)
. QUIT
;
QUIT
;;
CSTMFREQ(HASH,I,NODE,IEN) ;; build customized frequency message
N MSG,LOW,LOWI,LOWS,LOWR,LOWSWAP,HIGH,HIGHI,HIGHS,HIGHR,HIGHSWAP
Q:$D(@NODE@("FREQ","FREQUENCYCUSTOMMESSAGE",IEN))
S (LOWS,HIGHS)=0
S MSG="Recommended frequency of "_$G(HASH(I,"drugName"))
S LOW=$G(HASH(I,"frequencyLow"))
S:+$P(LOW,".",2)=0 LOW=$P(LOW,".")
S HIGH=$G(HASH(I,"frequencyHigh"))
S:+$P(HIGH,".",2)=0 HIGH=$P(HIGH,".")
I (LOW="")!(HIGH="")!(+LOW=0)!(+HIGH=0)!(+LOW<0)!(+HIGH<0) S @NODE@("FREQ","FREQUENCYCUSTOMMESSAGE",IEN)=MSG_" is unavailable." Q
D:LOW<1
.S LOWI=+$P(1/LOW,".",1)
.S LOWR=$E(+$P(1/LOW,".",2),1)
.S LOWR=$S(LOWR>4:1,1:0)
.S LOW=LOWI+LOWR
.S LOWS=1
D:HIGH<1
.S HIGHI=+$P(1/HIGH,".",1)
.S HIGHR=$E(+$P(1/HIGH,".",2),1)
.S HIGHR=$S(HIGHR>4:1,1:0)
.S HIGH=HIGHI+HIGHR
.S HIGHS=1
D:(HIGH<LOW)&(LOWS=1)&(HIGHS=1)
.S HIGHSWAP=HIGH
.S LOWSWAP=LOW
.S LOW=HIGHSWAP
.S HIGH=LOWSWAP
I HIGH=LOW D
.I HIGHS=0 S MSG=MSG_" is "_HIGH_" time(s) per day."
.E S MSG=MSG_" is every "_HIGH_" days."
.Q
I HIGH'=LOW D
.I LOWS+HIGHS=0 S MSG=MSG_" is "_LOW_" to "_HIGH_" times per day." Q
.I (LOWS=1)&(HIGHS=0) D Q
..S:LOW'=1 MSG=MSG_" is every "_LOW_" day(s) to "_HIGH_" time(s) per day."
..S:LOW=1 MSG=MSG_" is "_LOW_" to "_HIGH_" time(s) per day."
.S MSG=MSG_" is every "_LOW_" day(s) to "_HIGH_" days."
.Q
S @NODE@("FREQ","FREQUENCYCUSTOMMESSAGE",IEN)=MSG
Q
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSSHRQ24 8279 printed Dec 13, 2024@02:31:57 Page 2
PSSHRQ24 ;WOIFO/AV,TS,SG,CF - Parses out drugsNotChecked and DrugDoseCheck XML (cont) ;09/20/07
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**178,206,224**;9/30/97;Build 3
+2 ;
+3 ; @authors - Alex Vazquez, Tim Sabat, Steve Gordon, Chris Flegel
+4 ; @date - June 23, 2014
+5 ; @version - 1.0
+6 ;
+7 QUIT
+8 ;
DOSEWRIT(HASH,BASE) ;
+1 ; @DESC Handles writing the drug dose output global
+2 ;
+3 ; @HASH Variable containing drug dose values
+4 ; @BASE Base of output global
+5 ;
+6 ; @RETURNS Nothing
+7 ;
+8 NEW I,NODE,QT,IEN,PSSFSCO,PSSFSCB,PSSFSCN,PSSFSCI
+9 ;get dose form flag
+10 ;
+11 SET QT=""""
+12 SET I=""
+13 FOR
SET I=$ORDER(HASH(I))
if I=""!('I)
QUIT
Begin DoDot:1
+14 SET NODE="^TMP($JOB,BASE,""OUT"",""DOSE"",HASH(I,""orderNumber""),HASH(I,""drugName""))"
+15 SET IEN=HASH(I,"ien")
+16 ;
+17 ; Single values
+18 IF $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseStatus")
SET @NODE@("SINGLE","STATUS",IEN)=HASH(I,"singleDoseStatus")
+19 IF $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseStatusCode")
SET @NODE@("SINGLE","STATUSCODE",IEN)=HASH(I,"singleDoseStatusCode")
+20 IF $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseMessage")
SET @NODE@("SINGLE","MESSAGE",IEN)=HASH(I,"singleDoseMessage")
+21 IF $$CHKVAL^PSSHRQ23(.HASH,I,"singleDoseMax")
SET @NODE@("SINGLE","MAX",IEN)=HASH(I,"singleDoseMax")
+22 ; Range values
+23 IF $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseLow")
SET @NODE@("RANGE","LOW",IEN)=HASH(I,"rangeDoseLow")
+24 IF $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseHigh")
SET @NODE@("RANGE","HIGH",IEN)=HASH(I,"rangeDoseHigh")
+25 IF $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseStatus")
SET @NODE@("RANGE","STATUS",IEN)=HASH(I,"rangeDoseStatus")
+26 IF $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseStatusCode")
SET @NODE@("RANGE","STATUSCODE",IEN)=HASH(I,"rangeDoseStatusCode")
+27 IF $$CHKVAL^PSSHRQ23(.HASH,I,"rangeDoseMessage")
SET @NODE@("RANGE","MESSAGE",IEN)=HASH(I,"rangeDoseMessage")
+28 ;set general dose form data
+29 IF $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormHigh")
SET @NODE@("GENERAL","DOSEFORMHIGH",IEN)=HASH(I,"doseFormHigh")
+30 IF $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormHighUnit")
SET @NODE@("GENERAL","DOSEFORMHIGHUNIT",IEN)=HASH(I,"doseFormHighUnit")
+31 IF $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormLow")
SET @NODE@("GENERAL","DOSEFORMLOW",IEN)=HASH(I,"doseFormLow")
+32 IF $$CHKVAL^PSSHRQ23(.HASH,I,"doseFormLowUnit")
SET @NODE@("GENERAL","DOSEFORMLOWUNIT",IEN)=HASH(I,"doseFormLowUnit")
+33 ; General subscript values
+34 SET @NODE@("GENERAL","DOSEHIGH",IEN)=HASH(I,"doseHigh")
+35 SET @NODE@("GENERAL","DOSEHIGHUNIT",IEN)=HASH(I,"doseHighUnit")
+36 SET @NODE@("GENERAL","DOSELOW",IEN)=HASH(I,"doseLow")
+37 SET @NODE@("GENERAL","DOSELOWUNIT",IEN)=HASH(I,"doseLowUnit")
+38 SET @NODE@("GENERAL","DOSEROUTEDESCRIPTION",IEN)=HASH(I,"doseRouteDescription")
+39 SET @NODE@("GENERAL","MESSAGE",IEN)=$$BUILDMSG^PSSHRQ25(I,.HASH)
+40 ; "CHEMO" value, if any
+41 IF $$CHKVAL^PSSHRQ23(.HASH,I,"chemoInjectable")
SET @NODE@("CHEMO")=HASH(I,"chemoInjectable")
+42 ; Daily values
+43 IF $$CHKVAL^PSSHRQ23(.HASH,I,"dailyDoseStatus")
SET @NODE@("DAILY","STATUS",IEN)=HASH(I,"dailyDoseStatus")
+44 IF $$CHKVAL^PSSHRQ23(.HASH,I,"dailyDoseStatusCode")
SET @NODE@("DAILY","STATUSCODE",IEN)=HASH(I,"dailyDoseStatusCode")
+45 IF $$CHKVAL^PSSHRQ23(.HASH,I,"dailyDoseMessage")
SET @NODE@("DAILY","MESSAGE",IEN)=HASH(I,"dailyDoseMessage")
+46 ; Max Daily values
+47 IF $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseStatus")
SET @NODE@("DAILYMAX","STATUS",IEN)=HASH(I,"maxDailyDoseStatus")
+48 IF $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseStatusCode")
SET @NODE@("DAILYMAX","STATUSCODE",IEN)=HASH(I,"maxDailyDoseStatusCode")
+49 IF $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseMessage")
SET @NODE@("DAILYMAX","MESSAGE",IEN)=HASH(I,"maxDailyDoseMessage")
+50 ; general maximum life time dose
+51 IF $$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeDose")
SET @NODE@("MAXLIFETIME","DOSE",IEN)=HASH(I,"maxLifetimeDose")
+52 ; Frequency values, if any
+53 IF $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyStatus")
SET @NODE@("FREQ","FREQUENCYSTATUS",IEN)=HASH(I,"frequencyStatus")
+54 IF $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyStatusCode")
SET @NODE@("FREQ","FREQUENCYSTATUSCODE",IEN)=HASH(I,"frequencyStatusCode")
+55 IF $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyMessage")
SET @NODE@("FREQ","FREQUENCYMESSAGE",IEN)=HASH(I,"frequencyMessage")
+56 IF $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyHigh")
SET @NODE@("FREQ","FREQUENCYHIGH",IEN)=HASH(I,"frequencyHigh")
DO CSTMFREQ(.HASH,I,NODE,IEN)
+57 IF $$CHKVAL^PSSHRQ23(.HASH,I,"frequencyLow")
SET @NODE@("FREQ","FREQUENCYLOW",IEN)=HASH(I,"frequencyLow")
DO CSTMFREQ(.HASH,I,NODE,IEN)
+58 ; dose percent elements
+59 if $DATA(HASH(I,"single"))=10
DO WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"single","","")
+60 if $DATA(HASH(I,"rangeLow"))=10
DO WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"rangeLow","","")
+61 if $DATA(HASH(I,"rangeHigh"))=10
DO WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"rangeHigh","","")
+62 if $DATA(HASH(I,"daily"))=10
DO WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"daily","","")
+63 if $DATA(HASH(I,"maxDaily"))=10
DO WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"maxDaily","DAILYMAX","")
+64 if $DATA(HASH(I,"maxLifetime"))=10
DO WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"maxLifetime","","")
+65 if $DATA(HASH(I,"maxLifetimeOrder"))=10
DO WRITEDSP^PSSHRQ2D(NODE,.HASH,I,IEN,"maxLifetimeOrder","","")
+66 ;;
+67 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeOrderMessage")
SET @NODE@("MAXLIFETIMEORDER","MESSAGE",IEN)=HASH(I,"maxLifetimeOrderMessage")
+68 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeOrderStatus")
SET @NODE@("MAXLIFETIMEORDER","STATUS",IEN)=HASH(I,"maxLifetimeOrderStatus")
+69 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxLifetimeOrderStatusCode")
SET @NODE@("MAXLIFETIMEORDER","STATUSCODE",IEN)=HASH(I,"maxLifetimeOrderStatusCode")
+70 ;;
+71 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDose")
SET @NODE@("MAXSINGLENTE","DOSE",IEN)=HASH(I,"maxSingleNTEDose")
+72 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDoseUnit")
SET @NODE@("MAXSINGLENTE","DOSEUNIT",IEN)=HASH(I,"maxSingleNTEDoseUnit")
+73 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDoseForm")
SET @NODE@("MAXSINGLENTE","DOSEFORM",IEN)=HASH(I,"maxSingleNTEDoseForm")
+74 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxSingleNTEDoseFormUnit")
SET @NODE@("MAXSINGLENTE","DOSEFORMUNIT",IEN)=HASH(I,"maxSingleNTEDoseFormUnit")
+75 ;;
+76 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDose")
SET @NODE@("DAILYMAX","DOSE",IEN)=HASH(I,"maxDailyDose")
+77 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseUnit")
SET @NODE@("DAILYMAX","DOSEUNIT",IEN)=HASH(I,"maxDailyDoseUnit")
+78 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseForm")
SET @NODE@("DAILYMAX","DOSEFORM",IEN)=HASH(I,"maxDailyDoseForm")
+79 if $$CHKVAL^PSSHRQ23(.HASH,I,"maxDailyDoseFormUnit")
SET @NODE@("DAILYMAX","DOSEFORMUNIT",IEN)=HASH(I,"maxDailyDoseFormUnit")
+80 ;;
+81 ;
+82 ; -- in 2.1 if max daily dose frequency out of range flag=1 perform max daily dose check
+83 IF $GET(HASH(I,"orderNumber"))]""
IF $PIECE($GET(PSSDBCAR($GET(HASH(I,"orderNumber")))),"^",29)
Begin DoDot:2
+84 SET PSSFSCO=HASH(I,"orderNumber")
SET PSSFSCB=BASE
SET PSSFSCN=HASH(I,"drugName")
SET PSSFSCI=HASH(I,"ien")
DO MAXD^PSSDSUTA(PSSFSCO,PSSFSCB,PSSFSCN,PSSFSCI,.PSSDBCAR)
End DoDot:2
+85 QUIT
End DoDot:1
+86 ;
+87 QUIT
+88 ;;
CSTMFREQ(HASH,I,NODE,IEN) ;; build customized frequency message
+1 NEW MSG,LOW,LOWI,LOWS,LOWR,LOWSWAP,HIGH,HIGHI,HIGHS,HIGHR,HIGHSWAP
+2 if $DATA(@NODE@("FREQ","FREQUENCYCUSTOMMESSAGE",IEN))
QUIT
+3 SET (LOWS,HIGHS)=0
+4 SET MSG="Recommended frequency of "_$GET(HASH(I,"drugName"))
+5 SET LOW=$GET(HASH(I,"frequencyLow"))
+6 if +$PIECE(LOW,".",2)=0
SET LOW=$PIECE(LOW,".")
+7 SET HIGH=$GET(HASH(I,"frequencyHigh"))
+8 if +$PIECE(HIGH,".",2)=0
SET HIGH=$PIECE(HIGH,".")
+9 IF (LOW="")!(HIGH="")!(+LOW=0)!(+HIGH=0)!(+LOW<0)!(+HIGH<0)
SET @NODE@("FREQ","FREQUENCYCUSTOMMESSAGE",IEN)=MSG_" is unavailable."
QUIT
+10 if LOW<1
Begin DoDot:1
+11 SET LOWI=+$PIECE(1/LOW,".",1)
+12 SET LOWR=$EXTRACT(+$PIECE(1/LOW,".",2),1)
+13 SET LOWR=$SELECT(LOWR>4:1,1:0)
+14 SET LOW=LOWI+LOWR
+15 SET LOWS=1
End DoDot:1
+16 if HIGH<1
Begin DoDot:1
+17 SET HIGHI=+$PIECE(1/HIGH,".",1)
+18 SET HIGHR=$EXTRACT(+$PIECE(1/HIGH,".",2),1)
+19 SET HIGHR=$SELECT(HIGHR>4:1,1:0)
+20 SET HIGH=HIGHI+HIGHR
+21 SET HIGHS=1
End DoDot:1
+22 if (HIGH<LOW)&(LOWS=1)&(HIGHS=1)
Begin DoDot:1
+23 SET HIGHSWAP=HIGH
+24 SET LOWSWAP=LOW
+25 SET LOW=HIGHSWAP
+26 SET HIGH=LOWSWAP
End DoDot:1
+27 IF HIGH=LOW
Begin DoDot:1
+28 IF HIGHS=0
SET MSG=MSG_" is "_HIGH_" time(s) per day."
+29 IF '$TEST
SET MSG=MSG_" is every "_HIGH_" days."
+30 QUIT
End DoDot:1
+31 IF HIGH'=LOW
Begin DoDot:1
+32 IF LOWS+HIGHS=0
SET MSG=MSG_" is "_LOW_" to "_HIGH_" times per day."
QUIT
+33 IF (LOWS=1)&(HIGHS=0)
Begin DoDot:2
+34 if LOW'=1
SET MSG=MSG_" is every "_LOW_" day(s) to "_HIGH_" time(s) per day."
+35 if LOW=1
SET MSG=MSG_" is "_LOW_" to "_HIGH_" time(s) per day."
End DoDot:2
QUIT
+36 SET MSG=MSG_" is every "_LOW_" day(s) to "_HIGH_" days."
+37 QUIT
End DoDot:1
+38 SET @NODE@("FREQ","FREQUENCYCUSTOMMESSAGE",IEN)=MSG
+39 QUIT
+40 ;;