source: FOIAVistA/trunk/r/CARE_MANAGEMENT-ORRC/ORRCQLPT.m@ 1288

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

initial load of FOIAVistA 6/30/08 version

File size: 707 bytes
Line 
1ORRCQLPT ; SLC/TH - CPRS Query Tools - Libraries ; 25 Jul 2003 9:31 AM
2 ;;1.0;CARE MANAGEMENT;;Jul 15, 2003
3 ;
4PTDFN(VAL,ID) ; Return patient info given an order, consult, or note
5 N DFN,X,X0,X1,X101
6 S VAL="",DFN=0,X=$P(ID,":")
7 I X="ORD"!(X="CST") S DFN=+$P(^OR(100,+$P(ID,":",2),0),U,2)
8 I X="DOC" S DFN=+$P(^TIU(8925,+$P(ID,":",2),0),U,2)
9 I X="PTC" S DFN=+$P(ID,":",2)
10 ;I X="VST" visits too?
11 Q:'DFN
12 S VAL=DFN
13 Q
14 ;
15PTDEMOS(ORY,DFN) ; Return patient info
16 ; ORY="<dfn>^<name>^<ssn>^<dob>^<age>"
17 ; RPC = ORRCQLPT PTDEMOS
18 N VADM,VA,VAERR
19 D DEM^VADPT
20 S ORY=DFN_U_VADM(1)_U_VA("PID")_U_$$FMTHL7^XLFDT(+VADM(3))_U_VADM(4)
21 Q
22 ;
23TESTPTD(DFN) ; Test PTDEMOS
24 N ORY
25 D PTDEMOS(.ORY,DFN)
26 W !,ORY
27 Q
Note: See TracBrowser for help on using the repository browser.