Bläddra i källkod

添加妇幼事件类型

huangzhiyong 6 år sedan
förälder
incheckning
55134a2072

+ 2 - 2
commons-profile-core/src/main/java/com/yihu/ehr/profile/EventType.java

@ -8,8 +8,8 @@ import com.fasterxml.jackson.annotation.JsonValue;
public enum EventType {
    Clinic(0),              // 门诊
    Resident(1),            // 住院
    MedicalExam(2);         // 体检
    MedicalExam(2),        // 体检
    MaternalAndChild(3);  // 妇幼
    int type;
    EventType(int type){

+ 23 - 0
commons-profile-core/src/main/java/com/yihu/ehr/profile/extractor/EventInfoExtractor.java

@ -23,6 +23,8 @@ public class EventInfoExtractor extends KeyDataExtractor {
    //事件界定数据集
    private Map<String, String> dataSets = new HashMap<>();
    //模糊匹配数据集
    private Map<String, String>  fuzzyMatch =  new HashMap<>();
    @Override
    public Map<String, Object> extract(PackageDataSet dataSet) throws Exception {
@ -31,6 +33,15 @@ public class EventInfoExtractor extends KeyDataExtractor {
        if (dataSets.containsKey(dataSet.getCode())) {
            eventType = EventType.valueOf(dataSets.get(dataSet.getCode()));
        }
        //模糊匹配
        if (eventType == null) {
            for (String key:fuzzyMatch.keySet()) {
                if (dataSet.getCode().startsWith(key)) {
                    eventType = EventType.valueOf(fuzzyMatch.get(key));
                    break;
                }
            }
        }
        properties.put(ResourceCells.EVENT_TYPE, eventType);
        return properties;
    }
@ -46,9 +57,21 @@ public class EventInfoExtractor extends KeyDataExtractor {
                this.dataSets.put(DataSetUtil.originDataSetCode(key), value);
            }
        }
        //模糊匹配数据集队列格式化
        Set<String> fuuzyKeys = new HashSet<>(this.fuzzyMatch.keySet());
        for (String key : fuuzyKeys) {
            String value = this.fuzzyMatch.remove(key);
            key = key.replaceAll("^\\d{1,2}\\.", "");
            this.fuzzyMatch.put(key, value);
        }
    }
    public Map<String, String> getDataSets() {
        return this.dataSets;
    }
    public Map<String, String> getFuzzyMatch() {
        return fuzzyMatch;
    }
}