|
@ -45,8 +45,272 @@ public class JwSmjkService {
|
|
|
@Autowired
|
|
|
SystemDictService systemDictService;
|
|
|
|
|
|
|
|
|
/****************************************************************************************************************************/
|
|
|
/**
|
|
|
* 获取门/急诊记录 + 住院记录
|
|
|
*/
|
|
|
public String getResidentEventListJson(String strSSID,String type,String page,String pageSize)
|
|
|
{
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
|
{
|
|
|
return "";
|
|
|
}
|
|
|
else {
|
|
|
String re = "";
|
|
|
try {
|
|
|
String url = jwUrl + "/third/smjk/ResidentEventList";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
if (!StringUtils.isEmpty(type)) {
|
|
|
params.add(new BasicNameValuePair("type", type));
|
|
|
}
|
|
|
params.add(new BasicNameValuePair("page", page));
|
|
|
params.add(new BasicNameValuePair("pageSize", pageSize));
|
|
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject responseObject = new JSONObject(response);
|
|
|
int status = responseObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
String data = responseObject.getString("data");
|
|
|
if (!StringUtils.isEmpty(data) && data.startsWith("error")) {
|
|
|
throw new Exception(re);
|
|
|
} else {
|
|
|
JSONObject jsonData = new JSONObject(data);
|
|
|
JSONArray jsonArray = jsonData.getJSONArray("EventList");
|
|
|
re = jsonArray.toString();
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception(responseObject.getString("msg"));
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 通过event获取档案类型列表
|
|
|
*/
|
|
|
public String getEventCatalog(String strEvent)
|
|
|
{
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
|
{
|
|
|
return "";
|
|
|
}
|
|
|
else {
|
|
|
try {
|
|
|
String url = jwUrl + "/third/smjk/EventCatalog";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strEvent", strEvent));
|
|
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
String result = "";
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
result = jsonObject.getString("data");
|
|
|
}
|
|
|
else {
|
|
|
throw new Exception(jsonObject.getString("msg"));
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ex.printStackTrace();
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取健康档案信息详情
|
|
|
*/
|
|
|
public String getHealthData(String strSSID, String strEvent, String strCatalog, String strSerial) {
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
|
{
|
|
|
return ehrService.getHealthData(strSSID,strEvent,strCatalog,strSerial);
|
|
|
}
|
|
|
else {
|
|
|
try {
|
|
|
String url = jwUrl + "/third/smjk/HealthData";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
params.add(new BasicNameValuePair("strEvent", strEvent));
|
|
|
params.add(new BasicNameValuePair("strCatalog", strCatalog));
|
|
|
params.add(new BasicNameValuePair("strSerial", strSerial));
|
|
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
String result = "";
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
result = jsonObject.getString("data");
|
|
|
result = result.replaceAll("<\\?xml version=\"1.0\" encoding=\"utf-8\"\\?>", "");
|
|
|
if (result.startsWith("error")) {
|
|
|
throw new Exception(result);
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
throw new Exception(jsonObject.getString("msg"));
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ex.printStackTrace();
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取检查检验列表
|
|
|
*/
|
|
|
public String getExamAndLabReport(String strSSID,String page,String pageSize)
|
|
|
{
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
|
{
|
|
|
return "";
|
|
|
}
|
|
|
else {
|
|
|
try {
|
|
|
String url = jwUrl + "/third/smjk/ExamAndLabReport";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
params.add(new BasicNameValuePair("page", page));
|
|
|
params.add(new BasicNameValuePair("pageSize", pageSize));
|
|
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
String re = "";
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
String data = jsonObject.getString("data");
|
|
|
if (!StringUtils.isEmpty(data) && data.startsWith("error")) {
|
|
|
throw new Exception(re);
|
|
|
} else {
|
|
|
JSONObject jsonData = new JSONObject(data);
|
|
|
JSONArray jsonArray = jsonData.getJSONArray("EhrList");
|
|
|
re = jsonArray.toString();
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception(jsonObject.getString("msg"));
|
|
|
}
|
|
|
} else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ex.printStackTrace();
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取用药列表
|
|
|
*/
|
|
|
public String getDrugsListPage(String strSSID,String page,String pageSize) throws Exception
|
|
|
{
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
|
{
|
|
|
return "";
|
|
|
}
|
|
|
else {
|
|
|
String url = jwUrl + "/third/smjk/DrugsListPage";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
params.add(new BasicNameValuePair("page", page));
|
|
|
params.add(new BasicNameValuePair("pageSize", pageSize));
|
|
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
String result = "";
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
result = jsonObject.getString("data");
|
|
|
}
|
|
|
else {
|
|
|
throw new Exception(jsonObject.getString("msg"));
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/****************************************************************************************************************************/
|
|
|
/**
|
|
|
* 获取住院记录
|
|
|
* 获取转诊预约医生号源信息
|
|
|
*/
|
|
|
public String getRegDeptSpeDoctorSectionList(String OrgCode,String DeptCode,String strStart,String strEnd,String DocCode) throws Exception
|
|
|
{
|
|
|
String re = "";
|
|
|
String url = jwUrl + "/third/smjk/RegDeptSpeDoctorSectionList";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("OrgCode", OrgCode));
|
|
|
params.add(new BasicNameValuePair("DeptCode", DeptCode));
|
|
|
params.add(new BasicNameValuePair("strStart", strStart));
|
|
|
params.add(new BasicNameValuePair("strEnd", strEnd));
|
|
|
params.add(new BasicNameValuePair("DocCode", DocCode));
|
|
|
|
|
|
return HttpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************** 旧版本函数 *************************************************************************/
|
|
|
/**
|
|
|
* 获取住院记录(X)
|
|
|
*/
|
|
|
public String getHospitalizationRecord(String strSSID, String startNum, String endNum) throws Exception {
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
@ -137,7 +401,7 @@ public class JwSmjkService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取门/急诊记录
|
|
|
* 获取门/急诊记录(X)
|
|
|
*/
|
|
|
public String getOutpatientRecord(String strSSID, String startNum, String endNum) throws Exception {
|
|
|
|
|
@ -229,87 +493,7 @@ public class JwSmjkService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取门/急诊记录 + 住院记录
|
|
|
*/
|
|
|
public String getResidentEventListJson(String strSSID,String type,String page,String pageSize) throws Exception
|
|
|
{
|
|
|
String re = "";
|
|
|
String url = jwUrl + "/third/smjk/ResidentEventList";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
if(!StringUtils.isEmpty(type))
|
|
|
{
|
|
|
params.add(new BasicNameValuePair("type", type));
|
|
|
}
|
|
|
params.add(new BasicNameValuePair("page", page));
|
|
|
params.add(new BasicNameValuePair("pageSize", pageSize));
|
|
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
|
if (!StringUtils.isEmpty(response)){
|
|
|
JSONObject responseObject = new JSONObject(response);
|
|
|
int status = responseObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
String data = responseObject.getString("data");
|
|
|
if (!StringUtils.isEmpty(data) && re.startsWith("error")) {
|
|
|
throw new Exception(re);
|
|
|
}
|
|
|
else{
|
|
|
JSONObject jsonData = new JSONObject(data);
|
|
|
JSONArray jsonArray = jsonData.getJSONArray("EhrList");
|
|
|
re = jsonArray.toString();
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
throw new Exception(responseObject.getString("msg"));
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
throw new Exception("null response.");
|
|
|
}
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取健康档案信息
|
|
|
*/
|
|
|
public String getHealthData(String strSSID, String strEvent, String strCatalog, String strSerial) throws Exception {
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
|
{
|
|
|
return ehrService.getHealthData(strSSID,strEvent,strCatalog,strSerial);
|
|
|
}
|
|
|
else {
|
|
|
String url = jwUrl + "/third/smjk/HealthData";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("strSSID", strSSID));
|
|
|
params.add(new BasicNameValuePair("strEvent", strEvent));
|
|
|
params.add(new BasicNameValuePair("strCatalog", strCatalog));
|
|
|
params.add(new BasicNameValuePair("strSerial", strSerial));
|
|
|
|
|
|
String response = HttpClientUtil.post(url, params, "UTF-8");
|
|
|
String result = "";
|
|
|
if (!StringUtils.isEmpty(response)) {
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
int status = jsonObject.getInt("status");
|
|
|
if (status == 200) {
|
|
|
result = jsonObject.getString("data");
|
|
|
result = result.replaceAll("<\\?xml version=\"1.0\" encoding=\"utf-8\"\\?>", "");
|
|
|
if (result.startsWith("error")) {
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/***************************************************************************************************************************/
|
|
|
/**
|
|
|
* 获取检查报告信息
|
|
|
* 获取检查报告信息 (X)
|
|
|
*/
|
|
|
private JSONArray getChecking(String strSSID, String startNum, String endNum) throws Exception {
|
|
|
String api = "/third/smjk/ExamReport";
|
|
@ -317,7 +501,7 @@ public class JwSmjkService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取检验报告信息
|
|
|
* 获取检验报告信息(X)
|
|
|
*/
|
|
|
private JSONArray getInspection(String strSSID, String startNum, String endNum) throws Exception {
|
|
|
String api = "/third/smjk/LabReport";
|
|
@ -396,7 +580,7 @@ public class JwSmjkService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取检查检验 信息
|
|
|
* 获取检查检验 信息(X)
|
|
|
* @param strSSID
|
|
|
* @param startNum
|
|
|
* @param endNum
|
|
@ -446,10 +630,9 @@ public class JwSmjkService {
|
|
|
return total.toString();
|
|
|
}
|
|
|
}
|
|
|
/****************************************************************************************************************************/
|
|
|
|
|
|
/**
|
|
|
* 获取用药记录
|
|
|
* 获取用药记录(X)
|
|
|
*/
|
|
|
public String getDrugsList(String strSSID, String startNum,String endNum) throws Exception {
|
|
|
if(SystemConf.getInstance().getEhrUsed()) //演示环境
|
|
@ -538,23 +721,4 @@ public class JwSmjkService {
|
|
|
return resultArray.toString();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取转诊预约医生号源信息
|
|
|
*/
|
|
|
public String getRegDeptSpeDoctorSectionList(String OrgCode,String DeptCode,String strStart,String strEnd,String DocCode) throws Exception
|
|
|
{
|
|
|
String re = "";
|
|
|
String url = jwUrl + "/third/smjk/RegDeptSpeDoctorSectionList";
|
|
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("OrgCode", OrgCode));
|
|
|
params.add(new BasicNameValuePair("DeptCode", DeptCode));
|
|
|
params.add(new BasicNameValuePair("strStart", strStart));
|
|
|
params.add(new BasicNameValuePair("strEnd", strEnd));
|
|
|
params.add(new BasicNameValuePair("DocCode", DocCode));
|
|
|
|
|
|
return HttpClientUtil.post(url, params, "UTF-8");
|
|
|
|
|
|
}
|
|
|
}
|