From a752b34d882e9e90b976aef5d2c186948582b37e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 13 Dec 2023 14:09:33 -0500 Subject: [PATCH] more QA work --- .../generators/specification/ProfileGenerator.java | 14 ++++---------- .../org/hl7/fhir/tools/publisher/Publisher.java | 11 ++++++----- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/hl7/fhir/definitions/generators/specification/ProfileGenerator.java b/src/main/java/org/hl7/fhir/definitions/generators/specification/ProfileGenerator.java index 1f1b1c5..6ccbc7a 100644 --- a/src/main/java/org/hl7/fhir/definitions/generators/specification/ProfileGenerator.java +++ b/src/main/java/org/hl7/fhir/definitions/generators/specification/ProfileGenerator.java @@ -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"); } @@ -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 t = sp.addBaseElement(); + t.setValueAsString("Resource"); + t.addExtension(ToolingExtensions.EXT_SEARCH_PARAMETER_BASE, new CodeType(p.getType())); } } else { if (sp.getType() != getSearchParamType(spd.getType())) @@ -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()) diff --git a/src/main/java/org/hl7/fhir/tools/publisher/Publisher.java b/src/main/java/org/hl7/fhir/tools/publisher/Publisher.java index 48a78ef..46ff07d 100644 --- a/src/main/java/org/hl7/fhir/tools/publisher/Publisher.java +++ b/src/main/java/org/hl7/fhir/tools/publisher/Publisher.java @@ -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; @@ -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("", "").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()); @@ -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);