CIAZPVIT ;CIA/DKM - PCC Data Capture Hook for Vitals Package;04-May-2004 16:20;DKM
;;1.1;VUECENTRIC RPMS SUPPORT;;Sep 14, 2004
;;Copyright 2000-2004, Clinical Informatics Associates, Inc.
;=================================================================
; Store Vital Measurement entry into PCC
VIT2VMSR(IEN) ; EP
N PCC,GMR0,VSTR,VT,QL,QX,DFN,VMSR,ACT,X
S GMR0=$G(^GMR(120.5,+IEN,0)),VMSR=+$G(^(9999999))
Q:'$L(GMR0)
S VSTR=$P(GMR0,U,5)_";"_+GMR0,VT=$P(GMR0,U,3),DFN=$P(GMR0,U,2)
S:VT VT=$$GET1^DIQ(120.51,VT,7),VT=$$FIND1^DIC(9999999.07,,,VT)
Q:'VSTR!'VT
S ACT=$S($G(^GMR(120.5,IEN,2)):"-",VMSR:"",1:"+")
I 'VMSR,ACT="-" Q
D INPLOC^CIAVCXPT(.X,DFN)
S VSTR=VSTR_";"_$S(X:"H",1:"A")
D ADD("HDR^^^"_VSTR)
D ADD("VST^PT^"_DFN)
D ADD("VST^DT^"_+GMR0)
D ADD("VIT"_ACT_U_VT_U_VMSR_U_IEN_U_$P(GMR0,U,8))
S QL="",QX=0
F S QX=$O(^GMR(120.5,IEN,5,QX)) Q:'QX S X=+$G(^(QX,0)) D:X
.S QL=QL_$S($L(QL):", ",1:"Qualifiers: ")_$$GET1^DIQ(120.52,X,.01)
D:$L(QL) ADD("COM^^"_QL)
D SAVE^CIAVCXPC(,.PCC)
Q
ADD(X) S PCC=$G(PCC)+1,PCC(PCC)=X
Q
; EP - Initial population of V MEASUREMENT from GMRV
POPPCC N IEN
F IEN=0:0 S IEN=$O(^GMR(120.5,IEN)) Q:'IEN D VIT2VMSR(IEN)
Q
CIAZPVIT ;CIA/DKM - PCC Data Capture Hook for Vitals Package;04-May-2004 16:20;DKM
+1 ;;1.1;VUECENTRIC RPMS SUPPORT;;Sep 14, 2004
+2 ;;Copyright 2000-2004, Clinical Informatics Associates, Inc.
+3 ;=================================================================
+4 ; Store Vital Measurement entry into PCC
VIT2VMSR(IEN) ; EP
+1 NEW PCC,GMR0,VSTR,VT,QL,QX,DFN,VMSR,ACT,X
+2 SET GMR0=$GET(^GMR(120.5,+IEN,0))
SET VMSR=+$GET(^(9999999))
+3 IF '$LENGTH(GMR0)
QUIT
+4 SET VSTR=$PIECE(GMR0,U,5)_";"_+GMR0
SET VT=$PIECE(GMR0,U,3)
SET DFN=$PIECE(GMR0,U,2)
+5 IF VT
SET VT=$$GET1^DIQ(120.51,VT,7)
SET VT=$$FIND1^DIC(9999999.07,,,VT)
+6 IF 'VSTR!'VT
QUIT
+7 SET ACT=$SELECT($GET(^GMR(120.5,IEN,2)):"-",VMSR:"",1:"+")
+8 IF 'VMSR
IF ACT="-"
QUIT
+9 DO INPLOC^CIAVCXPT(.X,DFN)
+10 SET VSTR=VSTR_";"_$SELECT(X:"H",1:"A")
+11 DO ADD("HDR^^^"_VSTR)
+12 DO ADD("VST^PT^"_DFN)
+13 DO ADD("VST^DT^"_+GMR0)
+14 DO ADD("VIT"_ACT_U_VT_U_VMSR_U_IEN_U_$PIECE(GMR0,U,8))
+15 SET QL=""
SET QX=0
+16 FOR
SET QX=$ORDER(^GMR(120.5,IEN,5,QX))
IF 'QX
QUIT
SET X=+$GET(^(QX,0))
IF X
Begin DoDot:1
+17 SET QL=QL_$SELECT($LENGTH(QL):", ",1:"Qualifiers: ")_$$GET1^DIQ(120.52,X,.01)
End DoDot:1
+18 IF $LENGTH(QL)
DO ADD("COM^^"_QL)
+19 DO SAVE^CIAVCXPC(,.PCC)
+20 QUIT
ADD(X) SET PCC=$GET(PCC)+1
SET PCC(PCC)=X
+1 QUIT
+2 ; EP - Initial population of V MEASUREMENT from GMRV
POPPCC NEW IEN
+1 FOR IEN=0:0
SET IEN=$ORDER(^GMR(120.5,IEN))
IF 'IEN
QUIT
DO VIT2VMSR(IEN)
+2 QUIT