Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup and Testpage Overlay tweaks #6578

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ indent_style = tab
tab_width = 3
indent_size = 3

[*.js]
indent_style = tab
tab_width = 3
indent_size = 3

[*.vm]
indent_style = tab
tab_width = 3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: fix
issue: 6578
title: "The search parameter picker in the Testpage Overlay module has been adjusted to
correct several display issues which appeared after the upgrade from Bootstrap 4 to
Bootstrap 5."
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: fix
issue: 6578
title: "When starting up the JPA server under heavy load, the validation support cache
could perform a large number of identical parallel queries. A synchronization guard
has been placed around the cache loader to avoid this."
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
public class GraphQLProviderWithIntrospection extends GraphQLProvider {

private static final Logger ourLog = LoggerFactory.getLogger(GraphQLProviderWithIntrospection.class);
private final GraphQLSchemaGenerator myGenerator;
private volatile GraphQLSchemaGenerator myGenerator;
private final ISearchParamRegistry mySearchParamRegistry;
private final VersionSpecificWorkerContextWrapper myContext;
private final IDaoRegistry myDaoRegistry;
Expand All @@ -99,7 +99,6 @@ public GraphQLProviderWithIntrospection(
myDaoRegistry = theDaoRegistry;

myContext = VersionSpecificWorkerContextWrapper.newVersionSpecificWorkerContextWrapper(theValidationSupport);
myGenerator = new GraphQLSchemaGenerator(myContext, VersionUtil.getVersion());

GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(Collections.emptyList().getClass(), (JsonSerializer<Object>)
Expand Down Expand Up @@ -153,37 +152,23 @@ private String generateSchema(
Collection<String> theResourceTypes,
EnumSet<GraphQLSchemaGenerator.FHIROperationType> theOperations) {

GraphQLSchemaGenerator generator = myGenerator;
jamesagnew marked this conversation as resolved.
Show resolved Hide resolved
if (generator == null) {
generator = new GraphQLSchemaGenerator(myContext, VersionUtil.getVersion());
myGenerator = generator;
}

final StringBuilder schemaBuilder = new StringBuilder();
try (Writer writer = new StringBuilderWriter(schemaBuilder)) {

// Generate FHIR base types schemas
myGenerator.generateTypes(writer, theOperations);
generator.generateTypes(writer, theOperations);

// Fix up a few things that are missing from the generated schema
writer.append("\ninterface Element {")
.append("\n id: ID")
.append("\n}")
.append("\n");
// writer
// .append("\ninterface Quantity {\n")
// .append("id: String\n")
// .append("extension: [Extension]\n")
// .append("value: decimal _value: ElementBase\n")
// .append("comparator: code _comparator: ElementBase\n")
// .append("unit: String _unit: ElementBase\n")
// .append("system: uri _system: ElementBase\n")
// .append("code: code _code: ElementBase\n")
// .append("\n}")
// .append("\n");

// writer
// .append("\ntype Resource {")
// .append("\n id: [token]" + "\n}")
// .append("\n");
// writer
// .append("\ninput ResourceInput {")
// .append("\n id: [token]" + "\n}")
// .append("\n");

// Generate schemas for the resource types
for (String nextResourceType : theResourceTypes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.hl7.fhir.r5.model.SubscriptionTopic;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.EventListener;

import java.util.HashSet;
import java.util.List;
Expand All @@ -59,6 +61,7 @@ public SubscriptionTopicLoader() {
}

@Override
@EventListener(classes = ContextStartedEvent.class)
jamesagnew marked this conversation as resolved.
Show resolved Hide resolved
public void registerListener() {
if (!myFhirContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.R4B)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
import com.google.common.annotations.VisibleForTesting;
import jakarta.annotation.Nonnull;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import org.apache.commons.lang3.time.DateUtils;
import org.hl7.fhir.instance.model.api.IBaseResource;
Expand All @@ -40,6 +39,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.EventListener;

import java.util.Collection;
Expand Down Expand Up @@ -78,7 +78,11 @@ protected BaseResourceCacheSynchronizer(
myResourceChangeListenerRegistry = theResourceChangeListenerRegistry;
}

@PostConstruct
/**
* This method performs a search in the DB, so use the {@link ContextStartedEvent}
* to ensure that it runs after the database initializer
*/
@EventListener(classes = ContextStartedEvent.class)
public void registerListener() {
if (myDaoRegistry.getResourceDaoOrNull(myResourceName) == null) {
ourLog.info("No resource DAO found for resource type {}, not registering listener", myResourceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,69 +134,66 @@ <h4>Search Parameters <small>Optionally add parameter(s) to the search</small></
<h4>Includes <small>Also include resources which are referenced by the search results</small></h4>
</div>
<div class="row">
<span th:each="include : ${includes}" class="includeCheckContainer">
<span class="includeCheckCheck">
<input type="checkbox" th:value="${include}" th:id="'inc_' + ${include}"></input>
<div class="col">
<span th:each="include : ${includes}" class="includeCheckContainer">
<span class="includeCheckCheck">
<input type="checkbox" th:value="${include}" th:id="'inc_' + ${include}"></input>
</span>
<span class="includeCheckName" th:text="${include}"/>
</span>
<span class="includeCheckName" th:text="${include}"/>
</span>
</div>
</div>

<!-- Results Sorting -->
<br clear="all"/>
<div class="row">
<h4>Sort Results</h4>
</div>
<div class="row">
<!-- Sort By... -->
<div class='col-sm-6'>
<label>Sort By</label>
<div class="btn-group">
<input type="hidden" id="sort_by" />
<button type="button" class="btn btn-info" id="search_sort_button">Default</button>
<button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown">
<span class="caret"></span>
<span class="visually-hidden">Default Sort</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:updateSort('');">Default Sort</a></li>
<li class="divider"></li>
<li th:each="nextParam : ${sortParams}"><a th:href="'javascript:updateSort(\'' + ${nextParam} + '\');'" th:text="${nextParam}"></a></li>
</ul>
</div>
<div class='col'>
<div class="input-group">
<label class="input-group-text">Sort By</label>
<input type="hidden" id="sort_by" />
<button type="button" class="btn btn-info" id="search_sort_button">Default</button>
<button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown">
<span class="caret"></span>
<span class="visually-hidden">Default Sort</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:updateSort('');">Default Sort</a></li>
<li class="divider"></li>
<li th:each="nextParam : ${sortParams}"><a th:href="'javascript:updateSort(\'' + ${nextParam} + '\');'" th:text="${nextParam}"></a></li>
</ul>

<label>Direction</label>
<div class="btn-group">
<input type="hidden" id="sort_direction" />
<button type="button" class="btn btn-info" id="search_sort_direction_button">Default</button>
<button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown">
<span class="caret"></span>
<span class="visually-hidden">Default Sort</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:updateSortDirection('');">Default</a></li>
<li class="divider"></li>
<li><a href="javascript:updateSortDirection('asc');">Ascending</a></li>
<li><a href="javascript:updateSortDirection('desc');">Descending</a></li>
</ul>
</div>
<label class="input-group-text">Direction</label>
<input type="hidden" id="sort_direction" />
<button type="button" class="btn btn-info" id="search_sort_direction_button">Default</button>
<button type="button" class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown">
<span class="caret"></span>
<span class="visually-hidden">Default Sort</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="javascript:updateSortDirection('');">Default</a></li>
<li class="divider"></li>
<li><a href="javascript:updateSortDirection('asc');">Ascending</a></li>
<li><a href="javascript:updateSortDirection('desc');">Descending</a></li>
</ul>
</div>
</div>
</div>
<br clear="all"/>

<!-- Other Options -->
<br clear="all"/>
<div class="row">
<h4>Other Options</h4>
<div class="col">
<h4>Other Options</h4>
</div>
</div>

<div class="row">
<div class='col-sm-3'>
<div class="form-group">
<div class='input-group date'>
<div class="input-group-addon">
Limit
</div>
<label class="input-group-text">Limit</label>
<input type="text" class="form-control" id="resource-search-limit" placeholder="max # returned"/>
</div>
</div>
Expand All @@ -209,15 +206,17 @@ <h4>Other Options</h4>
<h4>Reverse Includes <small>Also include resources which reference to the search results</small></h4>
</div>
<div class="row">
<span class="includeCheckCheck">
<input type="checkbox" th:value="'*'" th:id="'revinc_STAR'" />
</span>
<span class="includeCheckName" th:text="'*'"/>
<span th:each="include : ${revincludes}" class="includeCheckContainer">
<span class="includeCheckContainer">
<span class="includeCheckCheck">
<input type="checkbox" th:value="${include}" th:id="'revinc_' + ${include}" />
<input type="checkbox" th:value="'*'" th:id="'revinc_STAR'" />
</span>
<span class="includeCheckName" th:text="'*'"/>
<span th:each="include : ${revincludes}" class="includeCheckContainer">
<span class="includeCheckCheck">
<input type="checkbox" th:value="${include}" th:id="'revinc_' + ${include}" />
</span>
<span class="includeCheckName" th:text="${include}"/>
</span>
<span class="includeCheckName" th:text="${include}"/>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,46 @@ <h4>Options</h4>
<label class="navBarButtonLabel">Encoding</label>
<div class="btn-group" id="encodingBtnGroup" role="group">
<input type="radio" class="btn-check" name="encoding" id="encode-default" value="" />
<label class="btn btn-info" for="encode-default">(default)</label>
<label class="btn btn-outline-info" for="encode-default">(default)</label>

<input type="radio" class="btn-check" name="encoding" id="encode-xml" value="xml" />
<label class="btn btn-info" for="encode-xml">XML</label>
<label class="btn btn-outline-info" for="encode-xml">XML</label>

<input type="radio" class="btn-check" name="encoding" id="encode-json" value="json" />
<label class="btn btn-info" for="encode-json">JSON</label>
<label class="btn btn-outline-info" for="encode-json">JSON</label>
</div>

<!-- Pretty -->
<br /> <label class="navBarButtonLabel">Pretty</label>
<div role="group" class="btn-group" id="prettyBtnGroup" style="margin-top: 5px;">
<input type="radio" class="btn-check" name="pretty" id="pretty-default" value="" />
<label class="btn btn-info" for="pretty-default">(default)</label>
<label class="btn btn-outline-info" for="pretty-default">(default)</label>

<input type="radio" class="btn-check" name="pretty" id="pretty-true" value="true" />
<label class="btn btn-info" for="pretty-true">On</label>
<label class="btn btn-outline-info" for="pretty-true">On</label>

<input
type="radio" class="btn-check" name="pretty" id="pretty-false" value="false" />
<label class="btn btn-info" for="pretty-false"> Off</label>
<label class="btn btn-outline-info" for="pretty-false"> Off</label>
</div>

<!-- Summary -->
<br /> <label class="navBarButtonLabel">Summary</label>
<div role="group" class="btn-group" id="summaryBtnGroup" style="margin-top: 5px;">
<input type="radio" class="btn-check" name="_summary" id="summary-default" value="" />
<label class="btn btn-info" for="summary-default">(none)</label>
<label class="btn btn-outline-info" for="summary-default">(none)</label>

<input type="radio" class="btn-check" name="_summary" id="summary-true" value="true" />
<label class="btn btn-info" for="summary-true">true</label>
<label class="btn btn-outline-info" for="summary-true">true</label>

<input type="radio" class="btn-check" name="_summary" id="summary-text" value="text" />
<label class="btn btn-info" for="summary-text">text</label>
<label class="btn btn-outline-info" for="summary-text">text</label>

<input type="radio" class="btn-check" name="_summary" id="summary-data" value="data" />
<label class="btn btn-info" for="summary-data">data</label>
<label class="btn btn-outline-info" for="summary-data">data</label>

<input type="radio" class="btn-check" name="_summary" id="summary-count" value="count" />
<label class="btn btn-info" for="summary-count">count</label>
<label class="btn btn-outline-info" for="summary-count">count</label>
</div>

<script type="text/javascript" th:inline="javascript">
Expand Down Expand Up @@ -126,28 +126,30 @@ <h4>Options</h4>

<h4>Server</h4>

<ul class="nav nav-sidebar">
<li th:class="${page} == 'home' ? 'active' : ''">
<a href="#" onclick="doAction(this, 'home', null);">Server Home/Actions</a>
<ul class="nav flex-column nav-pills">
<li class="nav-item">
<a href="#" onclick="doAction(this, 'home', null);" class="nav-link" th:classappend="${page} == 'home' ? 'active' : ''">Server Home/Actions</a>
</li>
<li th:if="${supportsHfql}" th:class="${page} == 'hfql' ? 'active' : ''">
<a href="#" id="leftHfql" onclick="doAction(this, 'hfql', null);">HFQL / SQL</a>
<li th:if="${supportsHfql}" class="nav-item">
<a href="#" id="leftHfql" onclick="doAction(this, 'hfql', null);" class="nav-link" th:classappend="${page} == 'hfql' ? 'active' : ''">HFQL / SQL</a>
</li>
</ul>

<h4>Resources</h4>

<ul class="nav nav-sidebar" th:unless="${conf.rest.empty}">
<ul class="nav flex-column nav-pills" th:unless="${conf.rest.empty}">
<th:block th:each="resource, resIterStat : ${conf.rest[0].resource}">
<li th:class="${resourceName} == ${resource.typeElement.valueAsString} ? 'active' : ''">
<li class="nav-item">

<a
th:id="'leftResource' + ${resource.typeElement.valueAsString}"
href="#"
th:data1="${resource.typeElement.valueAsString}"
class="nav-link"
th:classappend="${resourceName} == ${resource.typeElement.valueAsString} ? 'active' : ''"
onclick="doAction(this, 'resource', this.getAttribute('data1'));">
<th:block th:text="${resource.typeElement.valueAsString}" >Patient</th:block>
<span class="badge badge-secondary" th:if="${resourceCounts[resource.typeElement.valueAsString]} != null" th:text="${resourceCounts[resource.typeElement.valueAsString]}"/>
<span class="badge text-bg-secondary" th:if="${resourceCounts[resource.typeElement.valueAsString]} != null" th:text="${resourceCounts[resource.typeElement.valueAsString]}"/>
</a>
</li>
</th:block>
Expand Down
Loading
Loading