source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVUTL1.m@ 1579

Last change on this file since 1579 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1GMVUTL1 ;HOIFO/YH,FT-EXTRACT CLINIC LIST AND MARK VITALS ENTERED IN ERROR ;6/11/03 09:25
2 ;;5.0;GEN. MED. REC. - VITALS;**1,3**;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #1246 - WIN^DGPMDDCF (supported)
6 ; #10039 - FILE 42 references (supported)
7 ; #10040 - ^SC( references (supported)
8 ; #10060 - FILE 200 fields (supported)
9 ; #10090 - FILE 4 references (supported)
10 ; #10104 - ^XLFSTR calls (supported)
11 ;
12 ; This routine supports the following IAs:
13 ; #4414 - GMV MARK ERROR RPC is called at ERROR (private)
14 ;
15ERROR(RESULT,GMVDATA) ;GMV MARK ERROR [RPC entry point]
16 ;GMVDATA CONSISTS OF THE FOLLOWING DATA:
17 ;FILE # 120.5 IEN^DUZ^INCORRECT DATE/TIME^INCORRECT READING^INCORRECT
18 ;PATIENT^INVALID RECORD
19 N GMVFDA,GMVIEN,GMVIENS
20 I '$D(^GMR(120.5,+GMVDATA,0))#2 S RESULT="ERROR: Record Not Found" Q
21 S GMVIENS=(+GMVDATA)_","
22 S GMVFDA(120.5,GMVIENS,2)=1
23 S GMVFDA(120.5,GMVIENS,3)=$P(GMVDATA,"^",2)
24 S GMVFDA(120.506,"+1,"_GMVIENS,.01)=$P(GMVDATA,"^",3)
25 D UPDATE^DIE("","GMVFDA","GMVIEN")
26 S RESULT="OK"
27 Q
28 ;
29ACTLOC(LOC) ; Function: returns TRUE if active hospital location
30 N D0,X I +$G(^SC(LOC,"OOS")) Q 0 ; screen out OOS entry
31 S D0=+$G(^SC(LOC,42)) I D0 D WIN^DGPMDDCF Q 'X ; chk out of svc wards
32 S X=$G(^SC(LOC,"I")) I +X=0 Q 1 ; no inactivate date
33 I DT>$P(X,U)&($P(X,U,2)=""!(DT<$P(X,U,2))) Q 0 ; chk reactivate date
34 Q 1 ; must still be active
35 ;
36PERSON(X) ;RETURN PERSON'S NAME FROM FILE #200.
37 N GMVNAME
38 Q:'X ""
39 S GMVNAME=$$GET1^DIQ(200,X,.01,"E")
40 Q $S(GMVNAME'="":GMVNAME,1:"")
41FILLER(L,S,STRING) ; Returns the number of filler characters desired.
42 ; L - larger number
43 ; S - smaller number
44 ; STRING - string of same characters (e.g., spaces)
45 ; Use spaces if STRING is not defined.
46 I $L(STRING)=0 S STRING=$$REPEAT^XLFSTR(" ",79) ;line of spaces
47 Q $E(STRING,1,L-S)
48 ;
49HOSPLOC(GMVWARD) ; Function returns Hospital Location IEN for a ward
50 ; Input:
51 ; GMVWARD - Ward (FILE 42) IEN
52 ; Returns:
53 ; Hospital Location (FILE 44) IEN for the ward
54 ; If GMVWARD'>0 or not found, then returns "" (null)
55 I $G(GMVWARD)'>0 Q "" ;illegal ward ien
56 Q $P($G(^DIC(42,+GMVWARD,44)),"^")
57 ;
58DIVISION(GMVLOC) ; Function returns Division name for Hospital Location
59 ; (FILE 44) IEN
60 ; Input:
61 ; GMVLOC - Hospital Location (FILE 44) IEN
62 ; Returns:
63 ; Division name (FILE 4) associated with that Hospital Location
64 ; If GMVLOC'>0 or not found, then returns "" (null)
65 I $G(GMVLOC)'>0 Q "" ;illegal hospital location
66 Q $S(GMVLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMVLOC,3,"I"),.01,"I"),1:"")
67 ;
Note: See TracBrowser for help on using the repository browser.