Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORRCQLPT

ORRCQLPT.m

Go to the documentation of this file.
  1. ORRCQLPT ; SLC/TH - CPRS Query Tools - Libraries ; 25 Jul 2003 9:31 AM
  1. ;;1.0;CARE MANAGEMENT;;Jul 15, 2003
  1. ;
  1. PTDFN(VAL,ID) ; Return patient info given an order, consult, or note
  1. N DFN,X,X0,X1,X101
  1. S VAL="",DFN=0,X=$P(ID,":")
  1. I X="ORD"!(X="CST") S DFN=+$P(^OR(100,+$P(ID,":",2),0),U,2)
  1. I X="DOC" S DFN=+$P(^TIU(8925,+$P(ID,":",2),0),U,2)
  1. I X="PTC" S DFN=+$P(ID,":",2)
  1. ;I X="VST" visits too?
  1. Q:'DFN
  1. S VAL=DFN
  1. Q
  1. ;
  1. PTDEMOS(ORY,DFN) ; Return patient info
  1. ; ORY="<dfn>^<name>^<ssn>^<dob>^<age>"
  1. ; RPC = ORRCQLPT PTDEMOS
  1. N VADM,VA,VAERR
  1. D DEM^VADPT
  1. S ORY=DFN_U_VADM(1)_U_VA("PID")_U_$$FMTHL7^XLFDT(+VADM(3))_U_VADM(4)
  1. Q
  1. ;
  1. TESTPTD(DFN) ; Test PTDEMOS
  1. N ORY
  1. D PTDEMOS(.ORY,DFN)
  1. W !,ORY
  1. Q