/** * @return The first repetition of repeating field {@link #structure}, creating it if it does not already exist */ public StructureMapStructureComponent getStructureFirstRep() { if (getStructure().isEmpty()) { addStructure(); } return getStructure().get(0); }
private static void renderUses(StringBuilder b, StructureMap map) { for (StructureMapStructureComponent s : map.getStructure()) { b.append("uses \""); b.append(s.getUrl()); b.append("\" "); if (s.hasAlias()) { b.append("alias "); b.append(s.getAlias()); b.append(" "); } b.append("as "); b.append(s.getMode().toCode()); b.append("\r\n"); renderDoco(b, s.getDocumentation()); } if (map.hasStructure()) b.append("\r\n"); }
private String getActualType(StructureMap map, String statedType) throws FHIRException { // check the aliases for (StructureMapStructureComponent imp : map.getStructure()) { if (imp.hasAlias() && statedType.equals(imp.getAlias())) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, imp.getUrl()); if (sd == null) throw new FHIRException("Unable to resolve structure "+imp.getUrl()); return sd.getId(); // should be sd.getType(), but R2... } } return statedType; }
this.copyright = castToMarkdown(value); // MarkdownType } else if (name.equals("structure")) { this.getStructure().add((StructureMapStructureComponent) value); } else if (name.equals("import")) { this.getImport().add(castToCanonical(value));
private PropertyWithType resolveType(StructureMap map, String type, StructureMapInputMode mode) throws Exception { for (StructureMapStructureComponent imp : map.getStructure()) { if ((imp.getMode() == StructureMapModelMode.SOURCE && mode == StructureMapInputMode.SOURCE) || (imp.getMode() == StructureMapModelMode.TARGET && mode == StructureMapInputMode.TARGET)) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, imp.getUrl()); if (sd == null) throw new Exception("Import "+imp.getUrl()+" cannot be resolved"); if (sd.getId().equals(type)) { return new PropertyWithType(sd.getType(), new Property(worker, sd.getSnapshot().getElement().get(0), sd), null, new TypeDetails(CollectionStatus.SINGLETON, sd.getUrl())); } } } throw new Exception("Unable to find structure definition for "+type+" in imports"); }
private boolean matchesType(StructureMap map, String actualType, String statedType) throws FHIRException { // check the aliases for (StructureMapStructureComponent imp : map.getStructure()) { if (imp.hasAlias() && statedType.equals(imp.getAlias())) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, imp.getUrl()); if (sd != null) statedType = sd.getType(); break; } } if (Utilities.isAbsoluteUrl(actualType)) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, actualType); if (sd != null) actualType = sd.getType(); } if (Utilities.isAbsoluteUrl(statedType)) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, statedType); if (sd != null) statedType = sd.getType(); } return actualType.equals(statedType); }
public StructureDefinition getTargetType(StructureMap map) throws FHIRException { boolean found = false; StructureDefinition res = null; for (StructureMapStructureComponent uses : map.getStructure()) { if (uses.getMode() == StructureMapModelMode.TARGET) { if (found) throw new FHIRException("Multiple targets found in map "+map.getUrl()); found = true; res = worker.fetchResource(StructureDefinition.class, uses.getUrl()); if (res == null) throw new FHIRException("Unable to find "+uses.getUrl()+" referenced from map "+map.getUrl()); } } if (res == null) throw new FHIRException("No targets found in map "+map.getUrl()); return res; }
tn = getParamStringNoNull(vars, tgt.getParameter().get(0), tgt.toString()); for (StructureMapStructureComponent uses : map.getStructure()) { if (uses.getMode() == StructureMapModelMode.TARGET && uses.hasAlias() && tn.equals(uses.getAlias())) { tn = uses.getUrl();
return value; case 144518515: // structure this.getStructure().add((StructureMapStructureComponent) value); // StructureMapStructureComponent return value; case -1184795739: // import
/** * @return The first repetition of repeating field {@link #structure}, creating it if it does not already exist */ public StructureMapStructureComponent getStructureFirstRep() { if (getStructure().isEmpty()) { addStructure(); } return getStructure().get(0); }
private static void renderUses(StringBuilder b, StructureMap map) { for (StructureMapStructureComponent s : map.getStructure()) { b.append("uses \""); b.append(s.getUrl()); b.append("\" "); if (s.hasAlias()) { b.append("alias "); b.append(s.getAlias()); b.append(" "); } b.append("as "); b.append(s.getMode().toCode()); b.append("\r\n"); renderDoco(b, s.getDocumentation()); } if (map.hasStructure()) b.append("\r\n"); }
this.copyright = castToMarkdown(value); // MarkdownType } else if (name.equals("structure")) { this.getStructure().add((StructureMapStructureComponent) value); } else if (name.equals("import")) { this.getImport().add(castToCanonical(value));
private String getActualType(StructureMap map, String statedType) throws FHIRException { // check the aliases for (StructureMapStructureComponent imp : map.getStructure()) { if (imp.hasAlias() && statedType.equals(imp.getAlias())) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, imp.getUrl()); if (sd == null) throw new FHIRException("Unable to resolve structure "+imp.getUrl()); return sd.getId(); // should be sd.getType(), but R2... } } return statedType; }
private PropertyWithType resolveType(StructureMap map, String type, StructureMapInputMode mode) throws Exception { for (StructureMapStructureComponent imp : map.getStructure()) { if ((imp.getMode() == StructureMapModelMode.SOURCE && mode == StructureMapInputMode.SOURCE) || (imp.getMode() == StructureMapModelMode.TARGET && mode == StructureMapInputMode.TARGET)) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, imp.getUrl()); if (sd == null) throw new Exception("Import "+imp.getUrl()+" cannot be resolved"); if (sd.getId().equals(type)) { return new PropertyWithType(sd.getType(), new Property(worker, sd.getSnapshot().getElement().get(0), sd), null, new TypeDetails(CollectionStatus.SINGLETON, sd.getUrl())); } } } throw new Exception("Unable to find structure definition for "+type+" in imports"); }
if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); for (org.hl7.fhir.r4.model.UriType t : src.getImport())
private boolean matchesType(StructureMap map, String actualType, String statedType) throws FHIRException { // check the aliases for (StructureMapStructureComponent imp : map.getStructure()) { if (imp.hasAlias() && statedType.equals(imp.getAlias())) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, imp.getUrl()); if (sd != null) statedType = sd.getType(); break; } } if (Utilities.isAbsoluteUrl(actualType)) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, actualType); if (sd != null) actualType = sd.getType(); } if (Utilities.isAbsoluteUrl(statedType)) { StructureDefinition sd = worker.fetchResource(StructureDefinition.class, statedType); if (sd != null) statedType = sd.getType(); } return actualType.equals(statedType); }
return value; case 144518515: // structure this.getStructure().add((StructureMapStructureComponent) value); // StructureMapStructureComponent return value; case -1184795739: // import
public StructureDefinition getTargetType(StructureMap map) throws FHIRException { boolean found = false; StructureDefinition res = null; for (StructureMapStructureComponent uses : map.getStructure()) { if (uses.getMode() == StructureMapModelMode.TARGET) { if (found) throw new FHIRException("Multiple targets found in map "+map.getUrl()); found = true; res = worker.fetchResource(StructureDefinition.class, uses.getUrl()); if (res == null) throw new FHIRException("Unable to find "+uses.getUrl()+" referenced from map "+map.getUrl()); } } if (res == null) throw new FHIRException("No targets found in map "+map.getUrl()); return res; }
tn = getParamStringNoNull(vars, tgt.getParameter().get(0), tgt.toString()); for (StructureMapStructureComponent uses : map.getStructure()) { if (uses.getMode() == StructureMapModelMode.TARGET && uses.hasAlias() && tn.equals(uses.getAlias())) { tn = uses.getUrl();
if (src.hasCopyright()) tgt.setCopyright(src.getCopyright()); for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) tgt.addStructure(convertStructureMapStructureComponent(t)); for (org.hl7.fhir.r4.model.UriType t : src.getImport())