BGPMUH11 ;IHS/MSC/MGH - MI measure NQF0372-VTE-2 ;02-Mar-2011 15:59;DU
;;11.0;IHS CLINICAL REPORTING;**4**;JAN 06, 2011;Build 84
;ED meaningful use hospital measures
;BGPMUH10 - VTE Measure 1 - VTE started in 24hrs of arrival
;BGPMUH11 - VTE Measure 2 - VTE started in 24hrs of arrival to ICU
ENTRY ;PEP Vte measure 2 - VTE started in 24hrs of arrival to ICU
; Print routine - VTE2^BGPMUHP6
; Delimited output - VTE2^BGPMUHD5
N START,END,BGPIEN,DFN,BGPVST,BGPISDX,BGPHSDX,BGPAGEE,BGPIPROB,BGPHPROB,SECOND,EXC,NUM,BGPDIS
N BGPER,BGPADTMI,BDPDD,BGWARD,BGPDD,BGPADMIT,BGPDD
S BGWARD=0
;Start by finding all admissions during the reporting period
S START=BGPBDATE
S END=BGPEDATE_".2359"
F S START=$O(^DGPM("B",START)) Q:START=""!(START>END) D
.S BGPIEN="" F S BGPIEN=$O(^DGPM("B",START,BGPIEN)) Q:BGPIEN="" D
..Q:$P($G(^DGPM(BGPIEN,0)),U,2)'=1 ;Only include admissions
..S DFN=$P($G(^DGPM(BGPIEN,0)),U,3)
..Q:DFN=""
..S BGPACTUP=$$ACTUPAP^BGPMUEHD(DFN,BGPBDATE,BGPEDATE,BGPBEN)
..I 'BGPACTUP,'$G(BGPXPXPX),'$G(BGPIISO) Q
..S BGPVST=$P($G(^DGPM(BGPIEN,0)),U,27) ;Get the visit
..Q:BGPVST=""
..S BGPDIS=$P($G(^DGPM(BGPIEN,0)),U,17) ;Don't use if pt is still an inpt
..Q:BGPDIS=""
..;Get the admit time & discharge times
..S BGPADMIT=$P($G(^DGPM(BGPIEN,0)),U,1)
..S BGPDD=$P($G(^DGPM(BGPDIS,0)),U,1)
..;get age at admission
..S BGPAGEE=$$AGE^AUPNPAT(DFN,$P(BGPADMIT,".",1))
..;Check for ICU
..S BGPWARD=$$ICUADM^BGPMUH10(DFN,BGPIEN,BGPADMIT,BGPDIS)
..Q:'BGPWARD
..S EXC=$$EXCLUDE(DFN,BGPIEN,BGPVST,BGPDIS,.BGWARD)
..;If no exclusions see if they had tPA given in correct time frame
..I EXC="" S NUM=$$NUMER(DFN,BGPADMIT,BGWARD,BGPVST)
..;Now add it all up
..D TOTAL(BGPIEN)
Q
TOTAL(BGPIEN) ;add up the totals
N PTCNT,EXCCT,DENCT,NUMCT,TOTALS,DATE,NOTCT
S TOTALS=$G(^TMP("BGPMU0372",$J,BGPMUTF,"TOT"))
S DENCT=+$G(^TMP("BGPMU0372",$J,BGPMUTF,"DEN"))
S NUMCT=+$G(^TMP("BGPMU0372",$J,BGPMUTF,"NUM"))
S EXCCT=+$G(^TMP("BGPMU0372",$J,BGPMUTF,"EXC"))
S NOTCT=+$G(^TMP("BGPMU0372",$J,BGPMUTF,"NOT"))
S PTCNT=TOTALS
S PTCNT=PTCNT+1
S DATE=$$DATE^BGPMUUTL($P($G(^DGPM(BGPIEN,0)),U,1))
S DENCT=DENCT+1 S ^TMP("BGPMU0372",$J,BGPMUTF,"DEN")=DENCT
I EXC'="" D
.S EXCCT=EXCCT+1 S ^TMP("BGPMU0372",$J,BGPMUTF,"EXC")=EXCCT
.I BGPMUTF="C" S ^TMP("BGPMU0372",$J,"PAT",BGPMUTF,"EXC",PTCNT)=DFN_U_DATE_U_$P(EXC,U,2)
I EXC="" D
.I +NUM=1 D
..S NUMCT=NUMCT+1 S ^TMP("BGPMU0372",$J,BGPMUTF,"NUM")=NUMCT
..S ^TMP("BGPMU0372",$J,"PAT",BGPMUTF,"NUM",PTCNT)=DFN_U_DATE_U_$P(NUM,U,3)_U_$P(NUM,U,2)
.I +NUM=0 D
..S ^TMP("BGPMU0372",$J,"PAT",BGPMUTF,"NOT",PTCNT)=DFN_U_DATE_U_$P(NUM,U,3)_U_$P(NUM,U,2)
..S NOTCT=NOTCT+1 S ^TMP("BGPMU0372",$J,BGPMUTF,"NOT")=NOTCT
S ^TMP("BGPMU0372",$J,BGPMUTF,"TOT")=PTCNT
S BGPICARE("MU.VTE.0372.1",BGPMUTF,DFN)=1_U_+$G(NUM)_U_+EXC_U_DATE_";"_$P($G(NUM),U,3)_";"_$P(EXC,U,2)
Q
EXCLUDE(DFN,BGPIEN,BGPVST,BGPDIS,BGWARD) ;See if there are exclusions
N REASON,BGPLOS,BGPHOS,BGPCLIN,BGPECI,BGPALL,BGPREF,BGPTS,BGPVTE
S REASON=""
I BGPAGEE<18 S REASON="1^AGE" Q REASON
;Check for LOS
S BGPLOS=$$LOS^BGPMUH08(BGPIEN,BGPDIS)
I BGPLOS>120 S REASON="1^LOS" Q REASON
I BGPLOS<2 S REASON="1^LOS" Q REASON
;Check for OB
S BGPTS=$$TS(DFN,BGPIEN,BGPDIS)
I +BGPTS S REASON=BGPTS Q REASON
;Check for palliative Care
S BGPHOS=$$HOSPICE^BGPMUH06(DFN,BGPVST,BGPADMIT)
I +BGPHOS S REASON=BGPHOS Q REASON
;Check for clinical trial
S BGPCLIN=$$TRIAL^BGPMUH08(DFN,BGPVST)
I +BGPCLIN S REASON=BGPCLIN Q REASON
;Check for a diagnosis of VTE
S BGPVTE=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE DX")
I +BGPVTE S REASON=BGPVTE Q REASON
Q REASON
NUMER(DFN,ADMIT,BGWARD,VST) ;Check to see if pt is in the numerator
N TAX,MEDDTE,ENDDT,VTE,MEDIEN,STATUS,DRUG,DISPENSE
N TEDS,FIRST,GIVEN,NOTGIV,PROP,PHARM,PHARMP,MECH,MECHP,CPT,MED,ICD0
S VTE=0
;First, see if the pt has CPT for procedure in first 24hrs
S FIRST=$$FMADD^XLFDT(ADMIT,+1)
S TEDS=$$PALCPT^BGPMUUT3(DFN,VST,"BGPMU VTE DEVICES CPT",ADMIT)
I +TEDS S VTE=TEDS_U_BGPDD Q VTE
;See, if the pt has ICD0 for procedures in first 24hrs
S PROP=$$PALICD0^BGPMUUT3(DFN,VST,"BGP VTE DEVICES ICD0",ADMIT)
I +PROP S VTE=PROP_U_BGPDD Q VTE
;See if the VTE CPT code was entered
S GIVEN=$$PALCPT^BGPMUUT3(DFN,VST,"BGPMU VTE GIVEN CPT",ADMIT)
I +GIVEN S VTE=GIVEN_U_BGPDD Q VTE
;Check for code that patient is not eligible
S NOTGIV=$$PALCPT^BGPMUUT3(DFN,VST,"BGPMU VTE NOT GIVEN CPT",ADMIT)
I +NOTGIV S VTE=$P(NOTGIV,U,1)_U_"NMI "_$P(NOTGIV,U,2)_U_BGPDD Q VTE
;Check diagnoses for whom VTE is not appropriate
S PHARM=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE EXCLUDE PHARM DXS")
I +PHARM S VTE=$P(PHARM,U,1)_U_"NMI "_$P(PHARM,U,2)_U_BGPDD Q VTE
S PHARMP=$$PLTAX^BGPMUUT1(DFN,"BGPMU VTE EXCLUDE PHARM DXS")
I +PHARMP S VTE=$P(PHARMP,U,1)_U_"NMI "_$P(PHARMP,U,2)_U_BGPDD Q VTE
S MECH=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE EXCLUDE-MECH DX")
I +MECH S VTE=$P(MECH,U,1)_U_"NMI "_$P(MECH,U,2)_U_BGPDD Q VTE
S MECHP=$$PLTAX^BGPMUUT1(DFN,"BGPMU VTE EXCLUDE-MECH DX")
I +MECHP S VTE=$P(MECHP,U,1)_U_"NMI "_$P(MECHP,U,2)_U_BGPDD Q VTE
;Check for refusal of VTE med
S MED=$$MEDREF^BGPMUUT2(DFN,$P(ADMIT,"."),$P(FIRST,".")_".2359","BGPMU VTE PROPHYLAXIS")
I +MED S VTE=$P(MED,U,1)_U_"REF "_$P(MED,U,2)_U_BGPDD Q VTE
;Check for refusals of procedures
S CPT=$$REFTAX^BGPMUUT2(DFN,81,"BGPMU VTE DEVICES CPT",$P(ADMIT,"."),$P(FIRST,"."))
I +CPT S VTE=$P(CPT,U,1)_U_"REF "_$P(CPT,U,2)_U_BGPDD Q VTE
S ICD0=$$REFTAX^BGPMUUT2(DFN,80.1,"BGPMU VTE DEVICES ICD0",$P(ADMIT,"."),$P(FIRST,"."))
I +ICD0 S VTE=$P(ICD0,U,1)_U_"REF "_$P(ICD0,U,2)_U_BGPDD Q VTE
;Finally check for a BMCA code for antithrombotics
S MEDDTE=ADMIT
F S MEDDTE=$O(^PSB(53.79,"AADT",DFN,MEDDTE)) Q:'+MEDDTE!(MEDDTE>FIRST)!(+VTE) D
.S MEDIEN="" F S MEDIEN=$O(^PSB(53.79,"AADT",DFN,MEDDTE,MEDIEN)) Q:'+MEDIEN!(+VTE) D
..S STATUS=$P($G(^PSB(53.79,MEDIEN,0)),U,9)
..I STATUS="G"!(STATUS="I")!(STATUS="C") D ;Drug given
...S DISPENSE=0 F S DISPENSE=$O(^PSB(53.79,MEDIEN,.5,DISPENSE)) Q:'+DISPENSE!(+VTE) D
....S DRUG=$G(^PSB(53.79,MEDIEN,.5,DISPENSE,0))
....S DRUG=$P(DRUG,U,1)
....S TAX="BGPMU VTE PROPHYLAXIS"
....S VTE=$$NDC^BGPMUUT4(DRUG,TAX)
....I +VTE S VTE=$P(VTE,U,1)_U_"MED "_$P(VTE,U,2)_U_BGPDD
I VTE=0&(BGWARD=1) S EXC="1^ICULOS"
Q VTE
TS(DFN,BGPIEN,BGPDIS) ;Check the treating specialty
N IEN,TYPE,OBDX,TS
S IEN=BGPIEN,TS=0
S OBDX=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE OB DXS")
I +OBDX S TS=OBDX
Q TS
BGPMUH11 ;IHS/MSC/MGH - MI measure NQF0372-VTE-2 ;02-Mar-2011 15:59;DU
+1 ;;11.0;IHS CLINICAL REPORTING;**4**;JAN 06, 2011;Build 84
+2 ;ED meaningful use hospital measures
+3 ;BGPMUH10 - VTE Measure 1 - VTE started in 24hrs of arrival
+4 ;BGPMUH11 - VTE Measure 2 - VTE started in 24hrs of arrival to ICU
ENTRY ;PEP Vte measure 2 - VTE started in 24hrs of arrival to ICU
+1 ; Print routine - VTE2^BGPMUHP6
+2 ; Delimited output - VTE2^BGPMUHD5
+3 NEW START,END,BGPIEN,DFN,BGPVST,BGPISDX,BGPHSDX,BGPAGEE,BGPIPROB,BGPHPROB,SECOND,EXC,NUM,BGPDIS
+4 NEW BGPER,BGPADTMI,BDPDD,BGWARD,BGPDD,BGPADMIT,BGPDD
+5 SET BGWARD=0
+6 ;Start by finding all admissions during the reporting period
+7 SET START=BGPBDATE
+8 SET END=BGPEDATE_".2359"
+9 FOR
SET START=$ORDER(^DGPM("B",START))
IF START=""!(START>END)
QUIT
Begin DoDot:1
+10 SET BGPIEN=""
FOR
SET BGPIEN=$ORDER(^DGPM("B",START,BGPIEN))
IF BGPIEN=""
QUIT
Begin DoDot:2
+11 ;Only include admissions
IF $PIECE($GET(^DGPM(BGPIEN,0)),U,2)'=1
QUIT
+12 SET DFN=$PIECE($GET(^DGPM(BGPIEN,0)),U,3)
+13 IF DFN=""
QUIT
+14 SET BGPACTUP=$$ACTUPAP^BGPMUEHD(DFN,BGPBDATE,BGPEDATE,BGPBEN)
+15 IF 'BGPACTUP
IF '$GET(BGPXPXPX)
IF '$GET(BGPIISO)
QUIT
+16 ;Get the visit
SET BGPVST=$PIECE($GET(^DGPM(BGPIEN,0)),U,27)
+17 IF BGPVST=""
QUIT
+18 ;Don't use if pt is still an inpt
SET BGPDIS=$PIECE($GET(^DGPM(BGPIEN,0)),U,17)
+19 IF BGPDIS=""
QUIT
+20 ;Get the admit time & discharge times
+21 SET BGPADMIT=$PIECE($GET(^DGPM(BGPIEN,0)),U,1)
+22 SET BGPDD=$PIECE($GET(^DGPM(BGPDIS,0)),U,1)
+23 ;get age at admission
+24 SET BGPAGEE=$$AGE^AUPNPAT(DFN,$PIECE(BGPADMIT,".",1))
+25 ;Check for ICU
+26 SET BGPWARD=$$ICUADM^BGPMUH10(DFN,BGPIEN,BGPADMIT,BGPDIS)
+27 IF 'BGPWARD
QUIT
+28 SET EXC=$$EXCLUDE(DFN,BGPIEN,BGPVST,BGPDIS,.BGWARD)
+29 ;If no exclusions see if they had tPA given in correct time frame
+30 IF EXC=""
SET NUM=$$NUMER(DFN,BGPADMIT,BGWARD,BGPVST)
+31 ;Now add it all up
+32 DO TOTAL(BGPIEN)
End DoDot:2
End DoDot:1
+33 QUIT
TOTAL(BGPIEN) ;add up the totals
+1 NEW PTCNT,EXCCT,DENCT,NUMCT,TOTALS,DATE,NOTCT
+2 SET TOTALS=$GET(^TMP("BGPMU0372",$JOB,BGPMUTF,"TOT"))
+3 SET DENCT=+$GET(^TMP("BGPMU0372",$JOB,BGPMUTF,"DEN"))
+4 SET NUMCT=+$GET(^TMP("BGPMU0372",$JOB,BGPMUTF,"NUM"))
+5 SET EXCCT=+$GET(^TMP("BGPMU0372",$JOB,BGPMUTF,"EXC"))
+6 SET NOTCT=+$GET(^TMP("BGPMU0372",$JOB,BGPMUTF,"NOT"))
+7 SET PTCNT=TOTALS
+8 SET PTCNT=PTCNT+1
+9 SET DATE=$$DATE^BGPMUUTL($PIECE($GET(^DGPM(BGPIEN,0)),U,1))
+10 SET DENCT=DENCT+1
SET ^TMP("BGPMU0372",$JOB,BGPMUTF,"DEN")=DENCT
+11 IF EXC'=""
Begin DoDot:1
+12 SET EXCCT=EXCCT+1
SET ^TMP("BGPMU0372",$JOB,BGPMUTF,"EXC")=EXCCT
+13 IF BGPMUTF="C"
SET ^TMP("BGPMU0372",$JOB,"PAT",BGPMUTF,"EXC",PTCNT)=DFN_U_DATE_U_$PIECE(EXC,U,2)
End DoDot:1
+14 IF EXC=""
Begin DoDot:1
+15 IF +NUM=1
Begin DoDot:2
+16 SET NUMCT=NUMCT+1
SET ^TMP("BGPMU0372",$JOB,BGPMUTF,"NUM")=NUMCT
+17 SET ^TMP("BGPMU0372",$JOB,"PAT",BGPMUTF,"NUM",PTCNT)=DFN_U_DATE_U_$PIECE(NUM,U,3)_U_$PIECE(NUM,U,2)
End DoDot:2
+18 IF +NUM=0
Begin DoDot:2
+19 SET ^TMP("BGPMU0372",$JOB,"PAT",BGPMUTF,"NOT",PTCNT)=DFN_U_DATE_U_$PIECE(NUM,U,3)_U_$PIECE(NUM,U,2)
+20 SET NOTCT=NOTCT+1
SET ^TMP("BGPMU0372",$JOB,BGPMUTF,"NOT")=NOTCT
End DoDot:2
End DoDot:1
+21 SET ^TMP("BGPMU0372",$JOB,BGPMUTF,"TOT")=PTCNT
+22 SET BGPICARE("MU.VTE.0372.1",BGPMUTF,DFN)=1_U_+$GET(NUM)_U_+EXC_U_DATE_";"_$PIECE($GET(NUM),U,3)_";"_$PIECE(EXC,U,2)
+23 QUIT
EXCLUDE(DFN,BGPIEN,BGPVST,BGPDIS,BGWARD) ;See if there are exclusions
+1 NEW REASON,BGPLOS,BGPHOS,BGPCLIN,BGPECI,BGPALL,BGPREF,BGPTS,BGPVTE
+2 SET REASON=""
+3 IF BGPAGEE<18
SET REASON="1^AGE"
QUIT REASON
+4 ;Check for LOS
+5 SET BGPLOS=$$LOS^BGPMUH08(BGPIEN,BGPDIS)
+6 IF BGPLOS>120
SET REASON="1^LOS"
QUIT REASON
+7 IF BGPLOS<2
SET REASON="1^LOS"
QUIT REASON
+8 ;Check for OB
+9 SET BGPTS=$$TS(DFN,BGPIEN,BGPDIS)
+10 IF +BGPTS
SET REASON=BGPTS
QUIT REASON
+11 ;Check for palliative Care
+12 SET BGPHOS=$$HOSPICE^BGPMUH06(DFN,BGPVST,BGPADMIT)
+13 IF +BGPHOS
SET REASON=BGPHOS
QUIT REASON
+14 ;Check for clinical trial
+15 SET BGPCLIN=$$TRIAL^BGPMUH08(DFN,BGPVST)
+16 IF +BGPCLIN
SET REASON=BGPCLIN
QUIT REASON
+17 ;Check for a diagnosis of VTE
+18 SET BGPVTE=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE DX")
+19 IF +BGPVTE
SET REASON=BGPVTE
QUIT REASON
+20 QUIT REASON
NUMER(DFN,ADMIT,BGWARD,VST) ;Check to see if pt is in the numerator
+1 NEW TAX,MEDDTE,ENDDT,VTE,MEDIEN,STATUS,DRUG,DISPENSE
+2 NEW TEDS,FIRST,GIVEN,NOTGIV,PROP,PHARM,PHARMP,MECH,MECHP,CPT,MED,ICD0
+3 SET VTE=0
+4 ;First, see if the pt has CPT for procedure in first 24hrs
+5 SET FIRST=$$FMADD^XLFDT(ADMIT,+1)
+6 SET TEDS=$$PALCPT^BGPMUUT3(DFN,VST,"BGPMU VTE DEVICES CPT",ADMIT)
+7 IF +TEDS
SET VTE=TEDS_U_BGPDD
QUIT VTE
+8 ;See, if the pt has ICD0 for procedures in first 24hrs
+9 SET PROP=$$PALICD0^BGPMUUT3(DFN,VST,"BGP VTE DEVICES ICD0",ADMIT)
+10 IF +PROP
SET VTE=PROP_U_BGPDD
QUIT VTE
+11 ;See if the VTE CPT code was entered
+12 SET GIVEN=$$PALCPT^BGPMUUT3(DFN,VST,"BGPMU VTE GIVEN CPT",ADMIT)
+13 IF +GIVEN
SET VTE=GIVEN_U_BGPDD
QUIT VTE
+14 ;Check for code that patient is not eligible
+15 SET NOTGIV=$$PALCPT^BGPMUUT3(DFN,VST,"BGPMU VTE NOT GIVEN CPT",ADMIT)
+16 IF +NOTGIV
SET VTE=$PIECE(NOTGIV,U,1)_U_"NMI "_$PIECE(NOTGIV,U,2)_U_BGPDD
QUIT VTE
+17 ;Check diagnoses for whom VTE is not appropriate
+18 SET PHARM=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE EXCLUDE PHARM DXS")
+19 IF +PHARM
SET VTE=$PIECE(PHARM,U,1)_U_"NMI "_$PIECE(PHARM,U,2)_U_BGPDD
QUIT VTE
+20 SET PHARMP=$$PLTAX^BGPMUUT1(DFN,"BGPMU VTE EXCLUDE PHARM DXS")
+21 IF +PHARMP
SET VTE=$PIECE(PHARMP,U,1)_U_"NMI "_$PIECE(PHARMP,U,2)_U_BGPDD
QUIT VTE
+22 SET MECH=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE EXCLUDE-MECH DX")
+23 IF +MECH
SET VTE=$PIECE(MECH,U,1)_U_"NMI "_$PIECE(MECH,U,2)_U_BGPDD
QUIT VTE
+24 SET MECHP=$$PLTAX^BGPMUUT1(DFN,"BGPMU VTE EXCLUDE-MECH DX")
+25 IF +MECHP
SET VTE=$PIECE(MECHP,U,1)_U_"NMI "_$PIECE(MECHP,U,2)_U_BGPDD
QUIT VTE
+26 ;Check for refusal of VTE med
+27 SET MED=$$MEDREF^BGPMUUT2(DFN,$PIECE(ADMIT,"."),$PIECE(FIRST,".")_".2359","BGPMU VTE PROPHYLAXIS")
+28 IF +MED
SET VTE=$PIECE(MED,U,1)_U_"REF "_$PIECE(MED,U,2)_U_BGPDD
QUIT VTE
+29 ;Check for refusals of procedures
+30 SET CPT=$$REFTAX^BGPMUUT2(DFN,81,"BGPMU VTE DEVICES CPT",$PIECE(ADMIT,"."),$PIECE(FIRST,"."))
+31 IF +CPT
SET VTE=$PIECE(CPT,U,1)_U_"REF "_$PIECE(CPT,U,2)_U_BGPDD
QUIT VTE
+32 SET ICD0=$$REFTAX^BGPMUUT2(DFN,80.1,"BGPMU VTE DEVICES ICD0",$PIECE(ADMIT,"."),$PIECE(FIRST,"."))
+33 IF +ICD0
SET VTE=$PIECE(ICD0,U,1)_U_"REF "_$PIECE(ICD0,U,2)_U_BGPDD
QUIT VTE
+34 ;Finally check for a BMCA code for antithrombotics
+35 SET MEDDTE=ADMIT
+36 FOR
SET MEDDTE=$ORDER(^PSB(53.79,"AADT",DFN,MEDDTE))
IF '+MEDDTE!(MEDDTE>FIRST)!(+VTE)
QUIT
Begin DoDot:1
+37 SET MEDIEN=""
FOR
SET MEDIEN=$ORDER(^PSB(53.79,"AADT",DFN,MEDDTE,MEDIEN))
IF '+MEDIEN!(+VTE)
QUIT
Begin DoDot:2
+38 SET STATUS=$PIECE($GET(^PSB(53.79,MEDIEN,0)),U,9)
+39 ;Drug given
IF STATUS="G"!(STATUS="I")!(STATUS="C")
Begin DoDot:3
+40 SET DISPENSE=0
FOR
SET DISPENSE=$ORDER(^PSB(53.79,MEDIEN,.5,DISPENSE))
IF '+DISPENSE!(+VTE)
QUIT
Begin DoDot:4
+41 SET DRUG=$GET(^PSB(53.79,MEDIEN,.5,DISPENSE,0))
+42 SET DRUG=$PIECE(DRUG,U,1)
+43 SET TAX="BGPMU VTE PROPHYLAXIS"
+44 SET VTE=$$NDC^BGPMUUT4(DRUG,TAX)
+45 IF +VTE
SET VTE=$PIECE(VTE,U,1)_U_"MED "_$PIECE(VTE,U,2)_U_BGPDD
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+46 IF VTE=0&(BGWARD=1)
SET EXC="1^ICULOS"
+47 QUIT VTE
TS(DFN,BGPIEN,BGPDIS) ;Check the treating specialty
+1 NEW IEN,TYPE,OBDX,TS
+2 SET IEN=BGPIEN
SET TS=0
+3 SET OBDX=$$VSTPOV^BGPMUUT3(DFN,BGPVST,"BGPMU VTE OB DXS")
+4 IF +OBDX
SET TS=OBDX
+5 QUIT TS