source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORQPTQ4.m@ 1211

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

initial load of WorldVistAEHR

File size: 1.4 KB
RevLine 
[613]1ORQPTQ4 ; slc/CLA - Extrinsic functions for patient information ;12/15/97
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
3 Q
4DOB(DFN) ; extrinsic function to return patient date of birth:
5 N VADM
6 D DEM^VADPT
7 Q VADM(3)
8AGE(DFN) ; extrinsic function to return patient age:
9 N VADM
10 D DEM^VADPT
11 Q VADM(4)
12SEX(DFN) ; extrinsic function to return patient sex:
13 N VADM
14 D DEM^VADPT
15 Q VADM(5)
16WT(DFN) ; extrinsic function to return patient weight:
17 K ^UTILITY($J,"GMRVD")
18 S GMRVSTR(0)="^^^",GMRVSTR="WT"
19 D EN1^GMRVUT0
20 N ORT,ORD,ORY
21 S ORT="",ORD=0,ORY=""
22 S ORT=$O(^UTILITY($J,"GMRVD","WT",ORT)) I $L($G(ORT)) D
23 .S ORD=$O(^(ORT,ORD)) I $L($G(ORD)) D
24 ..S ORY=ORD_"^"_$P(^(ORD),"^",8)_"^"_$P(^(ORD),"^")
25 K GMRVSTR,^UTILITY($J,"GMRVD")
26 Q ORY
27HT(DFN) ; extrinsic function to return patient height:
28 K ^UTILITY($J,"GMRVD")
29 S GMRVSTR(0)="^^^",GMRVSTR="HT"
30 D EN1^GMRVUT0
31 N ORT,ORD,ORY
32 S ORT="",ORD=0,ORY=""
33 S ORT=$O(^UTILITY($J,"GMRVD","HT",ORT)) I $L($G(ORT)) D
34 .S ORD=$O(^(ORT,ORD)) I $L($G(ORD)) D
35 ..S ORY=ORD_"^"_$P(^(ORD),"^",8)_"^"_$P(^(ORD),"^")
36 K GMRVSTR,^UTILITY($J,"GMRVD")
37 Q ORY
38PRIM(DFN) ; extrinsic function to return patient primary provider
39 ; based on current patient location
40 N ORQPRIM
41 K VAINDT S VA200=1
42 D INP^VADPT ;get inpatient's primary provider
43 S ORQPRIM=VAIN(2)
44 K VAIN,VA200,VAERR
45 Q:$L($G(ORQPRIM)) ORQPRIM
46 S ORQPRIM=$$OUTPTPR^SDUTL3(DFN,"","") ;get outpatient's primary provider
47 S:'$L($G(ORQPRIM)) ORQPRIM=U_"Not found"
48 Q ORQPRIM
Note: See TracBrowser for help on using the repository browser.