How to define Kt/V, an indicator of the efficiency of dialysis, as scalar function of SQL Server?

Pocket

In Japan, Shinzato’s fomula for calculating Kt/V, an indicator of efficiency of dialysis, is recommended by JSDT. Since integral equation is used to solve Shinzato’s method, you couldn’t solve algebraically. In K/DOQQI, it is usual to solve Kt/V with Daugirdas’ method. Shinzato has described that Daugirdas’ Kt/V is similar to Shinzato’s Kt/V.

\displaystyle \mathrm{Kt/V} = - LN( R - 0.08 \times t ) + \left[ 4 - \left( 3.5 \times R \right) \right] \times\frac{\mathrm{UF}}{\mathrm{W}}\\  = - LN \left( \frac{\mathrm{postBUN}}{\mathrm{preBUN}} - 0.008 \times t \right) + \left[ 4 - \left( 3.5 \times \frac{\mathrm{postBUN}}{\mathrm{preBUN}} \right) \right] \times \frac{\mathrm{preWeight} - \mathrm{postWeight}}{\mathrm{postWeight}} \cdots(1)
\displaystyle \mathrm{Gw} = \mathrm{G}\cdot\mathrm{Tw} = \mathrm{Kd}\int_{0}^{Td}C_1dt + \mathrm{Kd}\int_{0}^{Td}C_2dt + \mathrm{Kd}\int_{0}^{Td}C_3dt \cdots(2)
\displaystyle \mathrm{Ce} = \mathrm{Cs} Exp\left( - \frac{\mathrm{Kt}}{\mathrm{V}} \right) + \frac{\mathrm{G}}{\mathrm{K}}\left[ 1 - Exp\left( - \frac{\mathrm{Kt}}{\mathrm{V}} \right) \right] \cdots(3)

Execute the procedure as following;

CREATE FUNCTION Function_KtV 
(		@preBUN DEC(4, 1)
	,	@postBUN DEC(4, 1)
	,	@preWeight	DEC(4, 1)
	,	@postWeight DEC(4, 1)
	,	@DialysisDuration	int
)
RETURNS DEC(3,2)
AS
BEGIN
	DECLARE	@KtV DEC(3, 2)
	SELECT	@KtV = - LOG(@postBUN / @preBUN - 0.008 * @DialysisDuration / 60) 
					+ (4 - (3.5 * @postBUN / @preBUN))
					* ((@preWeight - @postWeight) / @postWeight)
	RETURN	@KtV
END
GO

References: JSDT 29 (12): 1511-1516, 1996

Second Generation Logarithmic Estimates of Single-Pool Variable Volume

Pocket

投稿者: admin

趣味:写真撮影とデータベース. カメラ:TOYO FIELD, Hasselblad 500C/M, Leica M6. SQL Server 2008 R2, MySQL, Microsoft Access.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です