source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVGETQ.m@ 1258

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1GMVGETQ ;HOIFO/YH,FT-UTILITIES TO OBTAIN DATE/TIME, HOSPITAL, DUZ, VITAL CATEGORY AND EDIT V/M ;9/6/02 09:35
2 ;;5.0;GEN. MED. REC. - VITALS;**3**;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10103 - ^XLFDT calls (supported)
6 ;
7 ; This routine supports the following IAs:
8 ; #4353 - GMV CONVERT DATE RPC is called at GETDT (private)
9 ;
10GETDT(RESULT,GMRDATE) ;GMV CONVERT DATE [RPC entry point]
11 ;INPUT VARIABLE:
12 ;GMRDATE - DATE/TIME FROM EDIT.TEXT ENTERED BY USER
13 ;OUTPUT VARIABLE:
14 ;RESULT - CONTAINS INTERNAL AND EXTERNAL DATE/TIME
15 N GDATE D DT^DILF("ETS",GMRDATE,.GDATE)
16 I $G(GDATE)'>0 S RESULT="" Q
17 I $G(GDATE)>$$NOW^XLFDT S RESULT="" Q
18 S RESULT=$G(GDATE)_"^"_$G(GDATE(0))
19 Q
20 ;
21ADDQUAL(RESULT,GMRVDATA) ; Add qualifiers to FILE 120.5 entry
22 ; ADD QUALIFIER TO 120.505 SUBFILE
23 ; Input:
24 ; GMRVDATA=120.5 IEN^QUALIFIER (120.52) IEN
25 ; Output:
26 ; RESULT = "" or the IEN of the subfile entry
27 ;
28 N GMVCNT,GMVERR,GMVFDA,GMVOKAY,GMRVIEN,GMRVQUAL
29 S GMRVIEN=+$P(GMRVDATA,"^",1) ;File 120.5 ien
30 S GMRVQUAL=+$P(GMRVDATA,"^",2) ;File 120.52 ien
31 ; Does File 120.5 entry exist?
32 I '$D(^GMR(120.5,GMRVIEN,0)) D Q
33 .S RESULT=""
34 .;or S RESULT="-1^Vitals entry not found."
35 .Q
36 ; Is the qualifier already stored?
37 I $O(^GMR(120.5,GMRVIEN,5,"B",GMRVQUAL,0))>0 D Q
38 .S RESULT=""
39 .;or S RESULT="-1^Qualifier already filed. No change made."
40 .Q
41 ; Legitimate Qualifier?
42 I '$D(^GMRD(120.52,GMRVQUAL,0)) D Q
43 .S RESULT=""
44 .; or S RESULT="-1^"_$P(GMRVDATA,U,2)_" is not a legitimate qualifier"
45 .Q
46 S GMVCNT=0 ;counter for number of tries to lock an entry
47B2 ; Lock the entry
48 I GMVCNT>3 D Q ;4 strikes and you're out
49 .S RESULT=""
50 .;or S RESULT="-1^Could not lock entry to file qualifiers."
51 .L -^GMR(120.5,GMRVIEN,0)
52 .Q
53 L +^GMR(120.5,GMRVIEN,0):1
54 S GMVCNT=GMVCNT+1
55 I '$T L -^GMR(120.5,GMRVIEN,0) G B2
56 ; Store the qualifier
57 S GMVFDA(120.505,"+1,"_GMRVIEN_",",.01)=GMRVQUAL
58 D UPDATE^DIE("","GMVFDA","GMVOKAY","GMVERR")
59 L -^GMR(120.5,GMRVIEN,0)
60 I $D(GMVERR) S RESULT="" ; or S RESULT="-1^*fileman error message*"
61 E S RESULT=+$G(GMVOKAY(1))
62 Q
Note: See TracBrowser for help on using the repository browser.