All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opencds.cqf.jsonschema.FhirSchema Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
package org.opencds.cqf.jsonschema;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

public class FhirSchema {

    private String name;
    private List elements;

    public FhirSchema(String name, JsonObject elements) {
        this.name = name;
        this.elements = new ArrayList<>();

        if (elements == null) {
            throw new IllegalArgumentException("Cannot process null schema");
        }

        boolean isBackboneElement = false;
        for (Map.Entry entry : elements.entrySet()) {
            if (entry.getKey().equals(name)) {
                continue;
            }
            this.elements.add(new FhirSchemaElement(entry.getKey().replace(name + ".", ""), entry.getValue().getAsJsonObject()));
        }
    }

    public String getName() {
        return name;
    }

    public List getElements() {
        return elements;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy