VistA Analysis » VistA Reference » RPCs » ORQPT WARD PATIENTS

ORQPT WARD PATIENTS

Function returns a list of patients on a ward.

Properties

Property Value
Label WARDPTS
MUMPS Implementation ORQPTQ2
Return Type ARRAY

Input Parameters

Name Type Maximum Data Length Required Description
WARD ID LITERAL 16 true The record number of the ward from the Ward Location File (#42).

MUMPS Method Description

Property Value
Method WARDPTS^ORQPTQ2
Method Comment RETURN LIST OF PATIENTS IN A WARD
Input Parameters WARD
First Comment
 SLC/PKS - Modifications for Room/Bed data on  1/19/2001.
Code
 I +$G(WARD)<1 S Y(1)="^No ward identified" Q 
N ORI,DFN,RBDAT
S ORI=1,DFN=0
S WARD=$P(^DIC(42,WARD,0),"^") ;GET WARD NAME FOR "CN" LOOKUP
F D Q:DFN'>0
.S DFN=$O(^DPT("CN",WARD,DFN)) Q:DFN'>0
.S Y(ORI)=+DFN_"^"_$P(^DPT(+DFN,0),"^")
.S RBDAT=""
.; Add patient room/bed information where data exists:
.S RBDAT=$P($G(^DPT(+DFN,.101)),U)
.I RBDAT'="" D ; Any R/B data?
..I $L(RBDAT)<4 S RBDAT=RBDAT_" " ; Add if < 4 chars.
..S RBDAT=$E(RBDAT,1,4) ; Get first 4 only.
.S Y(ORI)=Y(ORI)_U_RBDAT ; Add R/B to string
.S ORI=ORI+1 ; Increment counter.
S:+$G(Y(1))<1 Y(1)="^No patients found."

CPRS

File Type Description
NOT OSEHRA CPRS  


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