private void gen(String bn, ValueSet vs) throws FHIRException { Section section = section(bn); section.triple(bn, "a", "fhir:ValueSet"); if (vs.hasVersion()) section.triple(bn, "fhir:version", literal(vs.getVersion())); if (vs.hasName()) section.label(bn, vs.getName()); if (vs.hasDescription()) section.comment( bn, vs.getDescription() .replace("code system", "value set") .replace("Code System", "Value Set") .replace("Code system", "Value set")); if (vs.hasCopyright()) section.triple(bn, "dc:rights", literal(vs.getCopyright())); if (vs.hasDate()) section.triple(bn, "dc:date", literal(vs.getDateElement().asStringValue())); for (UsageContext cc : vs.getUseContext()) codedTriple(section, bn, "fhir:useContext", cc.getValueCodeableConcept()); section.triple( bn, "fhir:status", complex().predicate("a", "fhir:conformance-resource-status\\#" + vs.getStatus().toCode())); section.triple( bn, "fhir:canonicalStatus", complex().predicate("a", getCanonicalStatus("ValueSet.status", vs.getStatus().toCode()))); }
private String gen(Section section, CodeSystem cs, ValueSet vs) { String bn = getPNameForUri(cs.getUrl()); if (!bn.startsWith("<")) { section.triple(bn + ".system", "a", "fhir:CodeSystem"); if (cs.hasVersion()) section.triple(bn + ".system", "fhir:version", literal(cs.getVersion())); if (vs.hasName()) section.label(bn + ".system", vs.getName()); if (vs.hasDescription()) section.comment( bn + ".system", vs.getDescription() .replace("value set", "code system") .replace("Value Set", "Code System") .replace("Value set", "Code system")); if (vs.hasCopyright()) section.triple(bn + ".system", "dc:rights", literal(vs.getCopyright())); if (vs.hasDate()) section.triple(bn + ".system", "dc:date", literal(vs.getDate().toString())); section.triple(bn, "a", "fhir:Concept"); gen(section, bn, bn, cs.getConcept()); } return bn; }