刘韬 6 years ago
parent
commit
8814284cbb

+ 17 - 0
DataFusion/src/com/zskk/control/ViewController.java

@@ -88,6 +88,23 @@ public class ViewController extends Controller {
 		}
 	}
 	
+	public void xz() {
+		try {
+			List<Report> reports = Report.dao.find("select * from report");
+			for (Report report : reports) {
+				if (report.getImpression().isEmpty()) {
+					Exams exams = Exams.dao.findById(report.getExamId());
+					exams.setExamStatus(3);
+					exams.update();
+					report.delete();
+				}
+			}
+		} catch (Exception e) {
+			// TODO: handle exception
+			this.renderText(e.toString());
+		}
+	}
+	
 	public void testTask() {
 		List<Exams> exams;
 		try {

+ 6 - 2
DataFusion/src/com/zskk/service/WeixinService.java

@@ -81,12 +81,16 @@ public class WeixinService {
 //		String iiString = getXmlInfo("dsfgbhnhgdfssnjhgfcnjmnhbf");
 		String iiString = "<response>\n" + 
 				"<code>0</code>\n" + 
-				"<ReportBean><birthdate>52/03/04</birthdate><modality>DR</modality><patientid>206630</patientid><patientsex>2</patientsex><reportPaperNum>206287</reportPaperNum><reportdate>2019-05-13 12:28:36</reportdate><diagnosis>咳嗽</diagnosis><description>    胸廓对称。两肺纹理走行粗重,左肺中野可见一18x18mm大小类圆形致密影。两肺门不大,气管、纵隔居中。心影大小、形态正常。两膈面光滑,两侧肋膈角锐利。</description><accessionNumber>206287</accessionNumber><patientname>张树莲</patientname><symptom></symptom><clinicaldoctor>刘丽君</clinicaldoctor><phone>18093137589</phone><printreport></printreport><idcard></idcard><patientage>67</patientage><impression>左肺结节影   建议进一步检查或复查</impression><regPaperNum>206287</regPaperNum><reviewdoctor>3369</reviewdoctor><department>DR</department><studyuid>1.2.840.1424321.23532.20190513113550206287</studyuid><printfilm></printfilm><reportdoctor>3369</reportdoctor></ReportBean>\n" + 
+				"<ReportBean><birthdate></birthdate><modality>DR</modality><patientid>206630</patientid><patientsex>2</patientsex><reportPaperNum>206287</reportPaperNum><reportdate>2019-05-13 12:28:36</reportdate><diagnosis>咳嗽</diagnosis><description>    胸廓对称。两肺纹理走行粗重,左肺中野可见一18x18mm大小类圆形致密影。两肺门不大,气管、纵隔居中。心影大小、形态正常。两膈面光滑,两侧肋膈角锐利。</description><accessionNumber>206287</accessionNumber><patientname>张树莲</patientname><symptom></symptom><clinicaldoctor>刘丽君</clinicaldoctor><phone>18093137589</phone><printreport></printreport><idcard></idcard><patientage>67</patientage><impression>左肺结节影   建议进一步检查或复查</impression><regPaperNum>206287</regPaperNum><reviewdoctor>3369</reviewdoctor><department>DR</department><studyuid>1.2.840.1424321.23532.20190513113550206287</studyuid><printfilm></printfilm><reportdoctor>3369</reportdoctor></ReportBean>\n" + 
 				"</response>";
 	    XmlHelper xmlHelper = XmlHelper.of(iiString);
-	    String title1 = xmlHelper.getString("//code[1]");
+	    String title1 = xmlHelper.getString("//ReportBean[1]/birthdate");
 	    System.out.println("cs");
 
+	    if (title1.isEmpty()) {
+		    System.out.println("c2s");
+
+		}
 	    System.out.println(title1);
 
 

+ 2 - 2
DataFusion/src/com/zskk/task/DataTask.java

@@ -28,7 +28,7 @@ public class DataTask implements ITask {
 	public void run() {
 		// TODO Auto-generated method stub
 		try {
-			List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=73090006 order by createdAt desc limit 50");
+			List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=73090006 order by createdAt desc limit 40");
 			for (Exams exams2 : exams) {
 				Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
 //				WeixinService wService = ServiceFactory.getService(WeixinService.class);
@@ -41,7 +41,7 @@ public class DataTask implements ITask {
 			    Report report = new Report().use("zskk");
 				report.setId(creatId());
 				report.setReportDatetime(parseStringToDate(xmlHelper.getString("//ReportBean[1]/reportdate")));
-				if (!xmlHelper.getString("//code[1]/").equals("0")) {
+				if (!xmlHelper.getString("//code[1]/").equals("0") || xmlHelper.getString("//ReportBean[1]/impression").isEmpty() || xmlHelper.getString("//ReportBean[1]/description").isEmpty()) {
 					continue;
 				}
 				report.setImpression(xmlHelper.getString("//ReportBean[1]/impression"));