GMRVORE3 ;HIRMFO/MD,RM-ENTRY TO STORE DATA FOR BOTH GMR ORDER RECORDS ;4/15/96
;;4.0;Vitals/Measurements;;Apr 25, 1997
UNREL ; ENTRY TO STORE DATA FOR BOTH GMR ORDER RECORDS
I ORACTION=0!(ORACTION=1&GMRVNEW) D
.S ORPCL=$S('ORACTION:XQORNOD,1:$P(GMRVORD(1),U,5)),ORTX=">> "_$S('ORACTION:$P($G(^ORD(101,+XQORNOD,0)),"^",2),1:$P($P(GMRVORD(2),U,5)," - "))_" - "_$P(GMRVAS,U)_" - "_$S(GMRVCOM]"":GMRVCOM,1:"(No Special Instructions)")
.Q
I S ORSTS=11,ORSTRT=GMRVSTRT,ORSTOP=GMRVSTOP,ORPK=GMRVSTRT_U_GMRVSTOP_U_GMRVAS_U_GMRVCOM_U_$S(ORACTION=1:ORIFN,1:$P(GMRVORD(3),U,7)) D FILE^ORX
I ORACTION=1,'GMRVNEW S ORETURN("ORSTOP")=GMRVSTOP,ORETURN("ORSTRT")=GMRVSTRT,ORETURN("ORPK")=GMRVSTRT_U_GMRVSTOP_U_GMRVAS_U_GMRVCOM_U_$P(GMRVORD(3),U,7),ORETURN("ORTX")=$G(ORTX) D RETURN^ORX
I ORACTION=2 S GMRVOIFN=ORIFN,ORPCL=$P(GMRVORD(1),U,5),ORTO=$P(GMRVORD(1),U,11),ORIT=$P(GMRVORD(2),U,4),ORL=$P(GMRVORD(1),U,10),ORPK=GMRVSTRT_U_GMRVSTOP_U_GMRVAS_U_GMRVCOM_U_ORIFN
I S ORTX=$P(GMRVORD(2),U,5),ORSTS=11,ORSTRT=GMRVSTRT,ORSTOP=GMRVSTOP D FILE^ORX S ORIFN=GMRVOIFN
Q
REL ;
S:GMRVSTOP?1"~".E GMRVSTOP=$E(GMRVSTOP,2,99) S:GMRVSTRT?1"~".E GMRVSTRT=$E(GMRVSTRT,2,99) S:GMRVAS?1"~".E GMRVAS=$E(GMRVAS,2,99) S:GMRVCOM?1"~" GMRVCOM=$E(GMRVCOM,2,99)
S GMRVOIFN=ORIFN I $P(GMRVORD(3),U,7)>0 D NOW^%DTC S ORIFN=$P(GMRVORD(3),U,7),ORETURN("ORSTOP")=%,ORETURN("ORSTS")=1 D RETURN^ORX
S ORIFN=GMRVOIFN D NOW^%DTC S ORETURN("ORSTS")=$S(GMRVSTRT'>%:6,1:8),ORETURN("OREVENT")=$S(ORETURN("ORSTS")=6:GMRVSTOP_";C",1:GMRVSTRT_";A"),ORETURN("ORPK")="" D RETURN^ORX
S ORIFN=GMRVOIFN S:'$D(^GMR(120.55,ORIFN,0)) $P(^GMR(120.55,0),"^",3,4)=ORIFN_"^"_($P(^GMR(120.55,0),"^",4)+1) S DA=ORIFN,^GMR(120.55,ORIFN,0)=ORIFN_"^"_GMRVAS,DIK="^GMR(120.55," D IX1^DIK S:GMRVCOM'="" ^GMR(120.55,ORIFN,"O")=GMRVCOM
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVORE3 1796 printed Oct 16, 2024@17:58:01 Page 2
GMRVORE3 ;HIRMFO/MD,RM-ENTRY TO STORE DATA FOR BOTH GMR ORDER RECORDS ;4/15/96
+1 ;;4.0;Vitals/Measurements;;Apr 25, 1997
UNREL ; ENTRY TO STORE DATA FOR BOTH GMR ORDER RECORDS
+1 IF ORACTION=0!(ORACTION=1&GMRVNEW)
Begin DoDot:1
+2 SET ORPCL=$SELECT('ORACTION:XQORNOD,1:$PIECE(GMRVORD(1),U,5))
SET ORTX=">> "_$SELECT('ORACTION:$PIECE($GET(^ORD(101,+XQORNOD,0)),"^",2),1:$PIECE($PIECE(GMRVORD(2),U,5)," - "))_" - "_$PIECE(GMRVAS,U)_" - "_$SELECT(GMRVCOM]"":GMRVCOM,1:"(No Special Instructions)")
+3 QUIT
End DoDot:1
+4 IF $TEST
SET ORSTS=11
SET ORSTRT=GMRVSTRT
SET ORSTOP=GMRVSTOP
SET ORPK=GMRVSTRT_U_GMRVSTOP_U_GMRVAS_U_GMRVCOM_U_$SELECT(ORACTION=1:ORIFN,1:$PIECE(GMRVORD(3),U,7))
DO FILE^ORX
+5 IF ORACTION=1
IF 'GMRVNEW
SET ORETURN("ORSTOP")=GMRVSTOP
SET ORETURN("ORSTRT")=GMRVSTRT
SET ORETURN("ORPK")=GMRVSTRT_U_GMRVSTOP_U_GMRVAS_U_GMRVCOM_U_$PIECE(GMRVORD(3),U,7)
SET ORETURN("ORTX")=$GET(ORTX)
DO RETURN^ORX
+6 IF ORACTION=2
SET GMRVOIFN=ORIFN
SET ORPCL=$PIECE(GMRVORD(1),U,5)
SET ORTO=$PIECE(GMRVORD(1),U,11)
SET ORIT=$PIECE(GMRVORD(2),U,4)
SET ORL=$PIECE(GMRVORD(1),U,10)
SET ORPK=GMRVSTRT_U_GMRVSTOP_U_GMRVAS_U_GMRVCOM_U_ORIFN
+7 IF $TEST
SET ORTX=$PIECE(GMRVORD(2),U,5)
SET ORSTS=11
SET ORSTRT=GMRVSTRT
SET ORSTOP=GMRVSTOP
DO FILE^ORX
SET ORIFN=GMRVOIFN
+8 QUIT
REL ;
+1 if GMRVSTOP?1"~".E
SET GMRVSTOP=$EXTRACT(GMRVSTOP,2,99)
if GMRVSTRT?1"~".E
SET GMRVSTRT=$EXTRACT(GMRVSTRT,2,99)
if GMRVAS?1"~".E
SET GMRVAS=$EXTRACT(GMRVAS,2,99)
if GMRVCOM?1"~"
SET GMRVCOM=$EXTRACT(GMRVCOM,2,99)
+2 SET GMRVOIFN=ORIFN
IF $PIECE(GMRVORD(3),U,7)>0
DO NOW^%DTC
SET ORIFN=$PIECE(GMRVORD(3),U,7)
SET ORETURN("ORSTOP")=%
SET ORETURN("ORSTS")=1
DO RETURN^ORX
+3 SET ORIFN=GMRVOIFN
DO NOW^%DTC
SET ORETURN("ORSTS")=$SELECT(GMRVSTRT'>%:6,1:8)
SET ORETURN("OREVENT")=$SELECT(ORETURN("ORSTS")=6:GMRVSTOP_";C",1:GMRVSTRT_";A")
SET ORETURN("ORPK")=""
DO RETURN^ORX
+4 SET ORIFN=GMRVOIFN
if '$DATA(^GMR(120.55,ORIFN,0))
SET $PIECE(^GMR(120.55,0),"^",3,4)=ORIFN_"^"_($PIECE(^GMR(120.55,0),"^",4)+1)
SET DA=ORIFN
SET ^GMR(120.55,ORIFN,0)=ORIFN_"^"_GMRVAS
SET DIK="^GMR(120.55,"
DO IX1^DIK
if GMRVCOM'=""
SET ^GMR(120.55,ORIFN,"O")=GMRVCOM
+5 QUIT