private String pathTail(List<ElementDefinition> diffMatches, int i) { ElementDefinition d = diffMatches.get(i); String s = d.getPath().contains(".") ? d.getPath().substring(d.getPath().lastIndexOf(".")+1) : d.getPath(); return "."+s + (d.hasType() && d.getType().get(0).hasProfile() ? "["+d.getType().get(0).getProfile().get(0).asStringValue()+"]" : ""); }
private StructureDefinition getProfileForDataType(TypeRefComponent type) { StructureDefinition sd = null; if (type.hasProfile()) sd = context.fetchResource(StructureDefinition.class, type.getProfile().get(0).asStringValue()); if (sd == null) sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+type.getCode()); if (sd == null) System.out.println("XX: failed to find profle for type: " + type.getCode()); // debug GJM return sd; }
private Slicer generateSlicer(ElementDefinition child, ElementDefinitionSlicingComponent slicing, StructureDefinition structure) { // given a child in a structure, it's sliced. figure out the slicing xpath if (child.getPath().endsWith(".extension")) { ElementDefinition ued = getUrlFor(structure, child); if ((ued == null || !ued.hasFixed()) && !(child.getType().get(0).hasProfile())) return new Slicer(false); else { Slicer s = new Slicer(true); String url = (ued == null || !ued.hasFixed()) ? child.getType().get(0).getProfile().get(0).asStringValue() : ((UriType) ued.getFixed()).asStringValue(); s.name = " with URL = '"+url+"'"; s.criteria = "[@url = '"+url+"']"; return s; } } else return new Slicer(false); }
ElementDefinition criteria = getCriteriaForDiscriminator(path, ed, discriminator, profile); if (discriminator.equals("url") && criteria.getPath().equals("Extension.url")) { if (!element.getAttribute("url").equals(((UriType) criteria.getFixed()).asStringValue())) return false; } else {
ElementDefinition template = null; if (diffMatches.get(0).hasType() && diffMatches.get(0).getType().size() == 1 && diffMatches.get(0).getType().get(0).hasProfile() && !diffMatches.get(0).getType().get(0).getCode().equals("Reference")) { String p = diffMatches.get(0).getType().get(0).getProfile().get(0).asStringValue(); StructureDefinition sd = context.fetchResource(StructureDefinition.class, p); if (sd != null) {
private String pathTail(List<ElementDefinition> diffMatches, int i) { ElementDefinition d = diffMatches.get(i); String s = d.getPath().contains(".") ? d.getPath().substring(d.getPath().lastIndexOf(".")+1) : d.getPath(); return "."+s + (d.hasType() && d.getType().get(0).hasProfile() ? "["+d.getType().get(0).getProfile().get(0).asStringValue()+"]" : ""); }
private StructureDefinition getProfileForDataType(TypeRefComponent type) { StructureDefinition sd = null; if (type.hasProfile()) sd = context.fetchResource(StructureDefinition.class, type.getProfile().get(0).asStringValue()); if (sd == null) sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+type.getCode()); if (sd == null) System.out.println("XX: failed to find profle for type: " + type.getCode()); // debug GJM return sd; }
private Slicer generateSlicer(ElementDefinition child, ElementDefinitionSlicingComponent slicing, StructureDefinition structure) { // given a child in a structure, it's sliced. figure out the slicing xpath if (child.getPath().endsWith(".extension")) { ElementDefinition ued = getUrlFor(structure, child); if ((ued == null || !ued.hasFixed()) && !(child.getType().get(0).hasProfile())) return new Slicer(false); else { Slicer s = new Slicer(true); String url = (ued == null || !ued.hasFixed()) ? child.getType().get(0).getProfile().get(0).asStringValue() : ((UriType) ued.getFixed()).asStringValue(); s.name = " with URL = '"+url+"'"; s.criteria = "[@url = '"+url+"']"; return s; } } else return new Slicer(false); }
ElementDefinition criteria = getCriteriaForDiscriminator(path, ed, discriminator, profile); if (discriminator.equals("url") && criteria.getPath().equals("Extension.url")) { if (!element.getAttribute("url").equals(((UriType) criteria.getFixed()).asStringValue())) return false; } else {
ElementDefinition template = null; if (diffMatches.get(0).hasType() && diffMatches.get(0).getType().size() == 1 && diffMatches.get(0).getType().get(0).hasProfile() && !diffMatches.get(0).getType().get(0).getCode().equals("Reference")) { String p = diffMatches.get(0).getType().get(0).getProfile().get(0).asStringValue(); StructureDefinition sd = context.fetchResource(StructureDefinition.class, p); if (sd != null) {