ALTER VIEW [dbo].[vRecItems]
AS
SELECT
		r.mTotalPriceKhadamat, 
		r.mFranshizKhadamat, 
		r.mInsurePortionKhadamat, 
		i.mGroup, 
		i.mIntCode, 
		i.mFullName, 
		i.mShortName, 
		i.mCompare, 
		i.mRespType, 
		i.mPathology, 
		i.mIsTest, 
		i.mLinkedTest, 
		i.mColNo, 
		i.mStyle, 
		i.mFormula, 
		i.mDefaultResp, 
		i.mDefaults, 
		i.mInsureRepeat, 
		i.mReportFile, 
		l.mName AS mSentToName, 
		i.mUserCode AS mTestNo, 
		i.mGroupCode, 
		r.mNumber, 
		r.mSickNo, 
		r.mResponseNum, 
		r.mComments, 
		r.mLRCompareGreen, 
		r.mHRCompareGreen, 
		r.mLRCompareYellow, 
		r.mHRCompareYellow, 
		r.mLRCompareRed, 
		r.mHRCompareRed, 
		r.mLRCompareBlack, 
		r.mHRCompareBlack, 
		r.mText, 
		r.mSentToNo, 
		r.mDemanded, 
		r.mResponse, 
		r.mNoRepeat, 
		r.mTestID, 
		r.mState, 
		r.mtext1, 
		r.mtext2, 
		r.mtext3, 
		r.mtext4, 
		r.mtext5, 
		r.mtext6, 
		r.msamplecode, 
		r.mText1Lang, 
		r.mText2Lang, 
		r.mText3Lang, 
		r.mText4Lang, 
		r.mText5Lang, 
		r.mPrice, 
		r.mBetesta, 
		t.mShortName AS mLinkName, 
		r.mMySampleType, 
		r.mSickLinkNo, 
		r.mBethesda, 
		r.mPhoto1, 
		r.mPhoto2, 
		r.mPhoto1Prn, 
		r.mPhoto2Prn, 
		r.mText2Plain, 
		r.mText3Plain, 
		r.mText4Plain, 
		r.mText5Plain, 
		i.mSort, 
		i.mRegShow, 
		i.mReqSample, 
		r.mRespUser, 
		i.mPatCodingStyle, 
		r.mIsFree, 
		i.mGroupNo, 
		r.mReportInsure, 
		i.mHVal, 
		i.mLVal, 
		r.mUnit, 
		i.mGroupSort, 
		i.mGroupPrintName, 
		i.mGroupPrintType, 
		i.mGroupComment, 
		i.mTestRecDescription, 
		i.mIntCode2, 
		i.mIsGenetic, 
		r.mICDO, 
		i.mTestRecDescEnabled, 
		r.mIsEmergency, 
		t.mShortName AS mMasterShortName, 
		r.mHistory, 
		r.mTPrice, 
		r.mFPrice, 
		i.mMegaLabID, 
		i.mMegaLabEnabled, 
		r.mGUID, 
		i.mIntCode3, 
		i.mKProf, 
		i.mKTech,
		r.[TaminId],
		r.[SalamatId],
		r.[RepeatTest]
	FROM dbo.tblRecItems As r
	INNER JOIN dbo.vItems As i ON r.mTestID = i.mNumber
	LEFT OUTER JOIN dbo.tblLabs As l ON r.mSentToNo = l.mNumber
	LEFT OUTER JOIN dbo.vTestItems As t ON i.mLinkedTest = t.mNumber