VistA Analysis » VistA Reference » RPCs » ORWDBA2 GETDUDC

ORWDBA2 GETDUDC

This returns a list of unique ICD9 diagnoses codes and their descriptions on orders placed by a clinician for a patient for today. This will be used to help in filling out the encounter form.

Properties

Property Value
Label GETDUDC
MUMPS Implementation ORWDBA2
Return Type ARRAY

Input Parameters

Name Type Maximum Data Length Required Description
ORCIEN REFERENCE 255 true This is the clinician's internal ID number.
ORPTIEN REFERENCE 255 true This is the patient's internal ID number.

MUMPS Method Description

Property Value
Method GETDUDC^ORWDBA2
Method Comment Get Day's Unique Diagnoses Codes
Input Parameters ORCIEN, ORPTIEN
First Comment
Gets all the unique ICD9 codes for the orders placed today by the
clinician for this patient. Using the ICD9 codes it builds an array
variable with the ICD9 code, its description from the ICD DIAGNOSIS
file, #80. Flagging any inactive ICD9 codes with a "#".
Input Variables:
ORCIEN Clinician's internal ID number
ORPTIEN Patient's internal ID number
Output Variable:
Y Array of ICD9 codes and descriptions
Y(#)=ICD9_code^DX_Description^DX_Inactive
If inactive # in third piece
If active null in third piece
Local Variables:
CKDATE Check Date (stops loop)
DXC Diagnosis Code (for sorting)
DXD Diagnosis Description
DXI Diagnosis Inactive Flag
DXIEN Diagnosis Internal Entry Number
ICD9 ICD9 code (for GUI display)
IEN Internal Entry Number
OBJORD Object of Order
ORDATE Order Date
ORDG Order Group (ACT index variable)
OREM Order Error Message
ORIEN Order Internal Entry Number
ORRF Order Record Found
RCODI Reverse Cronological Order Date Index
SUBFILE Subfile Number
Code
 N CKDATE,DXC,DXD,DXEM,DXI,DXIEN,DXRF,ICD9,IEN,OBJORD,ORDATE,ORDG,OREM
N ORIEN,ORRF,RCODI,SUBFILE
S OBJORD=ORPTIEN_";DPT("
S (DXIEN,ORDATE,ORDG,ORIEN,RCODI)="",CKDATE=$$F24HA
F S RCODI=$O(^OR(100,"ACT",OBJORD,RCODI)) S ORDATE=9999999-RCODI Q:ORDATE . F S ORDG=$O(^OR(100,"ACT",OBJORD,RCODI,ORDG)) Q:ORDG="" D
.. S ORIEN=$QS($Q(^OR(100,"ACT",OBJORD,RCODI,ORDG)),6)
.. K ORRF,OREM
.. D GETS^DIQ(100,ORIEN,"1;5.1*","I","ORRF","OREM")
.. S IEN=$QS($Q(ORRF(100)),2)
.. Q:ORRF(100,IEN,1,"I")'=ORCIEN
.. Q:$D(ORRF(100.051))=0
.. S (DXC,DXD,DXI,DXIEN,ICD9,IEN)=""
.. F S IEN=$O(ORRF(100.051,IEN)) Q:IEN="" D
... Q:ORRF(100.051,IEN,.01,"I")=""
... S DXIEN=ORRF(100.051,IEN,.01,"I")
... S ICD9=$$GET1^DIQ(80,DXIEN,.01,"")
... S DXC=$$SETDXC(ICD9)
... S DXD=$$SETDXD($P($$ICDDATA^ICDXCODE("DIAGNOSIS",ICD9,ORDATE),U,4))
... S DXI=$$SETDXI($$STATCHK^ICDXCODE("DIAGNOSIS",ICD9,ORDATE))
... S Y(DXC)=ICD9_U_DXD_U_DXI

CPRS

File Type Description
Pascal File BA/UBACore.pas


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