PSBVITFL ;BIRMINGHAM/TEJ - BCMA VITAL MEASUREMENT FILER ;8/31/10 11:03am
;;3.0;BAR CODE MED ADMIN;**31,42**;Mar 2004;Build 62
; Per VHA Directive 2004-038, this routine should not be modified.
;
; Reference/IA
; STORE^GMRVPCE0/1589
; 44/908
; 42/10039
;
;
; Description:
; This routine is to service BCMA 3.0 functionality and store VITALs'
; data into the VA's VITAL MEASUREMENT FILE - ^GMR(120.5 using the
; API GMRVPCE0 or can store VITALs' data into the IHS (Indian Health
; Services PCC V MEASUREMENT file. Determination for which file is
; based on the Agency code DUZ("AG") equal "V" or "I" & the Vitals
; package flag at IHS is set to 1 for PCC V file.
;
; Parameters:
; Input - DFN (r) Pointer to the PATIENT (#2) file
; RATE (r) BCMA trigger event/transaction
; VTYPE (o) Pointer to GMRV VITAL TYPE FILE (#120.51)
; (default = Pain ["PN"])
; DTTKN (o) Date/time (FileMan) measurement was taken
; (default = $$NOW^XLFDT())
;
; Output - RESULTS(0) = 1
; RESULTS(1) ="1^*** comment ***"
; or RESULTS(1) ="-1^ERROR * Pain Score NOT filed
; successfully"
;
; Process results in the storing of VITAL Measurement rate into the VITAL
; MEASUREMENT FILE per the given patient and vital type.
;
RPC(RESULTS,PSBDFN,PSBRATE,PSBVTYPE,PSBDTTKN) ;
;
; Set up the input array for the API
;
;PSB*3*31 Quit if patient has been discharged.
K VADM,VAIN
N DFN,VA S DFN=$G(PSBDFN),VAIP("D")=""
D DEM^VADPT,IN5^VADPT
S RESULTS(0)=1,RESULTS(1)="-1^ERROR * "_$S($G(PSBVTYPE)']""!($G(PSBVTYPE)="PN"):"Pain Score",1:"Vital Measurement")_" NOT filed successfully."
I 'VAIP(13)&('VADM(6)) S RESULTS(1)=RESULTS(1)_" Patient has been DISCHARGED." Q
S:$G(PSBVTYPE)']"" PSBVTYPE="PN"
S:$G(PSBDTTKN)']"" PSBDTTKN=$$NOW^XLFDT()
S PSBHLOC=^DIC(42,+$G(VAIP(5)),44)
;
;Store Vitals info into either the VA Vitals package or the IHS PCC
; V measurement package, based on agency variable and Vitals package ; flag setting=1 for PCC V Measurement
;
N VTYP,PCC,XREF,VSIT,VDAT
I $G(DUZ("AG"))="I",$$GET^XPAR("ALL","BEHOVM USE VMSR") D
.S XREF("T")="TMP",XREF("P")="PU",XREF("BP")="BP",XREF("R")="RS",XREF("PN")="PA"
.S VTYP=+$$FIND1^DIC(9999999.07,"","BX",$$UP^XLFSTR($G(XREF(PSBVTYPE))))
.Q:'VTYP
.S VSIT=$P($G(^DGPM(+$G(VAIP(13)),0)),U,27)
.S VDAT=$P($G(^AUPNVSIT(+VSIT,0)),U)
.S PCC(1)="HDR^^^"_PSBHLOC_";"_$S(VDAT:VDAT,1:PSBDTTKN)_";H;"_VSIT
.S PCC(2)="VST^DT^"_$S(VDAT:VDAT,1:PSBDTTKN)
.S PCC(3)="VST^PT^"_PSBDFN
.S PCC(4)="VIT+^"_VTYP_"^0^^"_PSBRATE_"^^^"_PSBDTTKN
.D SAVE^BEHOENPC(.RESULTS,.PCC)
.S:'RESULTS RESULTS(1)="1^"_$S($G(PSBVTYPE)="PN":"Pain Score",1:PSBVTYPE)_" entered in Vitals via BCMA taken "_$$FMTE^XLFDT(PSBDTTKN,"Z5")
E D
.S GMRVDAT("ENCOUNTER")=U_PSBDFN_U_$G(PSBHLOC)
.S GMRVDAT("SOURCE")=U_$G(DUZ)
.S GMRVDAT("VITALS",$G(DUZ),1)=PSBVTYPE_U_$G(PSBRATE)_U_$G(PSBUNTS)_U_PSBDTTKN
.D STORE^GMRVPCE0(.GMRVDAT)
.I '$D(GMRVDAT("ERROR")) D NOW^%DTC,YX^%DTC S RESULTS(0)=1,RESULTS(1)="1^"_$S($G(PSBVTYPE)="PN":"Pain Score",1:PSBVTYPE)_" entered in Vitals via BCMA taken "_Y
Q
;
PSBVITFL ;BIRMINGHAM/TEJ - BCMA VITAL MEASUREMENT FILER ;8/31/10 11:03am
+1 ;;3.0;BAR CODE MED ADMIN;**31,42**;Mar 2004;Build 62
+2 ; Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ; Reference/IA
+5 ; STORE^GMRVPCE0/1589
+6 ; 44/908
+7 ; 42/10039
+8 ;
+9 ;
+10 ; Description:
+11 ; This routine is to service BCMA 3.0 functionality and store VITALs'
+12 ; data into the VA's VITAL MEASUREMENT FILE - ^GMR(120.5 using the
+13 ; API GMRVPCE0 or can store VITALs' data into the IHS (Indian Health
+14 ; Services PCC V MEASUREMENT file. Determination for which file is
+15 ; based on the Agency code DUZ("AG") equal "V" or "I" & the Vitals
+16 ; package flag at IHS is set to 1 for PCC V file.
+17 ;
+18 ; Parameters:
+19 ; Input - DFN (r) Pointer to the PATIENT (#2) file
+20 ; RATE (r) BCMA trigger event/transaction
+21 ; VTYPE (o) Pointer to GMRV VITAL TYPE FILE (#120.51)
+22 ; (default = Pain ["PN"])
+23 ; DTTKN (o) Date/time (FileMan) measurement was taken
+24 ; (default = $$NOW^XLFDT())
+25 ;
+26 ; Output - RESULTS(0) = 1
+27 ; RESULTS(1) ="1^*** comment ***"
+28 ; or RESULTS(1) ="-1^ERROR * Pain Score NOT filed
+29 ; successfully"
+30 ;
+31 ; Process results in the storing of VITAL Measurement rate into the VITAL
+32 ; MEASUREMENT FILE per the given patient and vital type.
+33 ;
RPC(RESULTS,PSBDFN,PSBRATE,PSBVTYPE,PSBDTTKN) ;
+1 ;
+2 ; Set up the input array for the API
+3 ;
+4 ;PSB*3*31 Quit if patient has been discharged.
+5 KILL VADM,VAIN
+6 NEW DFN,VA
SET DFN=$GET(PSBDFN)
SET VAIP("D")=""
+7 DO DEM^VADPT
DO IN5^VADPT
+8 SET RESULTS(0)=1
SET RESULTS(1)="-1^ERROR * "_$SELECT($GET(PSBVTYPE)']""!($GET(PSBVTYPE)="PN"):"Pain Score",1:"Vital Measurement")_" NOT filed successfully."
+9 IF 'VAIP(13)&('VADM(6))
SET RESULTS(1)=RESULTS(1)_" Patient has been DISCHARGED."
QUIT
+10 IF $GET(PSBVTYPE)']""
SET PSBVTYPE="PN"
+11 IF $GET(PSBDTTKN)']""
SET PSBDTTKN=$$NOW^XLFDT()
+12 SET PSBHLOC=^DIC(42,+$GET(VAIP(5)),44)
+13 ;
+14 ;Store Vitals info into either the VA Vitals package or the IHS PCC
+15 ; V measurement package, based on agency variable and Vitals package ; flag setting=1 for PCC V Measurement
+16 ;
+17 NEW VTYP,PCC,XREF,VSIT,VDAT
+18 IF $GET(DUZ("AG"))="I"
IF $$GET^XPAR("ALL","BEHOVM USE VMSR")
Begin DoDot:1
+19 SET XREF("T")="TMP"
SET XREF("P")="PU"
SET XREF("BP")="BP"
SET XREF("R")="RS"
SET XREF("PN")="PA"
+20 SET VTYP=+$$FIND1^DIC(9999999.07,"","BX",$$UP^XLFSTR($GET(XREF(PSBVTYPE))))
+21 IF 'VTYP
QUIT
+22 SET VSIT=$PIECE($GET(^DGPM(+$GET(VAIP(13)),0)),U,27)
+23 SET VDAT=$PIECE($GET(^AUPNVSIT(+VSIT,0)),U)
+24 SET PCC(1)="HDR^^^"_PSBHLOC_";"_$SELECT(VDAT:VDAT,1:PSBDTTKN)_";H;"_VSIT
+25 SET PCC(2)="VST^DT^"_$SELECT(VDAT:VDAT,1:PSBDTTKN)
+26 SET PCC(3)="VST^PT^"_PSBDFN
+27 SET PCC(4)="VIT+^"_VTYP_"^0^^"_PSBRATE_"^^^"_PSBDTTKN
+28 DO SAVE^BEHOENPC(.RESULTS,.PCC)
+29 IF 'RESULTS
SET RESULTS(1)="1^"_$SELECT($GET(PSBVTYPE)="PN":"Pain Score",1:PSBVTYPE)_" entered in Vitals via BCMA taken "_$$FMTE^XLFDT(PSBDTTKN,"Z5")
End DoDot:1
+30 IF '$TEST
Begin DoDot:1
+31 SET GMRVDAT("ENCOUNTER")=U_PSBDFN_U_$GET(PSBHLOC)
+32 SET GMRVDAT("SOURCE")=U_$GET(DUZ)
+33 SET GMRVDAT("VITALS",$GET(DUZ),1)=PSBVTYPE_U_$GET(PSBRATE)_U_$GET(PSBUNTS)_U_PSBDTTKN
+34 DO STORE^GMRVPCE0(.GMRVDAT)
+35 IF '$DATA(GMRVDAT("ERROR"))
DO NOW^%DTC
DO YX^%DTC
SET RESULTS(0)=1
SET RESULTS(1)="1^"_$SELECT($GET(PSBVTYPE)="PN":"Pain Score",1:PSBVTYPE)_" entered in Vitals via BCMA taken "_Y
End DoDot:1
+36 QUIT
+37 ;