// Path: dhis2-models/src/main/java/com/thoughtworks/dhis/models/DataElementType.java
// @Getter
// public enum DataElementType {
//     ADJUSTMENTS("ADJUSTMENTS"),
//     ADJUSTMENT_REASON("ADJUSTMENT_REASON"),
//     ALLOCATED("ALLOCATED"),
//     ALLOCATION_ID("string", "ALLOCATION_ID"),
//     AMC("AMC"),
//     BREAKAGE("BREAKAGE"),
//     BUFFER_STOCK("BUFFER_STOCK", true),
//     DISPENSED("DISPENSED"),
//     EMERGENCY_ORDERED_AMOUNT("EMERGENCY_ORDERED_AMOUNT"),
//     EMERGENCY_REASON_FOR_ORDER("string", "EMERGENCY_REASON_FOR_ORDER"),
//     EXPIRED("EXPIRED"),
//     FROZEN("FROZEN"),
//     LABEL_REMOVED("LABEL_REMOVED"),
//     MAX_STOCK_QUANTITY("MAX_STOCK_QUANTITY", true),
//     MIN_STOCK_QUANTITY("MIN_STOCK_QUANTITY", true),
//     MISSING("MISSING"),
//     MONTHS_OF_STOCK_ON_HAND("MONTHS_OF_STOCK_ON_HAND"),
//     NUMBER_OF_STOCK_OUT_DAYS("NUMBER_OF_STOCK_OUT_DAYS"),
//     ORDERED_AMOUNT("ORDERED_AMOUNT"),
//     ORDER_ID("string", "ORDER_ID"),
//     OTHERS("OTHERS"),
//     PROJECTED_ORDER_AMOUNT("PROJECTED_ORDER_AMOUNT"),
//     REASON_FOR_ORDER("string", "REASON_FOR_ORDER"),
//     RECEIVED("RECEIVED"),
//     RECEIVE_DATE("string", "RECEIVE_DATE"),
//     RECEIVE_SOURCE("string", "RECEIVE_SOURCE"),
//     SAFETY_STOCK("SAFETY_STOCK"),
//     STOCK_ON_HAND("STOCK_ON_HAND"),
//     TMC("TMC"),
//     VVM_CHANGE("VVM_CHANGE"),
//     WASTED("WASTED");
// 
//     private String type = "int";
//     private String activity;
//     private boolean isIndicator = false;
// 
//     DataElementType(String activity, boolean isIndicator) {
//         this.activity = activity;
//         this.isIndicator = isIndicator;
//     }
// 
//     DataElementType(String type, String activity) {
//         this.type = type;
//         this.activity = activity;
//     }
// 
//     DataElementType(String activity) {
//         this.activity = activity;
//     }
// 
//     public static boolean dataElementActivityExists(String activityString) {
//         return getDataElementStrings(false).contains(activityString.trim());
//     }
// 
//     public static boolean indicatorExists(String activityString) {
//         return getDataElementStrings(true).contains(activityString.trim());
//     }
// 
//     public static List<String> getDataElementStrings(boolean isIndicator) {
//         return from(getDataElementTypes(isIndicator)).transform(new Function<DataElementType, String>() {
//             @Override
//             public String apply(DataElementType input) {
//                 return input.getActivity();
//             }
//         }).toList();
//     }
// 
//     private static List<DataElementType> getDataElementTypes(final boolean isIndicator) {
//         List<DataElementType> types = Lists.newArrayList(DataElementType.values());
//         return from(types).filter(new Predicate<DataElementType>() {
//             @Override
//             public boolean apply(DataElementType input) {
//                 return input.isIndicator() == isIndicator;
//             }
//         }).toList();
//     }
// }


