PSBPXFL ;BIR/RMS - BCMA TO PCE LINK FOR IMMUNIZATIONS ; 4/29/09 2:08pm
;;3.0;BAR CODE MED ADMIN;**47**;Mar 2004;Build 7
;Per VHA Directive 2004-038 (or future revisions regarding same), this routine should not be modified.
;
; Reference/IA
; $$DATA2PCE^PXAPI/1889
; $$PKG2IEN^VSIT/1904
;
BCMA2PCE(PSBDFN,PSBIMM,PSBDX,PSBDT,PSBWHO) ;
D CLEAN
D SETUP
Q:$G(PSBSTOP)
S PSBRSLT=$$DATA2PCE^PXAPI(PSBROOT,PSBPKG,PSBSRC)
W:$E(IOST)="C" !,"Result code: ",PSBRSLT
D CLEAN
Q
SETUP S PSBROOT="^TMP(""PSBXAPI"",$J)"
S PSBPKG=$$PKG2IEN^VSIT("PSB")
S PSBSRC="EXTERNAL API"
ENC S @PSBROOT@("ENCOUNTER",1,"ENC D/T")=$G(PSBDT,DT)
S @PSBROOT@("ENCOUNTER",1,"PATIENT")=PSBDFN
S @PSBROOT@("ENCOUNTER",1,"HOS LOC")=$$LOC Q:$G(PSBSTOP)
S @PSBROOT@("ENCOUNTER",1,"SERVICE CATEGORY")="E"
S @PSBROOT@("ENCOUNTER",1,"INSTITUTION")=+$$SITE^VASITE
S @PSBROOT@("ENCOUNTER",1,"ENCOUNTER TYPE")="P"
S @PSBROOT@("ENCOUNTER",1,"SC")=$$SC
PROV S @PSBROOT@("PROVIDER",1,"NAME")=PSBWHO
IMMUN S @PSBROOT@("IMMUNIZATION",1,"COMMENT")="@"
S @PSBROOT@("IMMUNIZATION",1,"CONTRAINDICATED")=0
S @PSBROOT@("IMMUNIZATION",1,"IMMUN")=PSBIMM
S @PSBROOT@("IMMUNIZATION",1,"REACTION")="@"
S @PSBROOT@("IMMUNIZATION",1,"SERIES")="@"
SC() ;SERVICE CONNECTED
N VAEL
S DFN=PSBDFN
D ELIG^VADPT
Q $S(+VAEL(3)=1:0,1:"")
LOC() ;HOSPITAL LOCATION
N DFN,VAIP
S DFN=PSBDFN
S VAIP("D")="L"
D IN5^VADPT
S PSBLOC=$G(^DIC(42,+VAIP(5),44))
S:PSBLOC']"" PSBSTOP=1
Q PSBLOC
;
CLEAN K ^TMP("PSBPXAPI",$J)
K PSBSTOP,PSBROOT,PSBPKG,PSBSRC,PSBRSLT,PSBLOC
Q
PSBPXFL ;BIR/RMS - BCMA TO PCE LINK FOR IMMUNIZATIONS ; 4/29/09 2:08pm
+1 ;;3.0;BAR CODE MED ADMIN;**47**;Mar 2004;Build 7
+2 ;Per VHA Directive 2004-038 (or future revisions regarding same), this routine should not be modified.
+3 ;
+4 ; Reference/IA
+5 ; $$DATA2PCE^PXAPI/1889
+6 ; $$PKG2IEN^VSIT/1904
+7 ;
BCMA2PCE(PSBDFN,PSBIMM,PSBDX,PSBDT,PSBWHO) ;
+1 DO CLEAN
+2 DO SETUP
+3 IF $GET(PSBSTOP)
QUIT
+4 SET PSBRSLT=$$DATA2PCE^PXAPI(PSBROOT,PSBPKG,PSBSRC)
+5 IF $EXTRACT(IOST)="C"
WRITE !,"Result code: ",PSBRSLT
+6 DO CLEAN
+7 QUIT
SETUP SET PSBROOT="^TMP(""PSBXAPI"",$J)"
+1 SET PSBPKG=$$PKG2IEN^VSIT("PSB")
+2 SET PSBSRC="EXTERNAL API"
ENC SET @PSBROOT@("ENCOUNTER",1,"ENC D/T")=$GET(PSBDT,DT)
+1 SET @PSBROOT@("ENCOUNTER",1,"PATIENT")=PSBDFN
+2 SET @PSBROOT@("ENCOUNTER",1,"HOS LOC")=$$LOC
IF $GET(PSBSTOP)
QUIT
+3 SET @PSBROOT@("ENCOUNTER",1,"SERVICE CATEGORY")="E"
+4 SET @PSBROOT@("ENCOUNTER",1,"INSTITUTION")=+$$SITE^VASITE
+5 SET @PSBROOT@("ENCOUNTER",1,"ENCOUNTER TYPE")="P"
+6 SET @PSBROOT@("ENCOUNTER",1,"SC")=$$SC
PROV SET @PSBROOT@("PROVIDER",1,"NAME")=PSBWHO
IMMUN SET @PSBROOT@("IMMUNIZATION",1,"COMMENT")="@"
+1 SET @PSBROOT@("IMMUNIZATION",1,"CONTRAINDICATED")=0
+2 SET @PSBROOT@("IMMUNIZATION",1,"IMMUN")=PSBIMM
+3 SET @PSBROOT@("IMMUNIZATION",1,"REACTION")="@"
+4 SET @PSBROOT@("IMMUNIZATION",1,"SERIES")="@"
SC() ;SERVICE CONNECTED
+1 NEW VAEL
+2 SET DFN=PSBDFN
+3 DO ELIG^VADPT
+4 QUIT $SELECT(+VAEL(3)=1:0,1:"")
LOC() ;HOSPITAL LOCATION
+1 NEW DFN,VAIP
+2 SET DFN=PSBDFN
+3 SET VAIP("D")="L"
+4 DO IN5^VADPT
+5 SET PSBLOC=$GET(^DIC(42,+VAIP(5),44))
+6 IF PSBLOC']""
SET PSBSTOP=1
+7 QUIT PSBLOC
+8 ;
CLEAN KILL ^TMP("PSBPXAPI",$JOB)
+1 KILL PSBSTOP,PSBROOT,PSBPKG,PSBSRC,PSBRSLT,PSBLOC
+2 QUIT