VistA Analysis » VistA Reference » RPCs » ORWDBA1 GETORDX

ORWDBA1 GETORDX

ARRAY OF DIAGNOSES ASSOCIATED WITH AN ORDER

Properties

Property Value
Label GETORDX
MUMPS Implementation ORWDBA1
Return Type ARRAY

Input Parameters

Name Type Maximum Data Length Required Description
ORIEN REFERENCE 255 true ORDER INTERNAL REFERENCE NUMBER

MUMPS Method Description

Property Value
Method GETORDX^ORWDBA1
Method Comment Retrieve Diagnoses for an order - RPC
Input Parameters ORIEN
First Comment
 Input:
ORIEN Order Internal ID#
Output:
Y Array of Diagnoses (Dx) - Y(#)=#^DxInt#^ICD9^DxDesc^TxF
Variables used:
CT Counter for # of Dx related to order
DXIEN Dx internal ID
DXN Internal (to ^OR(100)) sequence # for Dx storage
DXREC Dx record from Order file
DXV Dx description
ICD9 External ICD9 #
TXFACTRS Treatment Factors (TxF)
Code
 N CT,DXIEN,DXN,DXREC,DXV,ICD9,ICDR,ORFMDAT,TXFACTRS
S (CT,DXN)=0
I '$G(^OR(100,ORIEN,0)) S Y=-1
I '$D(^OR(100,ORIEN,5.1,1,0)) S Y=0
E D S Y=CT
. ; Get order date for CSV/CTD/HIPAA usage
. S ORFMDAT=$$ORFMDAT^ORWDBA3(ORIEN)
. ; Go through all Dx's for an order
. F S DXN=$O(^OR(100,ORIEN,5.1,DXN)) Q:DXN'?1N.N D
.. ; Get diagnosis record and IEN
.. S DXREC=$G(^OR(100,ORIEN,5.1,DXN,0)),DXIEN=$P(DXREC,U)
.. S ICDR=$$ICDDATA^ICDXCODE("DIAGNOSIS",$G(DXIEN),ORFMDAT)
.. S DXV=$P(ICDR,U,4),ICD9=$P(ICDR,U,2)
.. ; Convert internal to external Treatment Factors
.. S TXFACTRS=$$TFGBLGUI(^OR(100,ORIEN,5.2))
.. S CT=CT+1,Y(CT)=DXN_U_$G(DXIEN)_U_ICD9_U_DXV_U_TXFACTRS

CPRS

File Type Description
NOT OSEHRA CPRS  


Document generated on August 31st 2022, 2:55:43 pm