import com.thoughtworks.dhis.models.Attribute;
import com.thoughtworks.dhis.models.AttributeValue;
import com.thoughtworks.dhis.models.CategoryCombo;
import com.thoughtworks.dhis.models.CategoryOptionCombo;
import com.thoughtworks.dhis.models.Constant;
import com.thoughtworks.dhis.models.DataElement;
import com.thoughtworks.dhis.models.DataElementGroup;
import com.thoughtworks.dhis.models.DataElementGroupSet;
import com.thoughtworks.dhis.models.DataElementType;
import com.thoughtworks.dhis.models.DataSet;
import com.thoughtworks.dhis.models.ExcelCategory;
import com.thoughtworks.dhis.models.ExcelCommodity;
import com.thoughtworks.dhis.models.Indicator;
import com.thoughtworks.dhis.models.IndicatorType;
import com.thoughtworks.dhis.models.Option;
import com.thoughtworks.dhis.models.OptionSet;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.RandomStringUtils;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.google.common.collect.Lists.newArrayList;
    private static final String LMIS_COMMODITIES_ALLOCATED = LMIS_KEY_WORD + "Commodities Allocated";
    private static final String LMIS_ACTIVITY = LMIS_KEY_WORD + "Activity";
    public static final String OPTION_SETS = "optionSets";
    public static final String INDICATOR_TYPES = "indicatorTypes";
    public static final String INDICATORS = "indicators";

    private static final String LMIS_COMMODITIES_LOSSES = LMIS_KEY_WORD + "Commodities Losses";
    private static final String LOSSES_INDICATOR_TYPE = "Losses Indicator Type";
    private static final String LMIS_COMMODITIES_CALCULATED = LMIS_KEY_WORD + "Commodities Calculated";
    public static final String ATTRIBUTES = "attributes";
    public static final String CONSTANTS = "constants";
    public static final String OPTIONS = "options";
    private final Attribute lgaAttribute;
    private final Attribute isDeviceAttribute;
    private final Attribute isVaccineAttribute;

    private CategoryCombo defaultCategoryCombo;
    private List<DataElementGroup> dataElementGroups;
    private List<DataElementGroupSet> dataElementGroupSets;
    private List<DataElement> dataElements;
    private List<DataSet> dataSets;
    private List<Indicator> indicators;
    private List<OptionSet> optionSets;
    private List<Constant> constants;
    private List<Option> options;
    private List<String> shortNames;
    private OptionSet orderReasonOptionSet;
    private IndicatorType indicatorType;
    private Attribute actionAttribute;

// Path: dhis2-models/src/main/java/com/thoughtworks/dhis/models/DataElementType.java
// @Getter
// public enum DataElementType {
//     ADJUSTMENTS("ADJUSTMENTS"),
//     ADJUSTMENT_REASON("ADJUSTMENT_REASON"),
//     ALLOCATED("ALLOCATED"),
//     ALLOCATION_ID("string", "ALLOCATION_ID"),
//     AMC("AMC"),
//     BREAKAGE("BREAKAGE"),
//     BUFFER_STOCK("BUFFER_STOCK", true),
//     DISPENSED("DISPENSED"),
//     EMERGENCY_ORDERED_AMOUNT("EMERGENCY_ORDERED_AMOUNT"),
//     EMERGENCY_REASON_FOR_ORDER("string", "EMERGENCY_REASON_FOR_ORDER"),
//     EXPIRED("EXPIRED"),
//     FROZEN("FROZEN"),
//     LABEL_REMOVED("LABEL_REMOVED"),
//     MAX_STOCK_QUANTITY("MAX_STOCK_QUANTITY", true),
//     MIN_STOCK_QUANTITY("MIN_STOCK_QUANTITY", true),
//     MISSING("MISSING"),
//     MONTHS_OF_STOCK_ON_HAND("MONTHS_OF_STOCK_ON_HAND"),
//     NUMBER_OF_STOCK_OUT_DAYS("NUMBER_OF_STOCK_OUT_DAYS"),
//     ORDERED_AMOUNT("ORDERED_AMOUNT"),
//     ORDER_ID("string", "ORDER_ID"),
//     OTHERS("OTHERS"),
//     PROJECTED_ORDER_AMOUNT("PROJECTED_ORDER_AMOUNT"),
//     REASON_FOR_ORDER("string", "REASON_FOR_ORDER"),
//     RECEIVED("RECEIVED"),
//     RECEIVE_DATE("string", "RECEIVE_DATE"),
//     RECEIVE_SOURCE("string", "RECEIVE_SOURCE"),
//     SAFETY_STOCK("SAFETY_STOCK"),
//     STOCK_ON_HAND("STOCK_ON_HAND"),
//     TMC("TMC"),
//     VVM_CHANGE("VVM_CHANGE"),
//     WASTED("WASTED");
// 
//     private String type = "int";
//     private String activity;
//     private boolean isIndicator = false;
// 
//     DataElementType(String activity, boolean isIndicator) {
//         this.activity = activity;
//         this.isIndicator = isIndicator;
//     }
// 
//     DataElementType(String type, String activity) {
//         this.type = type;
//         this.activity = activity;
//     }
// 
//     DataElementType(String activity) {
//         this.activity = activity;
//     }
// 
//     public static boolean dataElementActivityExists(String activityString) {
//         return getDataElementStrings(false).contains(activityString.trim());
//     }
// 
//     public static boolean indicatorExists(String activityString) {
//         return getDataElementStrings(true).contains(activityString.trim());
//     }
// 
//     public static List<String> getDataElementStrings(boolean isIndicator) {
//         return from(getDataElementTypes(isIndicator)).transform(new Function<DataElementType, String>() {
//             @Override
//             public String apply(DataElementType input) {
//                 return input.getActivity();
//             }
//         }).toList();
//     }
// 
//     private static List<DataElementType> getDataElementTypes(final boolean isIndicator) {
//         List<DataElementType> types = Lists.newArrayList(DataElementType.values());
//         return from(types).filter(new Predicate<DataElementType>() {
//             @Override
//             public boolean apply(DataElementType input) {
//                 return input.isIndicator() == isIndicator;
//             }
//         }).toList();
//     }
// }


