SELECT VisitID, AcctNumber, MedRecNumber, AdmDate, DischDate, AdmDt2, Days, LaceDate, LaceScore, DisYear, DisMonth, MRRank, Age, DC_DispID,
DC_DISPDescr, FinancialClassName, Name, RoomID, LOS, Physician, DiagnosisName,
MaritalStatus, Ethnicity, Zip, Language, DRG,
(SELECT TOP (1) ALOS
FROM dbo.vw_MedAssets_DRG_Tables AS t2
WHERE (CONVERT(numeric(5, 0), t1.DRG) = CONVERT(numeric(5, 0), DRG)) AND (t1.DischDate >= BegDate) AND (t1.DischDate <= EndDate))
AS ALOS,
(SELECT TOP (1) GLOS
FROM dbo.vw_MedAssets_DRG_Tables AS t2
WHERE (CONVERT(numeric(5, 0), t1.DRG) = CONVERT(numeric(5, 0), DRG)) AND (t1.DischDate >= BegDate) AND (t1.DischDate <= EndDate))
AS GLOS,
FacNote, ApptNote, FollowUpNote, BHIPNote, BHOPNote
FROM dbo.vw_Lace_Discharge_Readmit_Days AS t1