/** * @param worker - used when validating paths (@check), and used doing value set membership when executing tests (once that's defined) */ public FHIRPathEngine(IWorkerContext worker) { super(); this.worker = worker; for (StructureDefinition sd : worker.allStructures()) { if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) allTypes.put(sd.getName(), sd); if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE) { primitiveTypes.add(sd.getName()); } } }
tgt.addIdentifier(convertIdentifier(t)); tgt.setVersion(src.getVersion()); tgt.setName(src.getName()); tgt.setDisplay(src.getTitle()); tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
public void generateSchematrons(OutputStream dest, StructureDefinition structure) throws IOException, DefinitionException { if (structure.getDerivation() != TypeDerivationRule.CONSTRAINT) throw new DefinitionException("not the right kind of structure to generate schematrons for"); if (!structure.hasSnapshot()) throw new DefinitionException("needs a snapshot"); StructureDefinition base = context.fetchResource(StructureDefinition.class, structure.getBaseDefinition()); SchematronWriter sch = new SchematronWriter(dest, SchematronType.PROFILE, base.getName()); ElementDefinition ed = structure.getSnapshot().getElement().get(0); generateForChildren(sch, "f:"+ed.getPath(), ed, structure, base); sch.dump(); }
public void closeDifferential(StructureDefinition base, StructureDefinition derived) throws FHIRException { for (ElementDefinition edb : base.getSnapshot().getElement()) { if (isImmediateChild(edb) && !edb.getPath().endsWith(".id")) { ElementDefinition edm = getMatchInDerived(edb, derived.getDifferential().getElement()); if (edm == null) { ElementDefinition edd = derived.getDifferential().addElement(); edd.setPath(edb.getPath()); edd.setMax("0"); } else if (edb.hasSlicing()) { closeChildren(base, edb, derived, edm); } } } sortDifferential(base, derived, derived.getName(), new ArrayList<String>()); }
boolean open = false; if (profile.getDerivation() == TypeDerivationRule.CONSTRAINT) { res.setDescription(profile.getName()); for (ElementDefinition ed : profile.getSnapshot().getElement()) { if (isKeyProperty(ed.getBase().getPath()) && ed.hasFixed()) { b.append("]"); } else res.setDescription("Base FHIR "+profile.getName()); res.setType(b.toString()); return res ;
public void setIds(StructureDefinition sd, boolean checkFirst) throws DefinitionException { if (!checkFirst || !sd.hasDifferential() || hasMissingIds(sd.getDifferential().getElement())) { if (!sd.hasDifferential()) sd.setDifferential(new StructureDefinitionDifferentialComponent()); generateIds(sd.getDifferential().getElement(), sd.getName()); } if (!checkFirst || !sd.hasSnapshot() || hasMissingIds(sd.getSnapshot().getElement())) { if (!sd.hasSnapshot()) sd.setSnapshot(new StructureDefinitionSnapshotComponent()); generateIds(sd.getSnapshot().getElement(), sd.getName()); } }
if (src.hasVersion()) tgt.setVersion(src.getVersion()); tgt.setName(src.getName()); if (src.hasTitle()) tgt.setDisplay(src.getTitle());
StructureDefinition sd = context.fetchResource(StructureDefinition.class, t.getTargetProfile()); if (sd != null) { String disp = sd.hasTitle() ? sd.getTitle() : sd.getName(); c.addPiece(checkForNoChange(t, gen.new Piece(checkPrepend(corePath, sd.getUserString("path")), disp, null))); } else { StructureDefinition sd = context.fetchResource(StructureDefinition.class, t.getTargetProfile()); if (sd != null) { String disp = sd.hasTitle() ? sd.getTitle() : sd.getName(); String ref = pkp.getLinkForProfile(null, sd.getUrl()); if (ref.contains("|"))
if (sdb == null) throw new DefinitionException("no base for "+sd.getBaseDefinition()); generateSnapshot(sdb, sd, sd.getUrl(), sd.getName());
r.getCells().add(gen.new Cell(null, defFile == null ? "" : defFile+"-definitions.html#extension."+ed.getName(), ed.getSnapshot().getElement().get(0).getIsModifier() ? "modifierExtension" : "extension", null, null)); r.getCells().add(gen.new Cell()); r.getCells().add(gen.new Cell(null, null, describeCardinality(ed.getSnapshot().getElement().get(0), null, new UnusedTracker()), null, null)); Row r1 = gen.new Row(); r.getSubRows().add(r1); r1.getCells().add(gen.new Cell(null, defFile == null ? "" : defFile+"-definitions.html#extension."+ed.getName(), ((UriType) ued.getFixed()).getValue(), null, null)); r1.getCells().add(gen.new Cell()); r1.getCells().add(gen.new Cell(null, null, describeCardinality(c, null, new UnusedTracker()), null, null)); c.addPiece(gen.new Piece("br")).addPiece(gen.new Piece(null, ed.getName()+": "+ed.getDescription(), null)); if (!full && !(deep || vdeep) && ved != null && ved.hasBinding()) { c.addPiece(gen.new Piece("br"));
tgt.addIdentifier(convertIdentifier(t)); tgt.setVersion(src.getVersion()); tgt.setName(src.getName()); tgt.setDisplay(src.getTitle()); tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
if (src.hasVersion()) tgt.setVersion(src.getVersion()); tgt.setName(src.getName()); if (src.hasTitle()) tgt.setDisplay(src.getTitle());