GMVFUT0 ;HOIFO/RM,FT-FILE UTILITIES FOR 120.5 FILE ;5/23/01 15:42
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; <None>
;
EN1(Y,DA) ; INPUT TRANSFORM FOR NAME (.01) FIELD OF QUALIFIER
; (120.505) SUB-FILE OF GMRV VITAL MEASUREMENT (120.5) FILE.
; Input variables: Y is entry in 120.52 being looked up
; DA is entry in 120.5 where Qualifier data
; is being selected.
; Function value: 1 if can select this Qualifier, else 0.
;
N GMRVFXN,GMRVTYP S GMRVFXN=0
S GMRVTYP=$P($G(^GMR(120.5,DA,0)),"^",3)
I GMRVTYP>0,$D(^GMRD(120.52,"C",GMRVTYP,+Y)) S GMRVFXN=1
Q GMRVFXN
;
EN2(DA,X) ; CALLED FROM INPUT TRANSFORM OF RATE (1.2) FIELD OF THE GMRV
; VITAL MEASUREMENT (#120.5) FILE.
; Input variable: DA is entry in 120.5 where Rate is being validated.
; X is value of Rate being validated.
;
N GMRVFXN,GMRVINP,GMRVM,GMRVTYP
S GMRVFXN=1 I $A(X)=45 S GMRVFXN=0
I GMRVFXN D
. S GMRVTYP=$P($G(^GMR(120.5,DA,0)),"^",3)
. I GMRVTYP'>0 S GMRVFXN=0
. I GMRVTYP>0,'$P($G(^GMRD(120.51,GMRVTYP,0)),"^",4) S GMRVFXN=0
. I 'GMRVFXN D
. . S GMRVFXN=0,GMRVM(1)=$C(7),GMRVM(3)=""
. . S GMRVM(2)=" RATE CANNOT BE ENTERED FOR THIS MEASUREMENT TYPE!"
. . D EN^DDIOL(.GMRVM,"","?5")
. . Q
. Q
I GMRVFXN,$L(X)>30!($L(X)<1) S GMRVFXN=0
I GMRVFXN D
. S GMRVINP=$E($G(^GMRD(120.51,$P(^GMR(120.5,DA,0),U,3),1)),1,245)
. I GMRVINP'="" X GMRVINP I '$D(X) S GMRVFXN=0
. I GMRVINP="" S GMRVFXN=0
. Q
Q GMRVFXN
;
AA(GMRVFLD,GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF: AA01 XREF OF
; DATE/TIME VITALS TAKEN (.01) FIELD, AA02 XREF OF PATIENT (.02)
; FIELD, AND AA03 XREF OF VITAL TYPE (.03) FIELD OF THE GMRV VITAL
; MEASUREMENT (120.5) FILE TO SET "AA" INDEX.
; Input variables: GMRVFLD=field making call
; GMRVSK=1 if called from SET LOGIC, 2 if called
; from KILL LOGIC.
; DA is entry being indexed.
; X is value of GMRVFLD to be indexed.
;
N GMRVDFN,GMRVDT,GMRVTYP,GMRVX
S GMRVX=$G(^GMR(120.5,DA,0))
S GMRVDT=$S(GMRVFLD=.01:X,1:$P(GMRVX,"^"))
S GMRVDFN=$S(GMRVFLD=.02:X,1:$P(GMRVX,"^",2))
S GMRVTYP=$S(GMRVFLD=.03:X,1:$P(GMRVX,"^",3))
Q:GMRVDT=""!(GMRVDFN="")!(GMRVTYP="")
I GMRVSK=1 S ^GMR(120.5,"AA",GMRVDFN,GMRVTYP,9999999-GMRVDT,DA)=""
I GMRVSK=2 K ^GMR(120.5,"AA",GMRVDFN,GMRVTYP,9999999-GMRVDT,DA)
Q
RATEHLP(DA) ; CALLED FROM EXECUTABLE HELP OF RATE (1.2) FIELD OF GMRV
; VITAL MEASUREMENT (120.5) FILE.
; Input Variable: DA is entry in 120.5 to display help for.
;
N GMRVTYP,XQH
S GMRVTYP=$P($G(^GMR(120.5,DA,0)),"^",3)
S XQH=$P($G(^GMRD(120.51,+GMRVTYP,0)),"^",6)
I XQH="" D EN^DDIOL("RATE NOT APPLICABLE FOR THIS TYPE OF MEASUREMENT")
I XQH'="" D EN^XQH
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVFUT0 2892 printed Dec 13, 2024@01:58:44 Page 2
GMVFUT0 ;HOIFO/RM,FT-FILE UTILITIES FOR 120.5 FILE ;5/23/01 15:42
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; <None>
+5 ;
EN1(Y,DA) ; INPUT TRANSFORM FOR NAME (.01) FIELD OF QUALIFIER
+1 ; (120.505) SUB-FILE OF GMRV VITAL MEASUREMENT (120.5) FILE.
+2 ; Input variables: Y is entry in 120.52 being looked up
+3 ; DA is entry in 120.5 where Qualifier data
+4 ; is being selected.
+5 ; Function value: 1 if can select this Qualifier, else 0.
+6 ;
+7 NEW GMRVFXN,GMRVTYP
SET GMRVFXN=0
+8 SET GMRVTYP=$PIECE($GET(^GMR(120.5,DA,0)),"^",3)
+9 IF GMRVTYP>0
IF $DATA(^GMRD(120.52,"C",GMRVTYP,+Y))
SET GMRVFXN=1
+10 QUIT GMRVFXN
+11 ;
EN2(DA,X) ; CALLED FROM INPUT TRANSFORM OF RATE (1.2) FIELD OF THE GMRV
+1 ; VITAL MEASUREMENT (#120.5) FILE.
+2 ; Input variable: DA is entry in 120.5 where Rate is being validated.
+3 ; X is value of Rate being validated.
+4 ;
+5 NEW GMRVFXN,GMRVINP,GMRVM,GMRVTYP
+6 SET GMRVFXN=1
IF $ASCII(X)=45
SET GMRVFXN=0
+7 IF GMRVFXN
Begin DoDot:1
+8 SET GMRVTYP=$PIECE($GET(^GMR(120.5,DA,0)),"^",3)
+9 IF GMRVTYP'>0
SET GMRVFXN=0
+10 IF GMRVTYP>0
IF '$PIECE($GET(^GMRD(120.51,GMRVTYP,0)),"^",4)
SET GMRVFXN=0
+11 IF 'GMRVFXN
Begin DoDot:2
+12 SET GMRVFXN=0
SET GMRVM(1)=$CHAR(7)
SET GMRVM(3)=""
+13 SET GMRVM(2)=" RATE CANNOT BE ENTERED FOR THIS MEASUREMENT TYPE!"
+14 DO EN^DDIOL(.GMRVM,"","?5")
+15 QUIT
End DoDot:2
+16 QUIT
End DoDot:1
+17 IF GMRVFXN
IF $LENGTH(X)>30!($LENGTH(X)<1)
SET GMRVFXN=0
+18 IF GMRVFXN
Begin DoDot:1
+19 SET GMRVINP=$EXTRACT($GET(^GMRD(120.51,$PIECE(^GMR(120.5,DA,0),U,3),1)),1,245)
+20 IF GMRVINP'=""
XECUTE GMRVINP
IF '$DATA(X)
SET GMRVFXN=0
+21 IF GMRVINP=""
SET GMRVFXN=0
+22 QUIT
End DoDot:1
+23 QUIT GMRVFXN
+24 ;
AA(GMRVFLD,GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF: AA01 XREF OF
+1 ; DATE/TIME VITALS TAKEN (.01) FIELD, AA02 XREF OF PATIENT (.02)
+2 ; FIELD, AND AA03 XREF OF VITAL TYPE (.03) FIELD OF THE GMRV VITAL
+3 ; MEASUREMENT (120.5) FILE TO SET "AA" INDEX.
+4 ; Input variables: GMRVFLD=field making call
+5 ; GMRVSK=1 if called from SET LOGIC, 2 if called
+6 ; from KILL LOGIC.
+7 ; DA is entry being indexed.
+8 ; X is value of GMRVFLD to be indexed.
+9 ;
+10 NEW GMRVDFN,GMRVDT,GMRVTYP,GMRVX
+11 SET GMRVX=$GET(^GMR(120.5,DA,0))
+12 SET GMRVDT=$SELECT(GMRVFLD=.01:X,1:$PIECE(GMRVX,"^"))
+13 SET GMRVDFN=$SELECT(GMRVFLD=.02:X,1:$PIECE(GMRVX,"^",2))
+14 SET GMRVTYP=$SELECT(GMRVFLD=.03:X,1:$PIECE(GMRVX,"^",3))
+15 if GMRVDT=""!(GMRVDFN="")!(GMRVTYP="")
QUIT
+16 IF GMRVSK=1
SET ^GMR(120.5,"AA",GMRVDFN,GMRVTYP,9999999-GMRVDT,DA)=""
+17 IF GMRVSK=2
KILL ^GMR(120.5,"AA",GMRVDFN,GMRVTYP,9999999-GMRVDT,DA)
+18 QUIT
RATEHLP(DA) ; CALLED FROM EXECUTABLE HELP OF RATE (1.2) FIELD OF GMRV
+1 ; VITAL MEASUREMENT (120.5) FILE.
+2 ; Input Variable: DA is entry in 120.5 to display help for.
+3 ;
+4 NEW GMRVTYP,XQH
+5 SET GMRVTYP=$PIECE($GET(^GMR(120.5,DA,0)),"^",3)
+6 SET XQH=$PIECE($GET(^GMRD(120.51,+GMRVTYP,0)),"^",6)
+7 IF XQH=""
DO EN^DDIOL("RATE NOT APPLICABLE FOR THIS TYPE OF MEASUREMENT")
+8 IF XQH'=""
DO EN^XQH
+9 QUIT