// Path: dhis2-config-client/src/main/java/com/thoughtworks/dhis/configurations/LMISConfiguration.java
import com.thoughtworks.dhis.models.Attribute;
import com.thoughtworks.dhis.models.AttributeValue;
import com.thoughtworks.dhis.models.CategoryCombo;
import com.thoughtworks.dhis.models.CategoryOptionCombo;
import com.thoughtworks.dhis.models.Constant;
import com.thoughtworks.dhis.models.DataElement;
import com.thoughtworks.dhis.models.DataElementGroup;
import com.thoughtworks.dhis.models.DataElementGroupSet;
import com.thoughtworks.dhis.models.DataElementType;
import com.thoughtworks.dhis.models.DataSet;
import com.thoughtworks.dhis.models.ExcelCategory;
import com.thoughtworks.dhis.models.ExcelCommodity;
import com.thoughtworks.dhis.models.Indicator;
import com.thoughtworks.dhis.models.IndicatorType;
import com.thoughtworks.dhis.models.Option;
import com.thoughtworks.dhis.models.OptionSet;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.RandomStringUtils;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.google.common.collect.Lists.newArrayList;

    private static final String LMIS_COMMODITIES_ALLOCATED = LMIS_KEY_WORD + "Commodities Allocated";
    private static final String LMIS_ACTIVITY = LMIS_KEY_WORD + "Activity";
    public static final String OPTION_SETS = "optionSets";
    public static final String INDICATOR_TYPES = "indicatorTypes";
    public static final String INDICATORS = "indicators";

    private static final String LMIS_COMMODITIES_LOSSES = LMIS_KEY_WORD + "Commodities Losses";
    private static final String LOSSES_INDICATOR_TYPE = "Losses Indicator Type";
    private static final String LMIS_COMMODITIES_CALCULATED = LMIS_KEY_WORD + "Commodities Calculated";
    public static final String ATTRIBUTES = "attributes";
    public static final String CONSTANTS = "constants";
    public static final String OPTIONS = "options";
    private final Attribute lgaAttribute;
    private final Attribute isDeviceAttribute;
    private final Attribute isVaccineAttribute;

    private CategoryCombo defaultCategoryCombo;
    private List<DataElementGroup> dataElementGroups;
    private List<DataElementGroupSet> dataElementGroupSets;
    private List<DataElement> dataElements;
    private List<DataSet> dataSets;
    private List<Indicator> indicators;
    private List<OptionSet> optionSets;
    private List<Constant> constants;
    private List<Option> options;
    private List<String> shortNames;
    private OptionSet orderReasonOptionSet;
    private IndicatorType indicatorType;
    private Attribute actionAttribute;

    public LMISConfiguration(CategoryCombo defaultCategoryCombo) {