source: FOIAVistA/trunk/r/GEN_MED_OTHER-GMV/GMVCHAR.m@ 1754

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

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1GMVCHAR ;HIOFO/YH,FT-EXTRACT CHARACTERISTIC DATA ;11/8/01 14:33
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; <None>
6 ;
7CHAR(GDA,GARRY,X) ;
8 ; Input data:
9 ; GDA - Pointer to patient vitals/measurements file #120.5
10 ; X - Pointer to the vital type file #120.51
11 ; Output data array:
12 ; GARRY(GDA,print order,qualifier data)
13 N GMRVORDR,GMRVDA,GMRVCAT,GMRVCHAR
14 S GMRVDA(1)=0 F S GMRVDA(1)=$O(^GMR(120.5,GDA,5,"B",GMRVDA(1))) Q:GMRVDA(1)'>0 D
15 . Q:'$D(^GMRD(120.52,GMRVDA(1),0)) S GMRVCHAR=$P($G(^GMRD(120.52,GMRVDA(1),0)),"^")
16 . S GMRVDA(2)=$O(^GMRD(120.52,GMRVDA(1),1,"B",X,0)) I GMRVDA(2)'>0 S GARRY(GDA,1,GMRVCHAR)="" Q
17 . S GMRVCAT=+$P($G(^GMRD(120.52,GMRVDA(1),1,GMRVDA(2),0)),"^",2)
18 . S GMRVCAT(1)=$O(^GMRD(120.53,"C",X,GMRVCAT,0)) Q:GMRVCAT(1)'>0
19 . Q:'$D(^GMRD(120.53,GMRVCAT,1,GMRVCAT(1)))
20 . S GMRVORDR=+$P($G(^GMRD(120.53,GMRVCAT,1,GMRVCAT(1),0)),"^",5) I GMRVORDR=0 S GMRVORDR=1
21 . S GARRY(GDA,GMRVORDR,GMRVCHAR)=""
22 . Q
23 Q
24WRITECH(GDA,GARRY,GN) ;
25 ; Input data:
26 ; GDA - Pointer to the patient vitals/measurements data file #120.5
27 ; GARRY - qualifier data array for a measurement
28 ; GARRY(GDA,Print order,qualifier data)
29 ; GN - Number of print order to print
30 N GMRVDA,GDATA
31 S GDATA="",GMRVDA(1)=0 F S GMRVDA(1)=$O(GARRY(GDA,GMRVDA(1))) Q:GMRVDA(1)'>0!(GMRVDA(1)>GN) S GMRVDA(2)="" F S GMRVDA(2)=$O(GARRY(GDA,GMRVDA(1),GMRVDA(2))) Q:GMRVDA(2)="" D
32 . S GDATA=GDATA_$S(GDATA'="":", ",1:"")_GMRVDA(2)
33 Q GDATA
Note: See TracBrowser for help on using the repository browser.