Appearance
JavaScript
javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://www.gongjuji.net/Content/files/jquery.md5.js"></script>
</head>
<body></body>
<script>
let base64Str = "xasdasdasd";
let Version = "v1";
let AppKey = "BoZqFkOxz1";
let AppSecret = "nG0oveXXuymXhGWs";
let Timestamp = Date.now();
let Signature = $.md5(Version + Timestamp + AppSecret);
let Authorization = AppKey + ":" + Signature;
// 报告单识别
let form = new FormData();
form.append("imgContents", base64Str);
$.ajax({
url: "https://openai.wesuresoft.com/api/ocr/report",
type: "POST",
data: form,
headers: {
Authorization: Authorization,
Version: "v1",
Timestamp: Timestamp,
},
processData: false,
contentType: false,
success: function (data) {
console.log(data);
},
});
// 疾病识别
const reqJson = {
scene: 300010,
diseases: [1302],
"items": {"gender": 1, "age": 40, "RBC": 4.33, "MCV": 95.9, "PDW": 16.7, "WBC": 6.12, "NEUT%": 61.7, "LYMPH%": 31.9,
"EO%": 1.8, "BASO%": 0.2, "NEUT#": 3.78, "LYMPH#": 1.95, "BASO#": 0.01, "HGB": 137,
"HCT": 0.415, "MCH": 31.6, "MCHC": 330, "R-CV": 13.3, "PLT": 147, "MPV": 11, "PCT": 0.16,
"MONO#": 0.27, "MONO%": 4.4, "EO#": 0.11
},
};
$.ajax({
url: "https://openai.wesuresoft.com/api/dis/predict",
type: "POST",
dataType: "json",
data: JSON.stringify(reqJson),
headers: {
Authorization: Authorization,
Version: "v1",
Timestamp: Timestamp,
},
contentType: "application/json",
success: function (data) {
console.log(data);
},
});
// 结果分析
const reqJson2 = {
plot: "waterfall",
requestId: "1541f6e20b6943c4b94a30db2eff8db2",
matchId: [1],
};
$.ajax({
url: "https://openai.wesuresoft.com/api/dis/explainer",
type: "POST",
dataType: "json",
data: JSON.stringify(reqJson2),
headers: {
Authorization: Authorization,
Version: "v1",
Timestamp: Timestamp,
},
contentType: "application/json",
success: function (data) {
console.log(data);
},
});
// 疾病科普
const reqJson3 = {
code: "1302"
};
$.ajax({
url: "https://openai.wesuresoft.com/api/dis/knowledge",
type: "POST",
dataType: "json",
data: JSON.stringify(reqJson3 ),
headers: {
Authorization: Authorization,
Version: "v1",
Timestamp: Timestamp,
},
contentType: "application/json",
success: function (data) {
console.log(data);
},
});
</script>
</html>