GMVUTL1 ;HOIFO/YH,ASMR/MS,FT-EXTRACT CLINIC LIST AND MARK VITALS ENTERED IN ERROR ;6/11/03 09:25
;;5.0;GEN. MED. REC. - VITALS;**1,3,32**;Oct 31, 2002;Build 13
;
; This routine uses the following IAs:
; #1246 - WIN^DGPMDDCF (supported)
; #10039 - FILE 42 references (supported)
; #10040 - ^SC( references (supported)
; #10060 - FILE 200 fields (supported)
; #10090 - FILE 4 references (supported)
; #10104 - ^XLFSTR calls (supported)
;
; This routine supports the following IAs:
; #4414 - GMV MARK ERROR RPC is called at ERROR (private)
;
ERROR(RESULT,GMVDATA) ;GMV MARK ERROR [RPC entry point]
;GMVDATA CONSISTS OF THE FOLLOWING DATA:
;FILE # 120.5 IEN^DUZ^INCORRECT DATE/TIME^INCORRECT READING^INCORRECT
;PATIENT^INVALID RECORD
N GMVFDA,GMVIEN,GMVIENS
I '$D(^GMR(120.5,+GMVDATA,0))#2 S RESULT="ERROR: Record Not Found" Q
S GMVIENS=(+GMVDATA)_","
S GMVFDA(120.5,GMVIENS,2)=1
S GMVFDA(120.5,GMVIENS,3)=$P(GMVDATA,"^",2)
S GMVFDA(120.506,"+1,"_GMVIENS,.01)=$P(GMVDATA,"^",3)
S GMVFDA(120.506,"+1,"_GMVIENS,.02)=$$NOW^XLFDT
D UPDATE^DIE("","GMVFDA","GMVIEN")
S RESULT="OK"
Q
;
ACTLOC(LOC) ; Function: returns TRUE if active hospital location
N D0,X I +$G(^SC(LOC,"OOS")) Q 0 ; screen out OOS entry
S D0=+$G(^SC(LOC,42)) I D0 D WIN^DGPMDDCF Q 'X ; chk out of svc wards
S X=$G(^SC(LOC,"I")) I +X=0 Q 1 ; no inactivate date
I DT>$P(X,U)&($P(X,U,2)=""!(DT<$P(X,U,2))) Q 0 ; chk reactivate date
Q 1 ; must still be active
;
PERSON(X) ;RETURN PERSON'S NAME FROM FILE #200.
N GMVNAME
Q:'X ""
S GMVNAME=$$GET1^DIQ(200,X,.01,"E")
Q $S(GMVNAME'="":GMVNAME,1:"")
FILLER(L,S,STRING) ; Returns the number of filler characters desired.
; L - larger number
; S - smaller number
; STRING - string of same characters (e.g., spaces)
; Use spaces if STRING is not defined.
I $L(STRING)=0 S STRING=$$REPEAT^XLFSTR(" ",79) ;line of spaces
Q $E(STRING,1,L-S)
;
HOSPLOC(GMVWARD) ; Function returns Hospital Location IEN for a ward
; Input:
; GMVWARD - Ward (FILE 42) IEN
; Returns:
; Hospital Location (FILE 44) IEN for the ward
; If GMVWARD'>0 or not found, then returns "" (null)
I $G(GMVWARD)'>0 Q "" ;illegal ward ien
Q $P($G(^DIC(42,+GMVWARD,44)),"^")
;
DIVISION(GMVLOC) ; Function returns Division name for Hospital Location
; (FILE 44) IEN
; Input:
; GMVLOC - Hospital Location (FILE 44) IEN
; Returns:
; Division name (FILE 4) associated with that Hospital Location
; If GMVLOC'>0 or not found, then returns "" (null)
I $G(GMVLOC)'>0 Q "" ;illegal hospital location
Q $S(GMVLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMVLOC,3,"I"),.01,"I"),1:"")
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVUTL1 2786 printed Oct 16, 2024@18:00:44 Page 2
GMVUTL1 ;HOIFO/YH,ASMR/MS,FT-EXTRACT CLINIC LIST AND MARK VITALS ENTERED IN ERROR ;6/11/03 09:25
+1 ;;5.0;GEN. MED. REC. - VITALS;**1,3,32**;Oct 31, 2002;Build 13
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #1246 - WIN^DGPMDDCF (supported)
+5 ; #10039 - FILE 42 references (supported)
+6 ; #10040 - ^SC( references (supported)
+7 ; #10060 - FILE 200 fields (supported)
+8 ; #10090 - FILE 4 references (supported)
+9 ; #10104 - ^XLFSTR calls (supported)
+10 ;
+11 ; This routine supports the following IAs:
+12 ; #4414 - GMV MARK ERROR RPC is called at ERROR (private)
+13 ;
ERROR(RESULT,GMVDATA) ;GMV MARK ERROR [RPC entry point]
+1 ;GMVDATA CONSISTS OF THE FOLLOWING DATA:
+2 ;FILE # 120.5 IEN^DUZ^INCORRECT DATE/TIME^INCORRECT READING^INCORRECT
+3 ;PATIENT^INVALID RECORD
+4 NEW GMVFDA,GMVIEN,GMVIENS
+5 IF '$DATA(^GMR(120.5,+GMVDATA,0))#2
SET RESULT="ERROR: Record Not Found"
QUIT
+6 SET GMVIENS=(+GMVDATA)_","
+7 SET GMVFDA(120.5,GMVIENS,2)=1
+8 SET GMVFDA(120.5,GMVIENS,3)=$PIECE(GMVDATA,"^",2)
+9 SET GMVFDA(120.506,"+1,"_GMVIENS,.01)=$PIECE(GMVDATA,"^",3)
+10 SET GMVFDA(120.506,"+1,"_GMVIENS,.02)=$$NOW^XLFDT
+11 DO UPDATE^DIE("","GMVFDA","GMVIEN")
+12 SET RESULT="OK"
+13 QUIT
+14 ;
ACTLOC(LOC) ; Function: returns TRUE if active hospital location
+1 ; screen out OOS entry
NEW D0,X
IF +$GET(^SC(LOC,"OOS"))
QUIT 0
+2 ; chk out of svc wards
SET D0=+$GET(^SC(LOC,42))
IF D0
DO WIN^DGPMDDCF
QUIT 'X
+3 ; no inactivate date
SET X=$GET(^SC(LOC,"I"))
IF +X=0
QUIT 1
+4 ; chk reactivate date
IF DT>$PIECE(X,U)&($PIECE(X,U,2)=""!(DT<$PIECE(X,U,2)))
QUIT 0
+5 ; must still be active
QUIT 1
+6 ;
PERSON(X) ;RETURN PERSON'S NAME FROM FILE #200.
+1 NEW GMVNAME
+2 if 'X
QUIT ""
+3 SET GMVNAME=$$GET1^DIQ(200,X,.01,"E")
+4 QUIT $SELECT(GMVNAME'="":GMVNAME,1:"")
FILLER(L,S,STRING) ; Returns the number of filler characters desired.
+1 ; L - larger number
+2 ; S - smaller number
+3 ; STRING - string of same characters (e.g., spaces)
+4 ; Use spaces if STRING is not defined.
+5 ;line of spaces
IF $LENGTH(STRING)=0
SET STRING=$$REPEAT^XLFSTR(" ",79)
+6 QUIT $EXTRACT(STRING,1,L-S)
+7 ;
HOSPLOC(GMVWARD) ; Function returns Hospital Location IEN for a ward
+1 ; Input:
+2 ; GMVWARD - Ward (FILE 42) IEN
+3 ; Returns:
+4 ; Hospital Location (FILE 44) IEN for the ward
+5 ; If GMVWARD'>0 or not found, then returns "" (null)
+6 ;illegal ward ien
IF $GET(GMVWARD)'>0
QUIT ""
+7 QUIT $PIECE($GET(^DIC(42,+GMVWARD,44)),"^")
+8 ;
DIVISION(GMVLOC) ; Function returns Division name for Hospital Location
+1 ; (FILE 44) IEN
+2 ; Input:
+3 ; GMVLOC - Hospital Location (FILE 44) IEN
+4 ; Returns:
+5 ; Division name (FILE 4) associated with that Hospital Location
+6 ; If GMVLOC'>0 or not found, then returns "" (null)
+7 ;illegal hospital location
IF $GET(GMVLOC)'>0
QUIT ""
+8 QUIT $SELECT(GMVLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMVLOC,3,"I"),.01,"I"),1:"")
+9 ;