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

PSBVITFL.m

Go to the documentation of this file.
  1. PSBVITFL ;BIRMINGHAM/TEJ - BCMA VITAL MEASUREMENT FILER ;7/25/12 11:57pm
  1. ;;3.0;BAR CODE MED ADMIN;**31,42,70**;Mar 2004;Build 101
  1. ; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ; Reference/IA
  1. ; STORE^GMRVPCE0/1589
  1. ; 44/908
  1. ; 42/10039
  1. ;
  1. ;*70 remove discharge test
  1. ;
  1. ; Description:
  1. ; This routine is to service BCMA 3.0 functionality and store VITALs'
  1. ; data into the VA's VITAL MEASUREMENT FILE - ^GMR(120.5 using the
  1. ; API GMRVPCE0 or can store VITALs' data into the IHS (Indian Health
  1. ; Services PCC V MEASUREMENT file. Determination for which file is
  1. ; based on the Agency code DUZ("AG") equal "V" or "I" & the Vitals
  1. ; package flag at IHS is set to 1 for PCC V file.
  1. ;
  1. ; Parameters:
  1. ; Input - DFN (r) Pointer to the PATIENT (#2) file
  1. ; RATE (r) BCMA trigger event/transaction
  1. ; VTYPE (o) Pointer to GMRV VITAL TYPE FILE (#120.51)
  1. ; (default = Pain ["PN"])
  1. ; DTTKN (o) Date/time (FileMan) measurement was taken
  1. ; (default = $$NOW^XLFDT())
  1. ;
  1. ; Output - RESULTS(0) = 1
  1. ; RESULTS(1) ="1^*** comment ***"
  1. ; or RESULTS(1) ="-1^ERROR * Pain Score NOT filed
  1. ; successfully"
  1. ;
  1. ; Process results in the storing of VITAL Measurement rate into the VITAL
  1. ; MEASUREMENT FILE per the given patient and vital type.
  1. ;
  1. RPC(RESULTS,PSBDFN,PSBRATE,PSBVTYPE,PSBDTTKN) ;
  1. ;
  1. ; Set up the input array for the API
  1. ;
  1. ;PSB*3*31 Quit if patient has been discharged.
  1. N VAIP,DFN S DFN=$G(PSBDFN) D IN5^VADPT
  1. ;*70 removed discharge code & test that was -here-
  1. S RESULTS(0)=1,RESULTS(1)="-1^ERROR * "_$S($G(PSBVTYPE)']""!($G(PSBVTYPE)="PN"):"Pain Score",1:"Vital Measurement")_" NOT filed successfully."
  1. S:$G(PSBVTYPE)']"" PSBVTYPE="PN"
  1. S:$G(PSBDTTKN)']"" PSBDTTKN=$$NOW^XLFDT()
  1. S:+$G(VAIP(5)) PSBHLOC=^DIC(42,+$G(VAIP(5)),44) ;*70 clinic, no Hosp
  1. ;
  1. ;Store Vitals info into either the VA Vitals package or the IHS PCC
  1. ; V measurement package, based on agency variable and Vitals package ; flag setting=1 for PCC V Measurement
  1. ;
  1. N VTYP,PCC,XREF,VSIT,VDAT
  1. I $G(DUZ("AG"))="I",$$GET^XPAR("ALL","BEHOVM USE VMSR") D
  1. .S XREF("T")="TMP",XREF("P")="PU",XREF("BP")="BP",XREF("R")="RS",XREF("PN")="PA"
  1. .S VTYP=+$$FIND1^DIC(9999999.07,"","BX",$$UP^XLFSTR($G(XREF(PSBVTYPE))))
  1. .Q:'VTYP
  1. .S VSIT=$P($G(^DGPM(+$G(VAIP(13)),0)),U,27)
  1. .S VDAT=$P($G(^AUPNVSIT(+VSIT,0)),U)
  1. .S PCC(1)="HDR^^^"_PSBHLOC_";"_$S(VDAT:VDAT,1:PSBDTTKN)_";H;"_VSIT
  1. .S PCC(2)="VST^DT^"_$S(VDAT:VDAT,1:PSBDTTKN)
  1. .S PCC(3)="VST^PT^"_PSBDFN
  1. .S PCC(4)="VIT+^"_VTYP_"^0^^"_PSBRATE_"^^^"_PSBDTTKN
  1. .D SAVE^BEHOENPC(.RESULTS,.PCC)
  1. .S:'RESULTS RESULTS(1)="1^"_$S($G(PSBVTYPE)="PN":"Pain Score",1:PSBVTYPE)_" entered in Vitals via BCMA taken "_$$FMTE^XLFDT(PSBDTTKN,"Z5")
  1. E D
  1. .S GMRVDAT("ENCOUNTER")=U_PSBDFN_U_$G(PSBHLOC)
  1. .S GMRVDAT("SOURCE")=U_$G(DUZ)
  1. .S GMRVDAT("VITALS",$G(DUZ),1)=PSBVTYPE_U_$G(PSBRATE)_U_$G(PSBUNTS)_U_PSBDTTKN
  1. .D STORE^GMRVPCE0(.GMRVDAT)
  1. .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
  1. Q
  1. ;