source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVCHAR.m@ 1438

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

initial load of WorldVistAEHR

File size: 1.4 KB
Line 
1GMRVCHAR ;HIRMFO/YH-EXTRACT CHARACTERISTIC DATA ;5/1/97
2 ;;4.0;Vitals/Measurements;**1**;Apr 25, 1997
3CHAR(GDA,GARRY,X) ;
4 ; Input data:
5 ; GDA - Pointer to patient vitals/measurements file #120.5
6 ; X - Pointer to the vital type file #120.51
7 ; Output data array:
8 ; GARRY(GDA,print order,qualifier data)
9 N GMRVORDR,GMRVDA,GMRVCAT,GMRVCHAR
10 S GMRVDA(1)=0 F S GMRVDA(1)=$O(^GMR(120.5,GDA,5,"B",GMRVDA(1))) Q:GMRVDA(1)'>0 D
11 . Q:'$D(^GMRD(120.52,GMRVDA(1),0)) S GMRVCHAR=$P($G(^GMRD(120.52,GMRVDA(1),0)),"^")
12 . S GMRVDA(2)=$O(^GMRD(120.52,GMRVDA(1),1,"B",X,0)) I GMRVDA(2)'>0 S GARRY(GDA,1,GMRVCHAR)="" Q
13 . S GMRVCAT=+$P($G(^GMRD(120.52,GMRVDA(1),1,GMRVDA(2),0)),"^",2)
14 . S GMRVCAT(1)=$O(^GMRD(120.53,"C",X,GMRVCAT,0)) Q:GMRVCAT(1)'>0
15 . Q:'$D(^GMRD(120.53,GMRVCAT,1,GMRVCAT(1)))
16 . S GMRVORDR=+$P($G(^GMRD(120.53,GMRVCAT,1,GMRVCAT(1),0)),"^",5) I GMRVORDR=0 S GMRVORDR=1
17 . S GARRY(GDA,GMRVORDR,GMRVCHAR)=""
18 . Q
19 Q
20WRITECH(GDA,GARRY,GN) ;
21 ; Input data:
22 ; GDA - Pointer to the patient vitals/measurements data file #120.5
23 ; GARRY - qualifier data array for a measurement
24 ; GARRY(GDA,Print order,qualifier data)
25 ; GN - Number of print order to print
26 N GMRVDA,GDATA
27 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
28 . S GDATA=GDATA_$S(GDATA'="":", ",1:"")_GMRVDA(2)
29 Q GDATA
Note: See TracBrowser for help on using the repository browser.