Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMVUTL1

GMVUTL1.m

Go to the documentation of this file.
  1. 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
  1. ;
  1. ; This routine uses the following IAs:
  1. ; #1246 - WIN^DGPMDDCF (supported)
  1. ; #10039 - FILE 42 references (supported)
  1. ; #10040 - ^SC( references (supported)
  1. ; #10060 - FILE 200 fields (supported)
  1. ; #10090 - FILE 4 references (supported)
  1. ; #10104 - ^XLFSTR calls (supported)
  1. ;
  1. ; This routine supports the following IAs:
  1. ; #4414 - GMV MARK ERROR RPC is called at ERROR (private)
  1. ;
  1. ERROR(RESULT,GMVDATA) ;GMV MARK ERROR [RPC entry point]
  1. ;GMVDATA CONSISTS OF THE FOLLOWING DATA:
  1. ;FILE # 120.5 IEN^DUZ^INCORRECT DATE/TIME^INCORRECT READING^INCORRECT
  1. ;PATIENT^INVALID RECORD
  1. N GMVFDA,GMVIEN,GMVIENS
  1. I '$D(^GMR(120.5,+GMVDATA,0))#2 S RESULT="ERROR: Record Not Found" Q
  1. S GMVIENS=(+GMVDATA)_","
  1. S GMVFDA(120.5,GMVIENS,2)=1
  1. S GMVFDA(120.5,GMVIENS,3)=$P(GMVDATA,"^",2)
  1. S GMVFDA(120.506,"+1,"_GMVIENS,.01)=$P(GMVDATA,"^",3)
  1. S GMVFDA(120.506,"+1,"_GMVIENS,.02)=$$NOW^XLFDT
  1. D UPDATE^DIE("","GMVFDA","GMVIEN")
  1. S RESULT="OK"
  1. Q
  1. ;
  1. ACTLOC(LOC) ; Function: returns TRUE if active hospital location
  1. N D0,X I +$G(^SC(LOC,"OOS")) Q 0 ; screen out OOS entry
  1. S D0=+$G(^SC(LOC,42)) I D0 D WIN^DGPMDDCF Q 'X ; chk out of svc wards
  1. S X=$G(^SC(LOC,"I")) I +X=0 Q 1 ; no inactivate date
  1. I DT>$P(X,U)&($P(X,U,2)=""!(DT<$P(X,U,2))) Q 0 ; chk reactivate date
  1. Q 1 ; must still be active
  1. ;
  1. PERSON(X) ;RETURN PERSON'S NAME FROM FILE #200.
  1. N GMVNAME
  1. Q:'X ""
  1. S GMVNAME=$$GET1^DIQ(200,X,.01,"E")
  1. Q $S(GMVNAME'="":GMVNAME,1:"")
  1. FILLER(L,S,STRING) ; Returns the number of filler characters desired.
  1. ; L - larger number
  1. ; S - smaller number
  1. ; STRING - string of same characters (e.g., spaces)
  1. ; Use spaces if STRING is not defined.
  1. I $L(STRING)=0 S STRING=$$REPEAT^XLFSTR(" ",79) ;line of spaces
  1. Q $E(STRING,1,L-S)
  1. ;
  1. HOSPLOC(GMVWARD) ; Function returns Hospital Location IEN for a ward
  1. ; Input:
  1. ; GMVWARD - Ward (FILE 42) IEN
  1. ; Returns:
  1. ; Hospital Location (FILE 44) IEN for the ward
  1. ; If GMVWARD'>0 or not found, then returns "" (null)
  1. I $G(GMVWARD)'>0 Q "" ;illegal ward ien
  1. Q $P($G(^DIC(42,+GMVWARD,44)),"^")
  1. ;
  1. DIVISION(GMVLOC) ; Function returns Division name for Hospital Location
  1. ; (FILE 44) IEN
  1. ; Input:
  1. ; GMVLOC - Hospital Location (FILE 44) IEN
  1. ; Returns:
  1. ; Division name (FILE 4) associated with that Hospital Location
  1. ; If GMVLOC'>0 or not found, then returns "" (null)
  1. I $G(GMVLOC)'>0 Q "" ;illegal hospital location
  1. Q $S(GMVLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMVLOC,3,"I"),.01,"I"),1:"")
  1. ;