﻿{"id":5861,"date":"2014-07-31T06:05:17","date_gmt":"2014-07-30T21:05:17","guid":{"rendered":"http:\/\/fujiitoshiki.com\/improvesociety\/?p=5861"},"modified":"2017-04-27T16:49:03","modified_gmt":"2017-04-27T07:49:03","slug":"how-to-create-scalar-function-of-sql-server-in-order-to-define-npna","status":"publish","type":"post","link":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=5861","title":{"rendered":"How to create scalar function of SQL Server in order to define nPNA?"},"content":{"rendered":"<div class=\"theContentWrap-ccc\"><p>The Japanese Society for Dialysis Therapy (JSDT) recommends PCR as an indicator of protein intake. Otherwise K\/DOQQI recommends nPNA. If you calculate Kt\/V with Daugirdas&#8217; method, you can also define nPNA. <\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+%5Cmathrm%7BnPNA%7D+%3D+%5Cfrac%7BC_0%7D%7B36.3+%2B+5.48%5Ctimes%5Cmathrm%7BKt%2FV%7D+%2B+53.5%2F%5Cmathrm%7BKt%2FV%7D%7D+%2B+0.168+%5C%5C++%3D+%5Cfrac%7B%5Cmathrm%7BpreBUN%7D%7D%7B36.3+%2B+5.48%5Ctimes%5Cmathrm%7BKt%2FV%7D+%2B+53.5+%2F+%5Cmathrm%7BKt%2FV%7D%7D+%2B+0.168+%5Ccdots%284%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle \\mathrm{nPNA} = \\frac{C_0}{36.3 + 5.48\\times\\mathrm{Kt\/V} + 53.5\/\\mathrm{Kt\/V}} + 0.168 \\\\  = \\frac{\\mathrm{preBUN}}{36.3 + 5.48\\times\\mathrm{Kt\/V} + 53.5 \/ \\mathrm{Kt\/V}} + 0.168 \\cdots(4)' title='\\displaystyle \\mathrm{nPNA} = \\frac{C_0}{36.3 + 5.48\\times\\mathrm{Kt\/V} + 53.5\/\\mathrm{Kt\/V}} + 0.168 \\\\  = \\frac{\\mathrm{preBUN}}{36.3 + 5.48\\times\\mathrm{Kt\/V} + 53.5 \/ \\mathrm{Kt\/V}} + 0.168 \\cdots(4)' class='latex' \/><\/p>\n<p>Execute the following procedure. <\/p>\n<pre>\r\nCREATE FUNCTION Function_nPNA \r\n(\t\t@preBUN\t\tDEC(4, 1)\r\n\t,\t@postBUN\tDEC(4, 1)\r\n\t,\t@preWeight\tDEC(4, 1)\r\n\t,\t@postWeight\tDEC(4, 1)\r\n\t,\t@DialysisDuration\tint\r\n)\r\nRETURNS DEC(3, 2)\r\nAS\r\nBEGIN\r\n\tDECLARE @nPNA\tDEC(3, 2)\r\n\tSELECT\t@nPNA = @preBUN\r\n\t\/\t(36.3 + 5.48 * (dbo.Function_KtV(@preBUN, @postBUN, @preWeight, @postWeight, @DialysisDuration))\r\n\t+\t\t\t53.5 \/ (dbo.Function_KtV(@preBUN, @postBUN, @preWeight, @postWeight, @DialysisDuration)))\r\n\t+\t0.168\r\n\tRETURN\t@nPNA\r\nEND\r\n<\/pre>\n<p>Reference: <a href=\"\/\/fujiitoshiki.com\/improvesociety\/?p=97\" target=\"_blank\">Simplified nutritional screening tools for patients on maintenance hemodialysis<\/a><br \/>\n<iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/ws-na.amazon-adsystem.com\/widgets\/q?ServiceVersion=20070822&#038;OneJS=1&#038;Operation=GetAdHtml&#038;MarketPlace=US&#038;source=ss&#038;ref=ss_til&#038;ad_type=product_link&#038;tracking_id=improsocie-20&#038;marketplace=amazon&#038;region=US&#038;placement=0123820227&#038;asins=0123820227&#038;linkId=LXJBROSN54NZGFQG&#038;show_border=true&#038;link_opens_in_new_window=true\"><br \/>\n<\/iframe><iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/ws-na.amazon-adsystem.com\/widgets\/q?ServiceVersion=20070822&#038;OneJS=1&#038;Operation=GetAdHtml&#038;MarketPlace=US&#038;source=ss&#038;ref=ss_til&#038;ad_type=product_link&#038;tracking_id=improsocie-20&#038;marketplace=amazon&#038;region=US&#038;placement=B00JI50L0M&#038;asins=B00JI50L0M&#038;linkId=TBXDLJXWCL2FZME3&#038;show_border=true&#038;link_opens_in_new_window=true\"><br \/>\n<\/iframe><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>The Japanese Society for Dialysis Therapy (JSDT) recommends PCR as an indicator of protein intake. Otherwise K &hellip; <a href=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=5861\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;How to create scalar function of SQL Server in order to define nPNA?&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6024,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1,11,4],"tags":[134,129,130,135,132,131,133,137,136,128],"class_list":["post-5861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-healthcare","category-nutrition","tag-daugirdas","tag-jsdt","tag-kdoqqi","tag-ktv","tag-npna","tag-pcr","tag-protein-intake","tag-scalar-function","tag-sql-server","tag-the-japanese-society-for-dialysis-therapy"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/5861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5861"}],"version-history":[{"count":6,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/5861\/revisions"}],"predecessor-version":[{"id":7772,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/5861\/revisions\/7772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/media\/6024"}],"wp:attachment":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}