Skip to content

Commit

Permalink
more QA work
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Dec 13, 2023
1 parent 8e6ed16 commit a752b34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1121,10 +1121,7 @@ public StructureDefinition generate(Profile pack, ResourceDefn r, String usage,
ToolResourceUtilities.updateUsage(p, usage);
p.setName(r.getRoot().getName());
if (r.getWg() != null) {
p.setPublisher("HL7 International"+(r.getWg() == null ? "" : " / "+r.getWg().getName()));
p.addContact().getTelecom().add(Factory.newContactPoint(ContactPointSystem.URL, "http://hl7.org/fhir"));
p.addContact().getTelecom().add(Factory.newContactPoint(ContactPointSystem.URL, r.getWg().getUrl()));
ToolingExtensions.setCodeExtension(p, ToolingExtensions.EXT_WORKGROUP, r.getWg().getCode());
CanonicalResourceUtilities.setHl7WG(p, r.getWg().getCode());
} else {
CanonicalResourceUtilities.setHl7WG(p, "fhir");
}
Expand Down Expand Up @@ -1451,11 +1448,9 @@ public SearchParameter makeSearchParam(StructureDefinition p, String id, String
if (VersionIndependentResourceTypesAll.isValidCode(p.getType())) {
sp.addBase(VersionIndependentResourceTypesAll.fromCode(p.getType()));
} else {
// TODO: This is a problem with R5 enum at this point. For now,
// we leave it blank, but we have to figure this out before getting
// serious r=with R6 QA
// sp.addBaseElement().setValueAsString(p.getType());

Enumeration<VersionIndependentResourceTypesAll> t = sp.addBaseElement();
t.setValueAsString("Resource");
t.addExtension(ToolingExtensions.EXT_SEARCH_PARAMETER_BASE, new CodeType(p.getType()));
}
} else {
if (sp.getType() != getSearchParamType(spd.getType()))
Expand Down Expand Up @@ -2731,7 +2726,6 @@ public StructureDefinition generateLogicalModel(ImplementationGuideDefn igd, Res
CanonicalResourceUtilities.setHl7WG(p, "fhir");
}


p.setDescription("Logical Model: "+r.getDefinition());
p.setPurpose(r.getRoot().getRequirements());
if (!p.hasPurpose())
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/org/hl7/fhir/tools/publisher/Publisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.filters.StringInputStream;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Ref;
Expand Down Expand Up @@ -5263,13 +5264,14 @@ private void processExample(Example e, ResourceDefn resn, StructureDefinition pr
}
}
if (e.getResource() == null && e.getElement() == null) {
String xml = XMLUtil.elementToString(e.getXml().getDocumentElement());
String xml = XMLUtil.elementToString(e.getXml().getDocumentElement()).replace("<?xml version=\"1.0\" encoding=\"UTF-16\"?>", "").trim();
e.setElement(new Manager().parseSingle(page.getWorkerContext(), new StringInputStream(xml), FhirFormat.XML));
e.setResource(new XmlParser().parse(xml));
}
} catch (Throwable ex) {
StringWriter errors = new StringWriter();
System.out.println("Error generating narrative for example "+e.getName()+": "+ex.getMessage());
ex.printStackTrace();
// ex.printStackTrace();
XhtmlNode xhtml = new XhtmlNode(NodeType.Element, "div");
xhtml.addTag("p").setAttribute("style", "color: maroon").addText("Error processing narrative: " + ex.getMessage());
xhtml.addTag("p").setAttribute("style", "color: maroon").addText(errors.toString());
Expand Down Expand Up @@ -6871,13 +6873,12 @@ private void checkShareableValueSet(ValueSet vs) {
private void generateValueSetsPart2() throws Exception {

for (ValueSet vs : page.getDefinitions().getBoundValueSets().values()) {

page.log(" ...value set: "+vs.getId(), LogMessageType.Process);
// page.log(" ...value set: "+vs.getId(), LogMessageType.Process);
generateValueSetPart2(vs);
}
for (String s : page.getDefinitions().getExtraValuesets().keySet()) {
if (!s.startsWith("http:")) {
page.log(" ...value set: "+s, LogMessageType.Process);
// page.log(" ...value set: "+s, LogMessageType.Process);
ValueSet vs = page.getDefinitions().getExtraValuesets().get(s);
if (!page.getDefinitions().getBoundValueSets().containsKey(vs.getUrl())) {
generateValueSetPart2(vs);
Expand Down

0 comments on commit a752b34

Please sign in to comment.