江苏工伤联网结算采用HTTP POST方式提供服务,通过统一的接口地址处理所有工伤相关业务。
接口地址: POST http://localhost:8321/api/entry/workinjury
请求头:
Content-Type: application/json
| 功能 | action值 | 说明 |
|---|---|---|
| 系统初始化 | init | 初始化工伤联网系统 |
| 业务交易 | transaction | 处理各种工伤业务交易 |
| 健康检查 | health | 检查系统健康状态 |
| 获取统计 | stats | 获取系统运行统计 |
| 签到状态 | signin_status | 查询当前签到状态 |
| 批量上传 | batch_upload | 批量上传处方明细 |
| 完整流程 | complete_process | 一键完成就医流程 |
| 智能重试 | retry | 智能重试失败的交易 |
| 交易冲正 | reverse | 冲正指定交易 |
POST http://localhost:8321/api/entry/workinjury
{
"action": "init"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "init",
"config": {
"fixmedinsCode": "H32132200561",
"fixmedinsName": "宿迁沭阳铭和医院",
"receiverSysCode": "JSYTH",
"interfaceVersion": "V2.1",
"operatorType": "1",
"defaultOperator": "001",
"defaultOperatorName": "系统管理员",
"logPath": "logs/workinjury/"
}
}
响应示例:
{
"success": true,
"code": 200,
"message": "江苏工伤联网系统初始化成功",
"device": "江苏工伤联网接口",
"timestamp": "2024-12-01 10:30:00",
"version": "V2.1"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "health"
}
响应示例:
{
"success": true,
"code": 200,
"message": "系统健康状态良好",
"data": {
"overallHealth": true,
"timestamp": "2024-12-01 10:35:00",
"checks": {
"dllStatus": {
"success": true,
"message": "JSSiInterface.dll文件检查通过"
},
"initStatus": {
"initialized": true,
"hasConfig": true
},
"signInStatus": {
"signedIn": true,
"signNo": "20241201001",
"signInTime": "2024-12-01 09:00:00"
}
}
}
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "transaction",
"transactionName": "签到"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "transaction",
"transactionName": "读卡",
"identifyMode": "1"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "transaction",
"transactionName": "RegisterPatient",
"businessParams": {
"psn_no": "32010219800101001X",
"visit_type": "1",
"dept_code": "001",
"dept_name": "骨科",
"doctor_code": "DOC001",
"doctor_name": "张主任"
},
"identifyMode": "1",
"operatorId": "001",
"operatorName": "收费员"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "transaction",
"transactionName": "PreSettle",
"businessParams": {
"visit_no": "V20241201001",
"fee_details": [
{
"fee_ocur_time": "2024-12-01 10:30:00",
"med_list_codg": "001",
"med_list_name": "拍片费",
"fee_amt": 120.00,
"cnt": 1
},
{
"fee_ocur_time": "2024-12-01 10:35:00",
"med_list_codg": "002",
"med_list_name": "诊疗费",
"fee_amt": 15.00,
"cnt": 1
}
]
}
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "transaction",
"transactionName": "Settle",
"businessParams": {
"visit_no": "V20241201001",
"pre_settle_id": "PS20241201001"
}
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "transaction",
"transactionName": "9001"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "transaction",
"transactionName": "ReadCard",
"identifyMode": "2",
"qrCodeInfo": "QRCODE_DATA_HERE"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "batch_upload",
"patientId": "P123456",
"visitNo": "V20241201001",
"prescriptions": [
{
"med_list_codg": "MED001",
"med_list_name": "阿司匹林",
"cnt": 2,
"pric": 25.50
},
{
"med_list_codg": "MED002",
"med_list_name": "布洛芬",
"cnt": 1,
"pric": 18.80
}
]
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "complete_process",
"patientInfo": {
"visit_type": "1",
"dept_code": "001",
"dept_name": "骨科",
"doctor_code": "DOC001",
"doctor_name": "张主任"
},
"feeDetails": [
{
"fee_ocur_time": "2024-12-01 10:30:00",
"med_list_codg": "001",
"med_list_name": "拍片费",
"fee_amt": 120.00,
"cnt": 1
}
]
}
响应示例:
{
"success": true,
"code": 200,
"message": "工伤就医流程完成",
"processSteps": [
{
"step": 1,
"name": "读卡",
"success": true,
"message": "读卡成功",
"data": {
"psn_no": "32010219800101001X",
"psn_name": "张三"
}
},
{
"step": 2,
"name": "登记",
"success": true,
"message": "登记成功",
"data": {
"visit_no": "V20241201001"
}
},
{
"step": 3,
"name": "预结算",
"success": true,
"message": "预结算成功",
"data": {
"pre_settle_id": "PS20241201001"
}
},
{
"step": 4,
"name": "结算",
"success": true,
"message": "结算成功",
"data": {
"settle_id": "S20241201001",
"total_amt": 135.00,
"fund_amt": 108.00,
"self_amt": 27.00
}
}
]
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "retry",
"transactionName": "PreSettle",
"businessParams": {
"visit_no": "V20241201001",
"fee_details": [...]
},
"maxRetries": 3,
"baseDelayMs": 1000
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "reverse",
"originalMessageId": "H0000120241201103000010001"
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "signin_status"
}
响应示例:
{
"success": true,
"code": 200,
"message": "签到状态获取成功",
"data": {
"signedIn": true,
"signNo": "20241201001",
"signInTime": "2024-12-01 09:00:00",
"signInOperator": "001",
"sessionDuration": "93分钟"
}
}
POST http://localhost:8321/api/entry/workinjury
{
"action": "stats"
}
响应示例:
{
"success": true,
"code": 200,
"message": "统计信息获取成功",
"data": {
"currentTime": "2024-12-01 10:33:00",
"systemStatus": {
"initialized": true,
"signedIn": true,
"signInTime": "2024-12-01 09:00:00",
"currentSignNo": "20241201001",
"signInOperator": "001"
},
"transactionRecords": {
"totalCount": 15,
"oldestRecord": "2024-12-01 09:05:00",
"newestRecord": "2024-12-01 10:30:00"
},
"configuration": {
"fixmedinsCode": "H32132200561",
"fixmedinsName": "宿迁沭阳铭和医院",
"interfaceVersion": "V2.1",
"logPath": "logs/workinjury/"
}
}
}
{
"success": false,
"code": 1005,
"message": "transactionName参数不能为空",
"device": "江苏工伤联网接口"
}
| 错误码范围 | 说明 |
|---|---|
| 1000-1099 | 系统级错误 |
| 2000-2999 | DLL调用错误 |
| 3000-3999 | 业务处理错误 |
{
"success": false,
"code": 1002,
"message": "action参数不能为空",
"device": "江苏工伤联网接口"
}
{
"success": false,
"code": 3001,
"message": "人员未参保工伤保险",
"transactionCode": "1101",
"businessErrorCode": "1001",
"businessErrorMsg": "人员未参保工伤保险"
}
// 初始化工伤系统
function initWorkInjury() {
$.ajax({
url: 'http://localhost:8321/api/entry/workinjury',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
"action": "init",
"config": {
"fixmedinsCode": "H32132200561",
"fixmedinsName": "宿迁沭阳铭和医院"
}
}),
success: function(result) {
if (result.success) {
console.log('工伤系统初始化成功');
} else {
console.error('初始化失败:', result.message);
}
},
error: function(xhr, status, error) {
console.error('请求失败:', error);
}
});
}
// 工伤患者读卡
function readWorkInjuryCard() {
$.ajax({
url: 'http://localhost:8321/api/entry/workinjury',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
"action": "transaction",
"transactionName": "读卡",
"identifyMode": "1"
}),
success: function(result) {
if (result.success) {
var cardData = result.data;
console.log('读卡成功,患者:', cardData.psn_name);
// 处理读卡结果...
} else {
console.error('读卡失败:', result.message);
}
}
});
}
// 工伤患者结算
function settleWorkInjury(visitNo, feeDetails) {
// 先预结算
$.ajax({
url: 'http://localhost:8321/api/entry/workinjury',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
"action": "transaction",
"transactionName": "PreSettle",
"businessParams": {
"visit_no": visitNo,
"fee_details": feeDetails
}
}),
success: function(preResult) {
if (preResult.success) {
// 预结算成功,进行正式结算
$.ajax({
url: 'http://localhost:8321/api/entry/workinjury',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
"action": "transaction",
"transactionName": "Settle",
"businessParams": {
"visit_no": visitNo,
"pre_settle_id": preResult.data.pre_settle_id
}
}),
success: function(settleResult) {
if (settleResult.success) {
console.log('结算成功');
// 处理结算结果...
} else {
console.error('结算失败:', settleResult.message);
}
}
});
} else {
console.error('预结算失败:', preResult.message);
}
}
});
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class WorkInjuryHttpClient
{
private readonly HttpClient _httpClient;
private readonly string _baseUrl = "http://localhost:8321/api/entry/workinjury";
public WorkInjuryHttpClient()
{
_httpClient = new HttpClient();
}
// 初始化工伤系统
public async Task<dynamic> InitializeAsync()
{
var request = new
{
action = "init"
};
var json = JsonConvert.SerializeObject(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync(_baseUrl, content);
var responseJson = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject(responseJson);
}
// 工伤交易
public async Task<dynamic> ProcessTransactionAsync(string transactionName, object businessParams = null)
{
var request = new
{
action = "transaction",
transactionName = transactionName,
businessParams = businessParams
};
var json = JsonConvert.SerializeObject(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync(_baseUrl, content);
var responseJson = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject(responseJson);
}
// 完整就医流程
public async Task<dynamic> CompleteProcessAsync(object patientInfo, object[] feeDetails)
{
var request = new
{
action = "complete_process",
patientInfo = patientInfo,
feeDetails = feeDetails
};
var json = JsonConvert.SerializeObject(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync(_baseUrl, content);
var responseJson = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject(responseJson);
}
}
// 使用示例
class Program
{
static async Task Main(string[] args)
{
var client = new WorkInjuryHttpClient();
// 初始化
var initResult = await client.InitializeAsync();
Console.WriteLine($"初始化结果: {initResult.success}");
// 读卡
var readCardResult = await client.ProcessTransactionAsync("读卡");
Console.WriteLine($"读卡结果: {readCardResult.success}");
// 登记
var registerParams = new
{
visit_type = "1",
dept_code = "001",
dept_name = "骨科"
};
var registerResult = await client.ProcessTransactionAsync("RegisterPatient", registerParams);
Console.WriteLine($"登记结果: {registerResult.success}");
}
}
江苏工伤联网结算HTTP接口提供了:
通过 action 参数区分不同操作,通过 transactionName 参数处理17种工伤交易类型,大大简化了接口集成复杂度。