VistA Analysis » VistA Reference » RPCs » OREVNTX LIST

OREVNTX LIST

Properties

Property Value
Label LIST
MUMPS Implementation OREVNTX
Return Type ARRAY

MUMPS Method Description

Property Value
Method LIST^OREVNTX
Method Comment Returns all processed events for patient DFN as
Input Parameters DFN
First Comment
    ORY(#) = PatEvtIEN ^ Display Text ^ EvtDateTime
in reverse chronological order
Code
 N IDT,DA,CNT,X0,X1,EVT,DC,X
S DFN=+$G(DFN),(IDT,CNT)=0
F S IDT=$O(^ORE(100.2,"AC",DFN,IDT)) Q:IDT<1 D
. S DA=0 F S DA=+$O(^ORE(100.2,"AC",DFN,IDT,DA)) Q:DA<1 D
.. S X0=$G(^ORE(100.2,DA,0)),X1=$G(^(1)) Q:$P(X1,U,5) ;has parent
.. S EVT=+$P(X0,U,2),DC=+$P(X1,U,3)
.. I '$P(X0,U,4),'$O(^ORE(100.2,DA,2,0)),'$O(^ORE(100.2,DA,3,0)),'$D(^OR(100,"AEVNT",DFN_";DPT(",DA)) Q ;no orders
.. S I=+$O(^ORE(100.2,DA,10,"B"),-1),X=$P($G(^(I,0)),U,2) I X="LP"!(X="CA") Q ;lapsed or cancelled
.. ;Q if not current admission?
.. S X=$S(EVT:$P($G(^ORD(100.5,EVT,0)),U,8),DC:$P($G(^ORD(100.6,DC,0)),U,5),1:"UNSPECIFIED EVENT")
.. S X=$$LOWER^VALM1(X),CNT=CNT+1,ORY(CNT)=DA_U_X_U_$P(X1,U)
S:CNT ORY(0)=CNT

CPRS

File Type Description
Pascal File Orders/rOrders.pas


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