|
@@ -54,7 +54,7 @@ public class THR03076 extends QCCatalogue {
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
//抗生素及开医嘱时间 <抗生素名,<抗生素用量,[抗生素使用时间...]>>
|
|
|
- Map<String, Map<Double, List<String>>> antibioticInfo = Maps.newLinkedHashMap();
|
|
|
+ Map<String, Map<String, List<Double>>> antibioticInfo = Maps.newLinkedHashMap();
|
|
|
String drugName = null, value = null, startDateStr = null;
|
|
|
for (Map<String, String> structMap : docAdvStruct) {
|
|
|
drugName = structMap.get("医嘱项目名称");
|
|
@@ -65,7 +65,7 @@ public class THR03076 extends QCCatalogue {
|
|
|
}
|
|
|
|
|
|
//抗生素及开医嘱时间 <抗生素名,<抗生素用量,[抗生素使用时间...]>>
|
|
|
- Map<String, Map<Double, List<String>>> antibioticWardInfo = Maps.newLinkedHashMap();
|
|
|
+ Map<String, Map<String, List<Double>>> antibioticWardInfo = Maps.newLinkedHashMap();
|
|
|
String dateStr = null;
|
|
|
/*********************************************查房记录********************************************************/
|
|
|
if (threeLevelWardDocs.size() > 0) {
|
|
@@ -115,42 +115,26 @@ public class THR03076 extends QCCatalogue {
|
|
|
*/
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
String drugKey = null;
|
|
|
- for (Map.Entry<String, Map<Double, List<String>>> ai : antibioticInfo.entrySet()) {
|
|
|
+ for (Map.Entry<String, Map<String, List<Double>>> ai : antibioticInfo.entrySet()) {
|
|
|
drugKey = ai.getKey();
|
|
|
String drugStandardWord = similarityUtil.getDrugStandardWord(drugKey);
|
|
|
if (StringUtil.isNotBlank(drugStandardWord)) {
|
|
|
drugKey = drugStandardWord;
|
|
|
}
|
|
|
- if (!antibioticWardInfo.containsKey(drugKey)) {
|
|
|
- for (Map.Entry<Double, List<String>> ad : ai.getValue().entrySet()) {
|
|
|
- for (String date : ad.getValue()) {
|
|
|
- infoAppend(sb, drugKey, ad.getKey(), date);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- Map<Double, List<String>> adValueDate = ai.getValue();
|
|
|
- Map<Double, List<String>> wardValueDate = antibioticWardInfo.get(drugKey);
|
|
|
- for (Map.Entry<Double, List<String>> adMap : adValueDate.entrySet()) {
|
|
|
- Double adUsage = adMap.getKey();
|
|
|
- List<String> adDateList = adMap.getValue();
|
|
|
- if (wardValueDate.containsKey(adUsage)) {
|
|
|
- int num = 0;
|
|
|
- List<String> wardDateList = wardValueDate.get(adUsage);
|
|
|
- for (String adDate : adDateList) {
|
|
|
- for (String wardDate : wardDateList) {
|
|
|
- if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(adDate), StringUtil.parseDateTime(wardDate), 48 * 60L)) {
|
|
|
- //如果医嘱中该药使用量的医嘱时间,两天内的查房记录中也有该用量,则找到,num+1
|
|
|
- num++;
|
|
|
- }
|
|
|
+ if (antibioticWardInfo.containsKey(drugKey)) {
|
|
|
+ Map<String, List<Double>> adDateValue = ai.getValue();
|
|
|
+ Map<String, List<Double>> wardDateValue = antibioticWardInfo.get(drugKey);
|
|
|
+ for (Map.Entry<String, List<Double>> adMap : adDateValue.entrySet()) {
|
|
|
+ String adDate = adMap.getKey();
|
|
|
+ List<Double> adUsage = adMap.getValue();
|
|
|
+ for (Map.Entry<String, List<Double>> wdvMap : wardDateValue.entrySet()) {
|
|
|
+ String wardDate = wdvMap.getKey();
|
|
|
+ List<Double> wardUsage = wdvMap.getValue();
|
|
|
+ if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(adDate), StringUtil.parseDateTime(wardDate), 48 * 60L)) {
|
|
|
+ wardUsage.removeAll(adUsage);//比如adUsage有1.0、2.0,wardUsage中有2.0、3.0,removeAll之后wardUsage只剩3.0
|
|
|
+ if (wardUsage.size() > 0) {
|
|
|
+ infoAppend(sb, drugKey, wardDate);
|
|
|
}
|
|
|
- if (num == 0) {
|
|
|
- infoAppend(sb, drugKey, adUsage, adDate);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- //遗嘱中该抗生素使用量在查房记录中没出现过,全部提示出来药品名+时间
|
|
|
- for (String adDate : adDateList) {
|
|
|
- infoAppend(sb, drugKey, adUsage, adDate);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -163,7 +147,7 @@ public class THR03076 extends QCCatalogue {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void getCourseDrugInfo(Map<String, Map<Double, List<String>>> antibioticWardInfo, List<Drug> drugs, String dateStr) {
|
|
|
+ private void getCourseDrugInfo(Map<String, Map<String, List<Double>>> antibioticWardInfo, List<Drug> drugs, String dateStr) {
|
|
|
for (Drug drug : drugs) {
|
|
|
String wardDrug = drug.getName();
|
|
|
wardDrug = removeBracket(wardDrug);
|
|
@@ -185,9 +169,8 @@ public class THR03076 extends QCCatalogue {
|
|
|
* @param drugKey
|
|
|
* @param date
|
|
|
*/
|
|
|
- private void infoAppend(StringBuffer sb, String drugKey, double value, String date) {
|
|
|
- sb.append(drugKey).append("->").append(value)
|
|
|
- .append("(").append(DateUtil.formatDate(StringUtil.parseDateTime(date))).append(")").append(",");
|
|
|
+ private void infoAppend(StringBuffer sb, String drugKey, String date) {
|
|
|
+ sb.append(drugKey).append("(").append(DateUtil.formatDate(StringUtil.parseDateTime(date))).append(")").append(",");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -198,8 +181,8 @@ public class THR03076 extends QCCatalogue {
|
|
|
* @param value 抗生素用量
|
|
|
* @param startDateStr 抗生素使用时间(医嘱开始时间或查房时间)
|
|
|
*/
|
|
|
- private void collectAntibioticInfo(Map<String, Map<Double, List<String>>> antibioticInfo, String drugName, String value, String startDateStr) {
|
|
|
- Map<Double, List<String>> antibioticValueList = null;
|
|
|
+ private void collectAntibioticInfo(Map<String, Map<String, List<Double>>> antibioticInfo, String drugName, String value, String startDateStr) {
|
|
|
+ Map<String, List<Double>> antibioticValueList = null;
|
|
|
double v = -1;
|
|
|
try {
|
|
|
v = Double.parseDouble(getNumber(value));
|
|
@@ -212,16 +195,16 @@ public class THR03076 extends QCCatalogue {
|
|
|
if (!antibioticInfo.containsKey(drugName)) {
|
|
|
//存该抗生素使用第1个值
|
|
|
antibioticValueList = Maps.newLinkedHashMap();
|
|
|
- antibioticValueList.put(v, Lists.newArrayList(startDateStr));
|
|
|
+ antibioticValueList.put(startDateStr, Lists.newArrayList(v));
|
|
|
antibioticInfo.put(drugName, antibioticValueList);
|
|
|
} else {
|
|
|
antibioticValueList = antibioticInfo.get(drugName);
|
|
|
- //存该抗生素使用量第n个时间
|
|
|
- if (antibioticValueList.containsKey(v)) {
|
|
|
- antibioticValueList.get(v).add(startDateStr);
|
|
|
+ //存该抗生素使用时间时第n个量
|
|
|
+ if (antibioticValueList.containsKey(startDateStr)) {
|
|
|
+ antibioticValueList.get(startDateStr).add(v);
|
|
|
} else {
|
|
|
- //存该抗生素使用量第1个时间
|
|
|
- antibioticValueList.put(v, Lists.newArrayList(startDateStr));
|
|
|
+ //存该抗生素使用时间时第1个量
|
|
|
+ antibioticValueList.put(startDateStr, Lists.newArrayList(v));
|
|
|
}
|
|
|
}
|
|
|
}
|