Skip to content

Clinical Reasoning Dev Server#1011

Open
JPercival wants to merge 12 commits into
mainfrom
spike/cqf-fhir-cr-server
Open

Clinical Reasoning Dev Server#1011
JPercival wants to merge 12 commits into
mainfrom
spike/cqf-fhir-cr-server

Conversation

@JPercival
Copy link
Copy Markdown
Contributor

  • Stripped down version of HAPI that shims in an InMemoryRepository behind the REST API

JPercival and others added 3 commits April 25, 2026 18:01
New module that mounts HAPI's RestfulServer on Spring Boot's embedded
Tomcat, registers the existing operation providers from cqf-fhir-cr-hapi,
and bridges plain CRUD + search + transactions to an in-memory IRepository.

- RepositoryResourceProvider<T>: HAPI @Read/@Create/@Update/@Delete/@Search
  per resource type, delegating to IRepositoryFactory.create(rd).{op}.
  One instance is registered for every concrete FHIR resource type.
- RepositorySystemProvider: @transaction at the base path, routing bundles
  through IRepository.transaction.
- SearchParameterTranslator: raw URL params -> typed IQueryParameterType
  using FhirContext's RuntimeSearchParam registry.
- ServerR4Config: standalone wiring (FhirContext, RestfulServer,
  ServletRegistrationBean, IRepositoryFactory, MeasureOperationsProvider)
  without importing CrR4Config — that class @imports the JPA-coupled
  RepositoryConfig which requires DaoRegistry.
- @SpringBootApplication excludes JPA / Hibernate / Quartz auto-configs;
  application.yml further excludes Elasticsearch + Thymeleaf surprise
  auto-configs from HAPI's transitives.
- Dockerfile (eclipse-temurin:17-jre, ~531 MB) and Dockerfile.jlink
  (jdeps + jlink + distroless, ~356 MB).
- gradle tasks: dockerBuild, dockerBuildJlink, bootBuildImage.

Boot ~2.4 s. Hibernate, Quartz, Elasticsearch all stay dormant. 9
integration tests exercise CRUD round-trips, search by id, transaction
bundles, conditional create header pass-through, and $evaluate-measure
end-to-end against the in-memory repository.

Known gaps: only the Measure operation chain is wired (other operations
need their bean trees mirrored from CrR4Config); conditional CRUD by URL
is rejected; FHIR validator pulls org.hl7.fhir.r5/r4b/dstu3/dstu2016may
model classes via reflection so non-R4 versions can't be excluded yet.
A Phase 2 split of cqf-fhir-cr-hapi to lift its JPA tail will shave the
remaining ~80 MB from the image.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
On a tag matching `v*` (e.g. `v4.7.0`):
- Build cqf-fhir-cr-server's bootJar.
- Build the jlink Docker image (Dockerfile.jlink: jdeps + jlink + distroless).
- Push to ghcr.io/cqframework/clinical-reasoning/cqf-fhir-cr-server with
  tags `<semver>` and `<semver>-jlink`.
- Tag :latest only for stable releases (no rc/alpha/beta suffix), so a
  pre-release won't move the floating tag.

Uses the workflow-provided GITHUB_TOKEN with `packages: write`; no PAT or
extra secret required. The non-jlink image is intentionally not published
yet — jlink is the recommended runtime artifact.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 26, 2026

Formatting check succeeded!

JPercival and others added 4 commits April 25, 2026 18:12
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Application is a Spring @configuration class (via @SpringBootApplication) so
Spring instantiates it as a CGLIB-proxied bean — a private constructor would
break startup. Adding a no-op instance run() method makes it not look like a
utility class to checkstyle's HideUtilityClassConstructor rule, and gives a
testable seam without touching framework semantics.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@lukedegruchy lukedegruchy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with the caveat that we need to fix the sonar warnings and add a README.

push:
tags:
- 'v*'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a README on how to use this.

*/
@ConfigurationProperties(prefix = "cqf.server")
public class ServerProperties {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the sonar warning on this class and other classes.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
65.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants