Alter View
	[dbo].[vWorklistByWorklist]
As
Select
		wd.mWID,
		s.mGroup,
		s.mFullName,
		s.mShortName,
		s.mRespType,
		s.mIsTest,
		s.mDefaultResp,
		s.mDefaults,
		s.mTestNo,
		s.mGroupCode,
		s.mNumber,
		s.mSickNo,
		s.mTestID,
		s.mLinkName,
		s.mUnit,
		s.mPathology,
		s.mFormula,
		s.mSort,
		r.mDate,
		r.mTime,
		r.mSentFromNo,
		r.mInsureCode,
		r.mFName,
		r.mLName,
		r.mGender,
		r.mAge,
		r.mAgeUnit,
		r.mCanceled,
		r.mShowNo,
		r.mName,
		r.mPreShowNo,
		r.mEmergency,
		r.mDoctorName,
		r.mInsureName,
		r.mSentFromName,
		r.mPregnant,
		dbo.CheckResponseForWorklist(s.mResponse,'*') AS mResponse,
		dbo.IsResponseNullEmpty(s.mNumber) AS isRespNull,
		r.mResponseDate,
		r.mLackSamplse,
		r.mClinicalData,
		r.mMegaLabID,
		r.mMobile,
		s.mIsEmergency AS mIsEmergencyTest,
		r.[mMelliCode]
	From dbo.vRecItems as s
	Inner Join dbo.vReception As r ON s.mSickNo = r.mNumber
	Inner Join dbo.tblWDetails As wd ON s.mTestID = wd.mTestID
	WHERE (r.mCanceled = 0)