|
@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@ -52,6 +54,7 @@ public class JwArchivesService {
|
|
|
if("1".equals(data.optString("CODE")))
|
|
|
{
|
|
|
JSONArray jsonArray = data.getJSONArray("DATA");
|
|
|
List<JSONObject> jsonValues = new ArrayList<JSONObject>();
|
|
|
for (int i = 0; i < jsonArray.length(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
JSONObject mjson = new JSONObject();
|
|
@ -59,7 +62,18 @@ public class JwArchivesService {
|
|
|
mjson.put("orgName",jsonObject.get("ORG_NAME").toString());
|
|
|
mjson.put("medicalNo",medicalNo);
|
|
|
mjson.put("medicalTime",jsonObject.get("MEDICAL_TIME").toString());
|
|
|
re.put(mjson);
|
|
|
jsonValues.add(mjson);
|
|
|
}
|
|
|
Collections.sort( jsonValues, new Comparator<JSONObject>() {
|
|
|
@Override
|
|
|
public int compare(JSONObject a, JSONObject b) {
|
|
|
String valA = a.get("medicalTime").toString();
|
|
|
String valB = b.get("medicalTime").toString();
|
|
|
return valB.compareTo(valA);
|
|
|
}
|
|
|
});
|
|
|
for (JSONObject temp:jsonValues){
|
|
|
re.put(temp);
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
@ -119,10 +133,10 @@ public class JwArchivesService {
|
|
|
int i = 0;
|
|
|
while (flag){
|
|
|
i++;
|
|
|
Object ex = jsonObject.get(name+i);
|
|
|
if(ex == null){
|
|
|
if(jsonObject.isNull(name+i)){
|
|
|
flag = false;
|
|
|
}else {
|
|
|
Object ex = jsonObject.get(name+i);
|
|
|
String examinationExcep = ex.toString();
|
|
|
if(StringUtils.isEmpty(examinationExcep)){
|
|
|
flag = false;
|
|
@ -615,10 +629,10 @@ public class JwArchivesService {
|
|
|
int inhospitali = 0;
|
|
|
while (inhospitalFlag){
|
|
|
inhospitali++;
|
|
|
Object ex = jsonObject.get(inhospitalPatientId+inhospitali);
|
|
|
if(ex == null){
|
|
|
if(jsonObject.isNull(inhospitalPatientId+inhospitali)){
|
|
|
inhospitalFlag = false;
|
|
|
}else {
|
|
|
Object ex = jsonObject.get(inhospitalPatientId+inhospitali);
|
|
|
String examinationExcep = ex.toString();
|
|
|
if(StringUtils.isEmpty(examinationExcep)){
|
|
|
inhospitalFlag = false;
|
|
@ -646,10 +660,10 @@ public class JwArchivesService {
|
|
|
int fpi = 0;
|
|
|
while (fpFlag){
|
|
|
fpi++;
|
|
|
Object ex = jsonObject.get(fpPatientId+fpi);
|
|
|
if(ex == null){
|
|
|
if(jsonObject.isNull(fpPatientId+fpi)){
|
|
|
fpFlag = false;
|
|
|
}else {
|
|
|
Object ex = jsonObject.get(fpPatientId+fpi);
|
|
|
String examinationExcep = ex.toString();
|
|
|
if(StringUtils.isEmpty(examinationExcep)){
|
|
|
fpFlag = false;
|
|
@ -677,10 +691,10 @@ public class JwArchivesService {
|
|
|
int drugi = 0;
|
|
|
while (drugFlag){
|
|
|
drugi++;
|
|
|
Object ex = jsonObject.get(drugName+drugi);
|
|
|
if(ex == null){
|
|
|
if(jsonObject.isNull(drugName+drugi)){
|
|
|
drugFlag = false;
|
|
|
}else {
|
|
|
Object ex = jsonObject.get(drugName+drugi);
|
|
|
String examinationExcep = ex.toString();
|
|
|
if(StringUtils.isEmpty(examinationExcep)){
|
|
|
drugFlag = false;
|
|
@ -706,10 +720,10 @@ public class JwArchivesService {
|
|
|
int niVaccinationi = 0;
|
|
|
while (niVaccinationFlag){
|
|
|
niVaccinationi++;
|
|
|
Object ex = jsonObject.get(niVaccinationName+niVaccinationi);
|
|
|
if(ex == null){
|
|
|
if(jsonObject.isNull(niVaccinationName+niVaccinationi)){
|
|
|
niVaccinationFlag = false;
|
|
|
}else {
|
|
|
Object ex = jsonObject.get(niVaccinationName+niVaccinationi);
|
|
|
String examinationExcep = ex.toString();
|
|
|
if(StringUtils.isEmpty(examinationExcep)){
|
|
|
niVaccinationFlag = false;
|