|
@ -6,6 +6,12 @@ import com.yihu.ehr.model.WSReturnModel;
|
|
|
import com.yihu.ehr.util.operator.StringUtil;
|
|
|
import org.apache.commons.dbcp2.BasicDataSource;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.util.ResourceUtils;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.File;
|
|
|
import java.io.FileReader;
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
/**
|
|
@ -108,36 +114,7 @@ public class ExcuteService {
|
|
|
|
|
|
//wsReturnModel.setData(jdbcTemplate.queryForList(sb.toString()));
|
|
|
// return WSReturnModel.toXml(wsReturnModel);
|
|
|
return "<Resp> \n" +
|
|
|
"<TransactionCode></TransactionCode> \n" +
|
|
|
"<RespMessage>成功</RespMessage>\n" +
|
|
|
"<Data>\n" +
|
|
|
"<ReportId>8F5F14C2-FAB8-4CB5-BB91-AECF0EC64E69</ReportId>\n" +
|
|
|
"<ReportType>1</ReportType>\n" +
|
|
|
"<SubmissionTime>2015-03-12 09:52:47.0</SubmissionTime>\n" +
|
|
|
"<PatientName>张三</PatientName>\n" +
|
|
|
"<ItemName>测试报告1</ItemName>\n" +
|
|
|
"<State>1</ State >\n" +
|
|
|
"<EventNo>事件号</EventNo>\n" +
|
|
|
"<EventType>就诊类型</EventType>\n" +
|
|
|
"<EventTime>就诊时间</EventTime>\n" +
|
|
|
"<LocalCardNo>就诊卡号</LocalCardNo>\n" +
|
|
|
"<IdCardNo>身份证号</IdCardNo>\n" +
|
|
|
"</Data> \n" +
|
|
|
"<Data>\n" +
|
|
|
"<ReportId>8F5F14C2-FAB8-4CB5-BB91-AECF0EC64E69</ReportId>\n" +
|
|
|
"<ReportType>1</ReportType>\n" +
|
|
|
"<SubmissionTime>2015-03-12 09:52:47.0</SubmissionTime>\n" +
|
|
|
"<PatientName>张三</PatientName>\n" +
|
|
|
"<ItemName>测试报告1</ItemName>\n" +
|
|
|
"<State>1</State>\n" +
|
|
|
"<EventNo>事件号</EventNo>\n" +
|
|
|
"<EventType>就诊类型</EventType>\n" +
|
|
|
"<EventTime>就诊时间</EventTime>\n" +
|
|
|
"<LocalCardNo>就诊卡号</LocalCardNo>\n" +
|
|
|
"<IdCardNo>身份证号</IdCardNo>\n" +
|
|
|
"</Data>\n" +
|
|
|
"</Resp>";
|
|
|
return getFileByPath("C:\\Documents and Settings\\Administrator\\桌面\\data\\GetReportList.xml");
|
|
|
} catch (Exception e) {
|
|
|
wsReturnModel.setTransactionCode("-30000");
|
|
|
wsReturnModel.setRespMessage(e.getMessage());
|
|
@ -152,13 +129,14 @@ public class ExcuteService {
|
|
|
* @param reportType
|
|
|
* @return
|
|
|
*/
|
|
|
public String getReportInfo(
|
|
|
public String GetReportInfo(
|
|
|
String TransactionCode,
|
|
|
String reportId,
|
|
|
String reportType) {
|
|
|
WSReturnModel wsReturnModel = new WSReturnModel();
|
|
|
wsReturnModel.setTransactionCode(TransactionCode);
|
|
|
try {
|
|
|
/*
|
|
|
initJDBC();
|
|
|
StringBuffer sb = new StringBuffer("select * from HDSD01_01 where 1=1 ");
|
|
|
if (!StringUtil.isEmpty(reportId)) {
|
|
@ -166,60 +144,10 @@ public class ExcuteService {
|
|
|
}
|
|
|
if (!StringUtil.isEmpty(reportType)) {
|
|
|
sb.append(" and HDSD00_01_001 > '" + reportType + "'");
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
// wsReturnModel.setData(jdbcTemplate.queryForList(sb.toString()));
|
|
|
return "<Resp> \n" +
|
|
|
"<TransactionCode></TransactionCode> \n" +
|
|
|
"<RespMessage>成功</RespMessage>\n" +
|
|
|
"<Data>\n" +
|
|
|
"\t<ReportTitle>报告单2</ReportTitle>\n" +
|
|
|
"\t<ClinicCard>K5698012</ClinicCard>\n" +
|
|
|
"\t<UserType>0</UserType>\n" +
|
|
|
"\t<HosBedNo>6</HosBedNo>\n" +
|
|
|
"\t<SigningTime>2015-03-09 09:52:47.0</SigningTime>\n" +
|
|
|
"\t<Checker>审核人2</Checker>\n" +
|
|
|
"\t<BarCode>456456456</BarCode>\n" +
|
|
|
"\t<Sex>2</Sex>\n" +
|
|
|
"\t<PatientName>李四</PatientName>\n" +
|
|
|
"\t<SampleNumber>Yao77822</SampleNumber>\n" +
|
|
|
"\t<SampleType>2</SampleType>\n" +
|
|
|
"\t<ApplicationDepartment>口腔科</ApplicationDepartment>\n" +
|
|
|
"\t<SubmissionTime>2015-03-10 09:52:47.0</SubmissionTime>\n" +
|
|
|
"\t<Rmark>牙齿蛀牙</Rmark>\n" +
|
|
|
"\t<ReportTime>2015-03-12 09:52:47.0</ReportTime>\n" +
|
|
|
"\t<Inspector>检验员2</Inspector>\n" +
|
|
|
"\t<ItemNum>2</ItemNum>\n" +
|
|
|
"\t<ClinicNo>门诊号</ClinicNo>\n" +
|
|
|
"\t<HosUserNo>住院号</HosUserNo>\n" +
|
|
|
"\t<Data_1>\n" +
|
|
|
"\t\t\t<ItemDetailsName>xxx1</ItemDetailsName>\n" +
|
|
|
"\t\t\t<ResultValue>xxx1</ResultValue>\n" +
|
|
|
"\t\t\t<Unit>分</Unit>\n" +
|
|
|
"\t\t\t<ReferenceValues>100~250</ReferenceValues>\n" +
|
|
|
"\t\t\t<IsNormal></IsNormal>\n" +
|
|
|
"<ExFlag></ExFlag>\n" +
|
|
|
"<Range></Range>\n" +
|
|
|
"<SeFlag></SeFlag>\n" +
|
|
|
"<Words></Words>\n" +
|
|
|
"<GermName></GermName>\n" +
|
|
|
"<GrowStatus></GrowStatus>\n" +
|
|
|
"\t</Data_1>\n" +
|
|
|
"\t<Data_1>\n" +
|
|
|
"\t\t\t<ItemDetailsName>xxx2</ItemDetailsName>\n" +
|
|
|
"\t\t\t<ResultValue>xxx2</ResultValue>\n" +
|
|
|
"\t\t\t<Unit>分</Unit>\n" +
|
|
|
"\t\t\t<ReferenceValues>100~250</ReferenceValues>\n" +
|
|
|
"\t\t\t<IsNormal></IsNormal>\n" +
|
|
|
"<ExFlag></ExFlag>\n" +
|
|
|
"<Range></Range>\n" +
|
|
|
"<SeFlag></SeFlag>\n" +
|
|
|
"<Words></Words>\n" +
|
|
|
"<GermName></GermName>\n" +
|
|
|
"<GrowStatus></GrowStatus>\n" +
|
|
|
"\t</Data_1>\n" +
|
|
|
" </Data>\n" +
|
|
|
"</Resp>";
|
|
|
return getFileByPath("C:\\Documents and Settings\\Administrator\\桌面\\data\\GetReportInfo.xml");
|
|
|
} catch (Exception e) {
|
|
|
wsReturnModel.setTransactionCode("-30000");
|
|
|
wsReturnModel.setRespMessage(e.getMessage());
|
|
@ -228,29 +156,26 @@ public class ExcuteService {
|
|
|
}
|
|
|
|
|
|
public String QueryUserInfo(String TransactionCode, String CardType, String CardNo, String Mobile, String PatientId) {
|
|
|
return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" +
|
|
|
"<Resp>\n" +
|
|
|
"<TransactionCode></TransactionCode>\n" +
|
|
|
"<RespMessage>成功</RespMessage>\n" +
|
|
|
"<RespCode>10000</RespCode>\n" +
|
|
|
"<Data>\n" +
|
|
|
"<PatientId>病人id</PatientId>\n" +
|
|
|
"<ClinicCard>就诊卡号</ClinicCard>\n" +
|
|
|
"<Name>用户姓名</Name>\n" +
|
|
|
"<Mobile>手机号码</Mobile>\n" +
|
|
|
"<McardNo>医保卡</McardNo>\n" +
|
|
|
"<Address>家庭住址</Address>\n" +
|
|
|
"<Sex>性别</Sex>\n" +
|
|
|
"<Fee>就诊卡余额</Fee>\n" +
|
|
|
"<BirthDay>出生日期</BirthDay>\n" +
|
|
|
"<Country>国籍</Country>\n" +
|
|
|
"<Nation>民族</Nation>\n" +
|
|
|
"<BloodCode1>血型代码:ABO</BloodCode1>\n" +
|
|
|
"<BloodCode2>HR血型代码</BloodCode2>\n" +
|
|
|
"<Allergens>过敏源</Allergens>\n" +
|
|
|
"<IdCardId>身份证</IdCardId>\n" +
|
|
|
"</Data>\n" +
|
|
|
"</Resp>";
|
|
|
WSReturnModel wsReturnModel = new WSReturnModel();
|
|
|
wsReturnModel.setTransactionCode(TransactionCode);
|
|
|
try {
|
|
|
/*
|
|
|
initJDBC();
|
|
|
StringBuffer sb = new StringBuffer("select * from HDSD01_01 where 1=1 ");
|
|
|
if (!StringUtil.isEmpty(reportId)) {
|
|
|
sb.append(" and HDSD00_05_026 < '" + reportId + "'");
|
|
|
}
|
|
|
if (!StringUtil.isEmpty(reportType)) {
|
|
|
sb.append(" and HDSD00_01_001 > '" + reportType + "'");
|
|
|
}*/
|
|
|
|
|
|
// wsReturnModel.setData(jdbcTemplate.queryForList(sb.toString()));
|
|
|
return getFileByPath("C:\\Documents and Settings\\Administrator\\桌面\\data\\QueryUserInfo.xml");
|
|
|
} catch (Exception e) {
|
|
|
wsReturnModel.setTransactionCode("-30000");
|
|
|
wsReturnModel.setRespMessage(e.getMessage());
|
|
|
return WSReturnModel.toXml(wsReturnModel);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
@ -267,6 +192,40 @@ public class ExcuteService {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}*/
|
|
|
System.out.println(getFileByPath("C:\\Users\\Administrator\\Desktop\\getReportInfo.xml"));
|
|
|
}
|
|
|
|
|
|
public static String getFileByPath(String path) {
|
|
|
BufferedReader reader = null;
|
|
|
FileReader fileReader = null;
|
|
|
try {
|
|
|
File cfgFile = ResourceUtils.getFile(path);
|
|
|
fileReader=new FileReader(cfgFile);
|
|
|
reader = new BufferedReader(fileReader);
|
|
|
String line;
|
|
|
String strContent = "";
|
|
|
while ((line = reader.readLine()) != null) {
|
|
|
strContent += line;
|
|
|
}
|
|
|
return strContent;
|
|
|
} catch (Exception e) {
|
|
|
return "";
|
|
|
} finally {
|
|
|
if(reader!=null){
|
|
|
try {
|
|
|
reader.close();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
if(fileReader!=null){
|
|
|
try {
|
|
|
fileReader.close();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|