|
@@ -6,6 +6,8 @@ import java.io.FileInputStream;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStreamReader;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.Map;
|
|
@@ -95,7 +97,7 @@ public class DataService {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws IOException, ParserConfigurationException {
|
|
|
- File fin_floder = new File("/Users/liutao/Desktop/test/test51.xml");
|
|
|
+ File fin_floder = new File("/Users/liutao/Desktop/test/test81.xml");
|
|
|
|
|
|
//创建从文件读取数据的FileInputStream流
|
|
|
FileInputStream fin;
|
|
@@ -122,25 +124,25 @@ public class DataService {
|
|
|
System.out.println(s);
|
|
|
XmlHelper xmlHelper = XmlHelper.of(s);
|
|
|
|
|
|
- int ount = 0;
|
|
|
NodeList nodeList = xmlHelper.getNodeList("/a/NativeDicomModel/DicomAttribute");
|
|
|
for (int i = 0; i < nodeList.getLength(); i++) {
|
|
|
NamedNodeMap as = nodeList.item(i).getAttributes();
|
|
|
if (as != null && as.getLength() > 0) {
|
|
|
for (int j = 0; j < as.getLength(); j++) {
|
|
|
- if (as.item(j).getNodeName().equals("keyword")) {
|
|
|
- if (as.item(j).getNodeValue().equals("StudyDate")) {
|
|
|
+ if (as.item(j).getNodeName().equals("tag")) {
|
|
|
+ if (as.item(j).getNodeValue().equals("0020000D")) {
|
|
|
String b =xmlHelper.getString("/a/NativeDicomModel["+i+"]/DicomAttribute["+j+"]/Value");
|
|
|
-
|
|
|
System.out.println(xmlHelper.getString(nodeList.item(i), "Value"));
|
|
|
- ount++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- System.out.println(ount);
|
|
|
-
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
+ Date date = new Date();
|
|
|
+ long dInteger = date.getTime() - 86400000;
|
|
|
+ String daString = sdf.format(new Date(dInteger));
|
|
|
+ System.out.println(daString);
|
|
|
} catch (FileNotFoundException e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|