PageSourceSearch

https://m.medsci.cn/js/scalc/globaljs.js

js medsci.cn collected 2026-10-02 03:20:52 UTC 8,747 bytes, 386 lines download raw bytes

1var pref = "si";
2
3
4var processed = 0;
5Number.prototype.between = function(a, b) {
6	return this >= a && this <= b
7};
8
9function Round(value, digits) {
10	d = Math.pow(10, digits);//x的y次方
11	return Math.round(value * d) / d//四舍五入
12}
13function Answer(ans) {
14	var el = $("#result");
15	el.val(ans);
16	processed = 1
17}
18function Answer2(ans) {
19	$("#result2").val(ans)
20}
21function Answer3(ans) {
22	$("#result3").val(ans)
23}
24function Answer4(ans) {
25	$("#result4").val(ans)
26}
27function Answer5(ans) {
28	$("#result5").val(ans)
29}
30function Answer6(ans) {
31	$("#result6").val(ans)
32}
33function Answer7(ans) {
34	$("#result7").val(ans)
35}
36function Answer8(ans) {
37	$("#result8").val(ans)
38}
39function Answer9(ans) {
40	$("#result9").val(ans)
41}
42function Answer10(ans) {
43	$("#result10").val(ans)
44}
45function Answer11(ans) {
46	$("#result11").val(ans)
47}
48function Answer12(ans) {
49	$("#result12").val(ans)
50}
51function Answer13(ans) {
52	$("#result13").val(ans)
53}
54function Answer14(ans) {
55	$("#result14").val(ans)
56}
57function Answer15(ans) {
58	$("#result15").val(ans)
59}
60function Answer16(ans) {
61	$("#result16").val(ans)
62}
63function Answer17(ans) {
64	$("#result17").val(ans)
65}
66function Answer18(ans) {
67	$("#result18").val(ans)
68}
69function Answer19(ans) {
70	$("#result19").val(ans)
71}
72function Answer20(ans) {
73	$("#result20").val(ans)
74}
75function Answer21(ans) {
76	$("#result21").val(ans)
77}
78function Answer22(ans) {
79	$("#result22").val(ans)
80}
81function Answer23(ans) {
82	$("#result23").val(ans)
83}
84function Answer24(ans) {
85	$("#result24").val(ans)
86}
87function Answer25(ans) {
88	$("#result25").val(ans)
89}
90function Answer26(ans) {
91	$("#result26").val(ans)
92}
93function Answer27(ans) {
94	$("#result27").val(ans)
95}
96function Answer28(ans) {
97	$("#result28").val(ans)
98}
99function Answer29(ans) {
100	$("#result29").val(ans)
101}
102function Answer30(ans) {
103	$("#result30").val(ans)
104}
105function Text(txt) {
106	$("#resultmsg").html(txt);
107	processed = 1
108}
109function Text2(txt) {
110	$("#resultmsg2").html(txt)
111}
112function Text3(txt) {
113	$("#resultmsg3").html(txt)
114}
115function Text4(txt) {
116	$("#resultmsg4").html(txt)
117}
118function Text5(txt) {
119	$("#resultmsg5").html(txt)
120}
121function Text6(txt) {
122	$("#resultmsg6").html(txt)
123}
124function Text7(txt) {
125	$("#resultmsg7").html(txt)
126}
127function Text8(txt) {
128	$("#resultmsg8").html(txt)
129}
130function Text9(txt) {
131	$("#resultmsg9").html(txt)
132}
133function Text10(txt) {
134	$("#resultmsg10").html(txt)
135}
136$(document).ready(function() {
137
138	$('#article_title').text($('#title h2').text());//12.5
139
140
141	$("#noneofthese").click(function() {
142		var y = {};
143		var req_radio_groups = {};
144		$("tr.req td input[type='radio']").each(function() {
145			$(this).style("border", "0px");
146			req_radio_groups[this.name] = true
147		});
148		for (group in req_radio_groups) {
149			if_checked = !! $("input[name=" + group + "]:checked").length;
150			val = $("input[name=" + group + "]:checked").val();
151			// if (if_checked == false) {
152			// 	return false
153			// }
154			// if (if_checked == true) {
155				y[group] = 0
156			// }
157		}
158		checkbox = $(".post form tr td input[type='checkbox']");
159		checkbox.each(function() {
160			name = $(this).attr("name");
161			y[name] = 0
162		});
163		inputs = $(".post form tr td input:text, .post form tr td input[type='checkbox']:checked");
164		inputs.each(function() {
165			name = $(this).attr("name");
166			val = $(this).val();
167			y[name] = 0
168		});
169		$(".post form tr [type='checkbox']").removeAttr("checked");
170		$(".post form tr input[type='radio']").removeAttr("checked");
171		$(".post form td ul li").removeClass("clicked");
172		MDCalc(y)
173	});
174	$("table input:not([id])").each(function() {
175		$(this).attr("id", $(this).attr("name"))
176	});
177	$(".post form tr.req td:last li").hover(function() {
178		$(this).toggleClass("hoverclass")
179	});
180	$(".post form tr td").has("[type='checkbox']").hover(function() {
181		$(this).find("label").toggleClass("hoverclass")
182	});
183	$(".post form tr.req td li").click(function() {
184		$(this).addClass("clicked").siblings("li").removeClass("clicked").end().find("input[type='radio']:eq(0)").attr("checked", "checked");
185		Verify()
186	});
187	$(".post form tr[class!=answer]").has("input").hover(function() {
188		$(this).children("td").toggleClass("texthover")
189	});
190	$(".post form tr td input:text").blur(function() {
191		Verify()
192	});
193	$(".post form tr td input[type='radio'], .post form tr td input[type='checkbox']").change(function() {
194		Verify()
195	});
196	$("#result").click(function() {
197		Verify()
198	});
199	$(".post form select").change(function() {
200		Verify()
201	});
202	inputs = $(".post form tr td input");
203
204	function Verify() {
205		if (processed == 1) {
206			$(".post form tr.answer td div").each(function() {
207				$(this).html("")
208			});
209			$(".post form tr.answer td input").each(function() {
210				$(this).val("")
211			})
212		}
213		var z = {};
214		var req_radio_groups = {};
215		$("tr.req td input[type='radio']").each(function() {
216			req_radio_groups[this.name] = true
217		});
218		for (group in req_radio_groups) {
219			if_checked = !! $("input[name=" + group + "]:checked").length;
220			val = $("input[name=" + group + "]:checked").val();
221			if (if_checked == false) {
222				// return false
223				z[group] = 0
224			}
225			if (if_checked == true) {
226				if (val == 0 || val == "0") {
227					z[group] = 0
228				} else if (typeof(val % 2) == "number") {
229					z[group] = val * 1
230				} else if (typeof val == "string") {
231					z[group] = val
232				} else {
233					z[group] = val * 1
234				}
235			}
236		}
237		var textreq = $("tr.req td input");
238		var i = 0;
239		textreq.each(function() {
240			if ($(this).val().length > 0) {
241				i++
242			}
243		});
244		if (textreq.length == i) {
245			checkbox = $(".post form tr td input[type='checkbox']");
246			checkbox.each(function() {
247				name = $(this).attr("name");
248				z[name] = 0
249			});
250			inputs = $(".post form tr td input[type='text'], .post form tr td input[type='checkbox']:checked");
251			inputs.each(function() {
252				name = $(this).attr("name");
253				val = $(this).val();
254				z[name] = val * 1
255			});
256			MDCalc(z);
257			$("tr.answer input").each(function() {
258				$(this).css("background", "#fff").css("color", "#0C5C8F")
259			})
260		}
261	}
262	var us = {};
263	var si = {};
264	us.ca = "mg/dL";
265	us.alb = "g/dL";
266	us.chol = "mg/dL";
267	us.trig = "mg/dL";
268	us.glu = "mg/dL";
269	us.hct = "%";
270	us.hgb = "g/dL";
271	us.na = "mEq/L";
272	us.k = "mEq/L";
273	us.cl = "mEq/L";
274	us.hco3 = "mEq/L";
275	us.bun = "mg/dL";
276	us.cr = "mg/dL";
277	us.wt = "磅";
278	us.ht = "英寸";
279	us.crclearance = "mL/min";
280	us.bili = "mg/dL";
281	us.nadeficit = "mEq";
282	us.osm = "mOsm/kg";
283	us.pa02 = "mm Hg";
284	us.pao2 = "mm Hg";
285	us.tidal = "mL/kg";
286	us.pheny = "mg/L";
287	us.a1c = "% total hemoglobin";
288	us.vrh = "平均动脉压";
289	us.vrm = "中心静脉压";
290	us.vrsvr = "SVR";
291	us.vrsvri = "SVRI";
292	us.bnp = "pg/mL";
293	us.mb = "ng/mL";
294	us.temp = "华氏度";
295	us.press = "mmH2O";
296	us.mmhg = "mm Hg";
297	us.pmol = "ng/mL";
298	us.μmol_l = "μg/dL";
299	us.insulin = "μIU/mL";
300	us.hcg = "ng/mL";
301	us.miu = "μIU/mL";
302	si.ca = "mmol/L";
303	si.alb = "g/L";
304	si.chol = "mmol/L";
305	si.trig = "mmol/L";
306	si.glu = "mmol/L";
307	si.hct = "fraction of RBCs";
308	si.hgb = "g/L";
309	si.na = "mmol/L";
310	si.k = "mmol/L";
311	si.cl = "mmol/L";
312	si.hco3 = "mmol/L";
313	si.bun = "mmol/L";
314	si.cr = "&mu;mol/L";
315	si.wt = "千克";
316	si.ht = "厘米";
317	si.crclearance = "mL/min";
318	si.bili = "&mu;mol/L";
319	si.nadeficit = "mmol";
320	si.osm = "mmoI/kg";
321	si.pao2 = "kPa";
322	si.pa02 = "kPa";
323	si.tidal = "mL/kg";
324	si.pheny = "&mu;mol/L";
325	si.a1c = "proportion total hemoglobin";
326	si.vrh = "平均肺动脉压";
327	si.vrm = "肺毛细血管契压";
328	si.vrsvr = "PVR";
329	si.vrsvri = "PVRI";
330	si.bnp = "pmol/L";
331	si.mb = "nmol/L";
332	si.temp = "摄氏度";
333	si.press = "Pa";
334	si.mmhg = "mm H2O";
335	si.pmol = "pmol/L";
336	si.μmol_l = "μmol/L";
337	si.insulin = "pmol/L";
338	si.hcg = "U/L";
339	si.miu = "mIU/L";
340	if (pref == "si") {
341		$('option[name="si"]').attr("selected", "selected");
342		$("#theform tr td label[class]").each(function() {
343			classs = $(this).attr("class");
344			$(this).html(si[classs])
345		})
346	}
347	if (pref == "us") {
348		$('option[name="us"]').attr("selected", "selected");
349		$("#theform tr td label[class]").each(function() {
350			classs = $(this).attr("class");
351			$(this).html(us[classs])
352		})
353	}
354	$("#units").change(function() {
355		pref = $(this).val();
356		if (pref == "us") {
357			$("#theform tr td label[class]").each(function() {
358				classs = $(this).attr("class");
359				$(this).html(us[classs])
360			})
361		}
362		if (pref == "si") {
363			$("#theform tr td label[class]").each(function() {
364				classs = $(this).attr("class");
365				$(this).html(si[classs])
366			})
367		}
368		Verify()
369	})
370	$("#unit_change").change(function() {
371		pref = $(this).val();
372		if (pref == "us") {
373			$("#theform tr td label[class]").each(function() {
374				classs = $(this).attr("class");
375				$(this).html(us[classs])
376			})
377		}
378		if (pref == "si") {
379			$("#theform tr td label[class]").each(function() {
380				classs = $(this).attr("class");
381				$(this).html(si[classs])
382			})
383		}
384		Verify()
385	})
386});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.