- PSBVITFL ;BIRMINGHAM/TEJ - BCMA VITAL MEASUREMENT FILER ;7/25/12 11:57pm
- ;;3.0;BAR CODE MED ADMIN;**31,42,70**;Mar 2004;Build 101
- ; Per VHA Directive 2004-038, this routine should not be modified.
- ;
- ; Reference/IA
- ; STORE^GMRVPCE0/1589
- ; 44/908
- ; 42/10039
- ;
- ;*70 remove discharge test
- ;
- ; 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.
- N VAIP,DFN S DFN=$G(PSBDFN) D IN5^VADPT
- ;*70 removed discharge code & test that was -here-
- S RESULTS(0)=1,RESULTS(1)="-1^ERROR * "_$S($G(PSBVTYPE)']""!($G(PSBVTYPE)="PN"):"Pain Score",1:"Vital Measurement")_" NOT filed successfully."
- S:$G(PSBVTYPE)']"" PSBVTYPE="PN"
- S:$G(PSBDTTKN)']"" PSBDTTKN=$$NOW^XLFDT()
- S:+$G(VAIP(5)) PSBHLOC=^DIC(42,+$G(VAIP(5)),44) ;*70 clinic, no Hosp
- ;
- ;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
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSBVITFL 3570 printed Feb 18, 2025@23:07:48 Page 2
- 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
- +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 ;*70 remove discharge test
- +10 ;
- +11 ; Description:
- +12 ; This routine is to service BCMA 3.0 functionality and store VITALs'
- +13 ; data into the VA's VITAL MEASUREMENT FILE - ^GMR(120.5 using the
- +14 ; API GMRVPCE0 or can store VITALs' data into the IHS (Indian Health
- +15 ; Services PCC V MEASUREMENT file. Determination for which file is
- +16 ; based on the Agency code DUZ("AG") equal "V" or "I" & the Vitals
- +17 ; package flag at IHS is set to 1 for PCC V file.
- +18 ;
- +19 ; Parameters:
- +20 ; Input - DFN (r) Pointer to the PATIENT (#2) file
- +21 ; RATE (r) BCMA trigger event/transaction
- +22 ; VTYPE (o) Pointer to GMRV VITAL TYPE FILE (#120.51)
- +23 ; (default = Pain ["PN"])
- +24 ; DTTKN (o) Date/time (FileMan) measurement was taken
- +25 ; (default = $$NOW^XLFDT())
- +26 ;
- +27 ; Output - RESULTS(0) = 1
- +28 ; RESULTS(1) ="1^*** comment ***"
- +29 ; or RESULTS(1) ="-1^ERROR * Pain Score NOT filed
- +30 ; successfully"
- +31 ;
- +32 ; Process results in the storing of VITAL Measurement rate into the VITAL
- +33 ; MEASUREMENT FILE per the given patient and vital type.
- +34 ;
- 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 NEW VAIP,DFN
- SET DFN=$GET(PSBDFN)
- DO IN5^VADPT
- +6 ;*70 removed discharge code & test that was -here-
- +7 SET RESULTS(0)=1
- SET RESULTS(1)="-1^ERROR * "_$SELECT($GET(PSBVTYPE)']""!($GET(PSBVTYPE)="PN"):"Pain Score",1:"Vital Measurement")_" NOT filed successfully."
- +8 if $GET(PSBVTYPE)']""
- SET PSBVTYPE="PN"
- +9 if $GET(PSBDTTKN)']""
- SET PSBDTTKN=$$NOW^XLFDT()
- +10 ;*70 clinic, no Hosp
- if +$GET(VAIP(5))
- SET PSBHLOC=^DIC(42,+$GET(VAIP(5)),44)
- +11 ;
- +12 ;Store Vitals info into either the VA Vitals package or the IHS PCC
- +13 ; V measurement package, based on agency variable and Vitals package ; flag setting=1 for PCC V Measurement
- +14 ;
- +15 NEW VTYP,PCC,XREF,VSIT,VDAT
- +16 IF $GET(DUZ("AG"))="I"
- IF $$GET^XPAR("ALL","BEHOVM USE VMSR")
- Begin DoDot:1
- +17 SET XREF("T")="TMP"
- SET XREF("P")="PU"
- SET XREF("BP")="BP"
- SET XREF("R")="RS"
- SET XREF("PN")="PA"
- +18 SET VTYP=+$$FIND1^DIC(9999999.07,"","BX",$$UP^XLFSTR($GET(XREF(PSBVTYPE))))
- +19 if 'VTYP
- QUIT
- +20 SET VSIT=$PIECE($GET(^DGPM(+$GET(VAIP(13)),0)),U,27)
- +21 SET VDAT=$PIECE($GET(^AUPNVSIT(+VSIT,0)),U)
- +22 SET PCC(1)="HDR^^^"_PSBHLOC_";"_$SELECT(VDAT:VDAT,1:PSBDTTKN)_";H;"_VSIT
- +23 SET PCC(2)="VST^DT^"_$SELECT(VDAT:VDAT,1:PSBDTTKN)
- +24 SET PCC(3)="VST^PT^"_PSBDFN
- +25 SET PCC(4)="VIT+^"_VTYP_"^0^^"_PSBRATE_"^^^"_PSBDTTKN
- +26 DO SAVE^BEHOENPC(.RESULTS,.PCC)
- +27 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
- +28 IF '$TEST
- Begin DoDot:1
- +29 SET GMRVDAT("ENCOUNTER")=U_PSBDFN_U_$GET(PSBHLOC)
- +30 SET GMRVDAT("SOURCE")=U_$GET(DUZ)
- +31 SET GMRVDAT("VITALS",$GET(DUZ),1)=PSBVTYPE_U_$GET(PSBRATE)_U_$GET(PSBUNTS)_U_PSBDTTKN
- +32 DO STORE^GMRVPCE0(.GMRVDAT)
- +33 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
- +34 QUIT
- +35 ;