Merge remote-tracking branch 'origin/master' into do-20230731-bump-to-hapi-6-8-0

This commit is contained in:
dotasek
2023-07-31 15:23:57 -04:00
31 changed files with 213 additions and 160 deletions

View File

@@ -11,6 +11,4 @@ helm-extra-args: --timeout 300s
upgrade: true upgrade: true
skip-missing-values: true skip-missing-values: true
release-label: release release-label: release
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
release-name-template: "helm-v{{ .Version }}" release-name-template: "helm-v{{ .Version }}"

View File

@@ -9,10 +9,14 @@ on:
jobs: jobs:
release: release:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Add workspace as safe directory
run: |
git config --global --add safe.directory /__w/hapi-fhir-jpaserver-starter/hapi-fhir-jpaserver-starter
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -21,14 +25,11 @@ jobs:
git config user.name "$GITHUB_ACTOR" git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Add bitnami repo
run: helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Update dependencies - name: Update dependencies
run: find charts/ ! -path charts/ -maxdepth 1 -type d -exec helm dependency update {} \; run: find charts/ ! -path charts/ -maxdepth 1 -type d -exec helm dependency update {} \;
- name: Run chart-releaser - name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0 uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
with: with:
config: .github/ct/config.yaml config: .github/ct/config.yaml
env: env:

View File

@@ -9,8 +9,8 @@ on:
jobs: jobs:
lint: lint:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
container: quay.io/helmpack/chart-testing:v3.4.0 container: quay.io/helmpack/chart-testing:v3.8.0@sha256:f058c660a28d99a9394ae081d98921efe068079531f247c86b8054e3c9d407aa
steps: steps:
- name: Install helm-docs - name: Install helm-docs
working-directory: /tmp working-directory: /tmp
@@ -22,11 +22,14 @@ jobs:
chmod +x /usr/local/bin/helm-docs && \ chmod +x /usr/local/bin/helm-docs && \
helm-docs --version helm-docs --version
- name: Add workspace as safe directory
run: |
git config --global --add safe.directory /__w/hapi-fhir-jpaserver-starter/hapi-fhir-jpaserver-starter
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Check if documentation is up-to-date - name: Check if documentation is up-to-date
run: helm-docs && git diff --exit-code HEAD run: helm-docs && git diff --exit-code HEAD
@@ -34,20 +37,20 @@ jobs:
run: ct lint --config .github/ct/config.yaml run: ct lint --config .github/ct/config.yaml
test: test:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
k8s-version: [1.22.9, 1.23.6, 1.24.1] k8s-version: [1.25.9, 1.26.4, 1.27.2]
needs: needs:
- lint - lint
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up chart-testing - name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1 uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0
- name: Run chart-testing (list-changed) - name: Run chart-testing (list-changed)
id: list-changed id: list-changed
@@ -58,13 +61,12 @@ jobs:
fi fi
- name: Create k8s Kind Cluster - name: Create k8s Kind Cluster
uses: helm/kind-action@v1.2.0 uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67 # v1.7.0
if: steps.list-changed.outputs.changed == 'true' if: ${{ steps.list-changed.outputs.changed == 'true' }}
with: with:
version: v0.14.0
cluster_name: kind-cluster-k8s-${{ matrix.k8s-version }} cluster_name: kind-cluster-k8s-${{ matrix.k8s-version }}
node_image: kindest/node:v${{ matrix.k8s-version }} node_image: kindest/node:v${{ matrix.k8s-version }}
- name: Run chart-testing (install) - name: Run chart-testing (install)
run: ct install --config .github/ct/config.yaml run: ct install --config .github/ct/config.yaml
if: steps.list-changed.outputs.changed == 'true' if: ${{ steps.list-changed.outputs.changed == 'true' }}

View File

@@ -1,7 +1,7 @@
FROM maven:3.8-openjdk-17-slim as build-hapi FROM docker.io/library/maven:3.9.2-eclipse-temurin-17 AS build-hapi
WORKDIR /tmp/hapi-fhir-jpaserver-starter WORKDIR /tmp/hapi-fhir-jpaserver-starter
ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.17.0 ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.26.0
RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar
COPY pom.xml . COPY pom.xml .
@@ -18,7 +18,7 @@ RUN mkdir /app && cp /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /app/main.
########### bitnami tomcat version is suitable for debugging and comes with a shell ########### bitnami tomcat version is suitable for debugging and comes with a shell
########### it can be built using eg. `docker build --target tomcat .` ########### it can be built using eg. `docker build --target tomcat .`
FROM bitnami/tomcat:9.0 as tomcat FROM bitnami/tomcat:9.0 AS tomcat
RUN rm -rf /opt/bitnami/tomcat/webapps/ROOT && \ RUN rm -rf /opt/bitnami/tomcat/webapps/ROOT && \
mkdir -p /opt/bitnami/hapi/data/hapi/lucenefiles && \ mkdir -p /opt/bitnami/hapi/data/hapi/lucenefiles && \
@@ -36,7 +36,7 @@ COPY --from=build-hapi --chown=1001:1001 /tmp/hapi-fhir-jpaserver-starter/opente
ENV ALLOW_EMPTY_PASSWORD=yes ENV ALLOW_EMPTY_PASSWORD=yes
########### distroless brings focus on security and runs on plain spring boot - this is the default image ########### distroless brings focus on security and runs on plain spring boot - this is the default image
FROM gcr.io/distroless/java17-debian11:nonroot as default FROM gcr.io/distroless/java17-debian11:nonroot AS default
# 65532 is the nonroot user's uid # 65532 is the nonroot user's uid
# used here instead of the name to allow Kubernetes to easily detect that the container # used here instead of the name to allow Kubernetes to easily detect that the container
# is running as a non-root (uid != 0) user. # is running as a non-root (uid != 0) user.
@@ -46,4 +46,4 @@ WORKDIR /app
COPY --chown=nonroot:nonroot --from=build-distroless /app /app COPY --chown=nonroot:nonroot --from=build-distroless /app /app
COPY --chown=nonroot:nonroot --from=build-hapi /tmp/hapi-fhir-jpaserver-starter/opentelemetry-javaagent.jar /app COPY --chown=nonroot:nonroot --from=build-hapi /tmp/hapi-fhir-jpaserver-starter/opentelemetry-javaagent.jar /app
ENTRYPOINT ["java", "--class-path", "/app/main.war", "-Dloader.path=main.war!/WEB-INF/classes/,main.war!/WEB-INF/,/app/extra-classes", "org.springframework.boot.loader.PropertiesLauncher", "app/main.war"] ENTRYPOINT ["java", "--class-path", "/app/main.war", "-Dloader.path=main.war!/WEB-INF/classes/,main.war!/WEB-INF/,/app/extra-classes", "org.springframework.boot.loader.PropertiesLauncher"]

View File

@@ -1,6 +1,6 @@
dependencies: dependencies:
- name: postgresql - name: postgresql
repository: https://charts.bitnami.com/bitnami repository: oci://registry-1.docker.io/bitnamicharts
version: 12.1.2 version: 12.5.6
digest: sha256:525689611a29f90b0bc8cd674df5d97024c99eda8104216390f6747904fd0208 digest: sha256:4d21dbc02bbdb55b957b0093e37376853727de82396abfadfaf1d738bd51b8e6
generated: "2022-11-21T22:55:45.1699395+01:00" generated: "2023-06-03T20:58:45.922102213+02:00"

View File

@@ -7,17 +7,21 @@ sources:
- https://github.com/hapifhir/hapi-fhir-jpaserver-starter - https://github.com/hapifhir/hapi-fhir-jpaserver-starter
dependencies: dependencies:
- name: postgresql - name: postgresql
version: 12.1.2 version: 12.5.6
repository: https://charts.bitnami.com/bitnami repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled condition: postgresql.enabled
appVersion: 6.2.2 appVersion: 6.6.0
version: 0.11.1 version: 0.13.0
annotations: annotations:
artifacthub.io/license: Apache-2.0 artifacthub.io/license: Apache-2.0
artifacthub.io/changes: | artifacthub.io/changes: |
# When using the list of objects option the valid supported kinds are # When using the list of objects option the valid supported kinds are
# added, changed, deprecated, removed, fixed, and security. # added, changed, deprecated, removed, fixed, and security.
- kind: added
description: allow specifying application properties via yaml config
- kind: added
description: allow setting resource limits and requests for the Helm test pods
- kind: changed - kind: changed
description: updated HAPI FHIR JPA Server app image version to v6.2.2 description: updated curl used by helm tests to version to v8.2.0
- kind: changed - kind: changed
description: updated curl used by helm tests to version to v7.87.0 description: allow disabling the liveness-, readiness-, and startup-probes entirely

View File

@@ -1,6 +1,6 @@
# HAPI FHIR JPA Server Starter Helm Chart # HAPI FHIR JPA Server Starter Helm Chart
![Version: 0.11.1](https://img.shields.io/badge/Version-0.11.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.2.2](https://img.shields.io/badge/AppVersion-6.2.2-informational?style=flat-square) ![Version: 0.13.0](https://img.shields.io/badge/Version-0.13.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.6.0](https://img.shields.io/badge/AppVersion-6.6.0-informational?style=flat-square)
This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes environment. This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes environment.
@@ -8,11 +8,14 @@ This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes e
```sh ```sh
helm repo add hapifhir https://hapifhir.github.io/hapi-fhir-jpaserver-starter/ helm repo add hapifhir https://hapifhir.github.io/hapi-fhir-jpaserver-starter/
helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
``` ```
> ⚠ By default, the included [PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading) ## Requirements
> auto-generates a random password for the database which may cause problems when upgrading the chart (see [here for details](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading)).
| Repository | Name | Version |
|------------|------|---------|
| oci://registry-1.docker.io/bitnamicharts | postgresql | 12.5.6 |
## Values ## Values
@@ -27,12 +30,13 @@ helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpas
| externalDatabase.password | string | `""` | database password | | externalDatabase.password | string | `""` | database password |
| externalDatabase.port | int | `5432` | database port number | | externalDatabase.port | int | `5432` | database port number |
| externalDatabase.user | string | `"fhir"` | username for the external database | | externalDatabase.user | string | `"fhir"` | username for the external database |
| extraConfig | string | `""` | additional Spring Boot application config. Mounted as a file and automatically loaded by the application. |
| extraEnv | list | `[]` | extra environment variables to set on the server container | | extraEnv | list | `[]` | extra environment variables to set on the server container |
| fullnameOverride | string | `""` | override the chart fullname | | fullnameOverride | string | `""` | override the chart fullname |
| image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy to use | | image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy to use |
| image.registry | string | `"docker.io"` | registry where the HAPI FHIR server image is hosted | | image.registry | string | `"docker.io"` | registry where the HAPI FHIR server image is hosted |
| image.repository | string | `"hapiproject/hapi"` | the path inside the repository | | image.repository | string | `"hapiproject/hapi"` | the path inside the repository |
| image.tag | string | `"v6.2.2@sha256:9c4e8af94d81ac0049dbb589e4cd855bf78c9c13be6f6844e814c63d63545b44"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. | | image.tag | string | `"v6.6.0@sha256:c00367865ae5dad4e171cbb68bfc1c39818854079d1565bee4c86a45e78335d0"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. |
| imagePullSecrets | list | `[]` | image pull secrets to use when pulling the image | | imagePullSecrets | list | `[]` | image pull secrets to use when pulling the image |
| ingress.annotations | object | `{}` | provide any additional annotations which may be required. Evaluated as a template. | | ingress.annotations | object | `{}` | provide any additional annotations which may be required. Evaluated as a template. |
| ingress.enabled | bool | `false` | whether to create an Ingress to expose the FHIR server HTTP endpoint | | ingress.enabled | bool | `false` | whether to create an Ingress to expose the FHIR server HTTP endpoint |
@@ -40,11 +44,6 @@ helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpas
| ingress.hosts[0].pathType | string | `"ImplementationSpecific"` | | | ingress.hosts[0].pathType | string | `"ImplementationSpecific"` | |
| ingress.hosts[0].paths[0] | string | `"/"` | | | ingress.hosts[0].paths[0] | string | `"/"` | |
| ingress.tls | list | `[]` | ingress TLS config | | ingress.tls | list | `[]` | ingress TLS config |
| livenessProbe.failureThreshold | int | `5` | |
| livenessProbe.initialDelaySeconds | int | `30` | |
| livenessProbe.periodSeconds | int | `20` | |
| livenessProbe.successThreshold | int | `1` | |
| livenessProbe.timeoutSeconds | int | `30` | |
| metrics.service.port | int | `8081` | | | metrics.service.port | int | `8081` | |
| metrics.serviceMonitor.additionalLabels | object | `{}` | additional labels to apply to the ServiceMonitor object, e.g. `release: prometheus` | | metrics.serviceMonitor.additionalLabels | object | `{}` | additional labels to apply to the ServiceMonitor object, e.g. `release: prometheus` |
| metrics.serviceMonitor.enabled | bool | `false` | if enabled, creates a ServiceMonitor instance for Prometheus Operator-based monitoring | | metrics.serviceMonitor.enabled | bool | `false` | if enabled, creates a ServiceMonitor instance for Prometheus Operator-based monitoring |
@@ -62,11 +61,6 @@ helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpas
| postgresql.primary.containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | | | postgresql.primary.containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | |
| postgresql.primary.containerSecurityContext.runAsNonRoot | bool | `true` | | | postgresql.primary.containerSecurityContext.runAsNonRoot | bool | `true` | |
| postgresql.primary.containerSecurityContext.seccompProfile.type | string | `"RuntimeDefault"` | | | postgresql.primary.containerSecurityContext.seccompProfile.type | string | `"RuntimeDefault"` | |
| readinessProbe.failureThreshold | int | `5` | |
| readinessProbe.initialDelaySeconds | int | `30` | |
| readinessProbe.periodSeconds | int | `20` | |
| readinessProbe.successThreshold | int | `1` | |
| readinessProbe.timeoutSeconds | int | `20` | |
| replicaCount | int | `1` | number of replicas to deploy | | replicaCount | int | `1` | number of replicas to deploy |
| resources | object | `{}` | configure the FHIR server's resource requests and limits | | resources | object | `{}` | configure the FHIR server's resource requests and limits |
| securityContext.allowPrivilegeEscalation | bool | `false` | | | securityContext.allowPrivilegeEscalation | bool | `false` | |
@@ -79,18 +73,14 @@ helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpas
| securityContext.seccompProfile.type | string | `"RuntimeDefault"` | | | securityContext.seccompProfile.type | string | `"RuntimeDefault"` | |
| service.port | int | `8080` | port where the server will be exposed at | | service.port | int | `8080` | port where the server will be exposed at |
| service.type | string | `"ClusterIP"` | service type | | service.type | string | `"ClusterIP"` | service type |
| startupProbe.failureThreshold | int | `10` | | | tests.resources | object | `{}` | configure the test pods resource requests and limits |
| startupProbe.initialDelaySeconds | int | `30` | |
| startupProbe.periodSeconds | int | `30` | |
| startupProbe.successThreshold | int | `1` | |
| startupProbe.timeoutSeconds | int | `30` | |
| tolerations | list | `[]` | pod tolerations | | tolerations | list | `[]` | pod tolerations |
| topologySpreadConstraints | list | `[]` | pod topology spread configuration see: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#api | | topologySpreadConstraints | list | `[]` | pod topology spread configuration see: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#api |
## Development ## Development
To update the Helm chart when a new version of the `hapiproject/hapi` image is released, [values.yaml](values.yaml) `image.tag` and the [Chart.yaml](Chart.yaml)'s To update the Helm chart when a new version of the `hapiproject/hapi` image is released, [values.yaml](values.yaml) `image.tag` and the [Chart.yaml](Chart.yaml)'s
`version` and optionally the `appVersion` field on major releases need to be updated. Afterwards, re-generate the [README.md](README.md) `version` and optionally the `appVersion` field need to be updated. Afterwards, re-generate the [README.md](README.md)
by running: by running:
```sh ```sh

View File

@@ -8,18 +8,17 @@ This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes e
```sh ```sh
helm repo add hapifhir https://hapifhir.github.io/hapi-fhir-jpaserver-starter/ helm repo add hapifhir https://hapifhir.github.io/hapi-fhir-jpaserver-starter/
helm install --render-subchart-notes hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
``` ```
> ⚠ By default, the included [PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading) {{ template "chart.requirementsSection" . }}
> auto-generates a random password for the database which may cause problems when upgrading the chart (see [here for details](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#upgrading)).
{{ template "chart.valuesSection" . }} {{ template "chart.valuesSection" . }}
## Development ## Development
To update the Helm chart when a new version of the `hapiproject/hapi` image is released, [values.yaml](values.yaml) `image.tag` and the [Chart.yaml](Chart.yaml)'s To update the Helm chart when a new version of the `hapiproject/hapi` image is released, [values.yaml](values.yaml) `image.tag` and the [Chart.yaml](Chart.yaml)'s
`version` and optionally the `appVersion` field on major releases need to be updated. Afterwards, re-generate the [README.md](README.md) `version` and optionally the `appVersion` field need to be updated. Afterwards, re-generate the [README.md](README.md)
by running: by running:
```sh ```sh

View File

@@ -0,0 +1,17 @@
extraConfig: |
hapi:
fhir:
cr_enabled: true
tester:
home:
name: Hello HAPI FHIR
server_address: "http://fhir-server.127.0.0.1.nip.io/fhir"
refuse_to_fetch_third_party_urls: true
fhir_version: R4
ingress:
enabled: true
hosts:
- host: fhir-server.127.0.0.1.nip.io
pathType: ImplementationSpecific
paths: ["/"]

View File

@@ -0,0 +1,11 @@
{{- if .Values.extraConfig -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "hapi-fhir-jpaserver.fullname" . }}-application-config
labels:
{{- include "hapi-fhir-jpaserver.labels" . | nindent 4 }}
data:
application-extra.yaml: |-
{{ .Values.extraConfig | nindent 4 }}
{{- end }}

View File

@@ -30,7 +30,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers: initContainers:
- name: wait-for-db-to-be-ready - name: wait-for-db-to-be-ready
image: docker.io/bitnami/postgresql:15.1.0-debian-11-r0@sha256:27915588d5203a10a1c23624d9c81644437f33b7c224e25f79bcd9bd09bbb8e2 image: docker.io/bitnami/postgresql:15.3.0-debian-11-r7@sha256:cc301eef743685f4f69d1d719853988e8a9650c90fd9521f4742ce400b3fdf6a
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
{{- with .Values.restrictedContainerSecurityContext }} {{- with .Values.restrictedContainerSecurityContext }}
securityContext: securityContext:
@@ -63,38 +63,17 @@ spec:
- name: http-metrics - name: http-metrics
containerPort: 8081 containerPort: 8081
protocol: TCP protocol: TCP
startupProbe:
httpGet:
path: /readyz
port: http
{{- with .Values.startupProbe }} {{- with .Values.startupProbe }}
initialDelaySeconds: {{ .initialDelaySeconds }} startupProbe:
periodSeconds: {{ .periodSeconds }} {{- toYaml . | nindent 12 }}
timeoutSeconds: {{ .timeoutSeconds }}
successThreshold: {{ .successThreshold }}
failureThreshold: {{ .failureThreshold }}
{{- end }} {{- end }}
readinessProbe:
httpGet:
path: /readyz
port: http
{{- with .Values.readinessProbe }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
successThreshold: {{ .successThreshold }}
failureThreshold: {{ .failureThreshold }}
{{- end }}
livenessProbe:
httpGet:
path: /livez
port: http
{{- with .Values.livenessProbe }} {{- with .Values.livenessProbe }}
initialDelaySeconds: {{ .initialDelaySeconds }} livenessProbe:
periodSeconds: {{ .periodSeconds }} {{- toYaml . | nindent 12 }}
timeoutSeconds: {{ .timeoutSeconds }} {{- end }}
successThreshold: {{ .successThreshold }} {{- with .Values.readinessProbe }}
failureThreshold: {{ .failureThreshold }} readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
@@ -118,6 +97,10 @@ spec:
value: "true" value: "true"
- name: MANAGEMENT_SERVER_PORT - name: MANAGEMENT_SERVER_PORT
value: "8081" value: "8081"
{{- if .Values.extraConfig }}
- name: SPRING_CONFIG_IMPORT
value: "/app/config/application-extra.yaml"
{{- end }}
{{- if .Values.extraEnv }} {{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | nindent 12 }} {{ toYaml .Values.extraEnv | nindent 12 }}
{{- end }} {{- end }}
@@ -126,6 +109,12 @@ spec:
name: tmp-volume name: tmp-volume
- mountPath: /app/target - mountPath: /app/target
name: lucenefiles-volume name: lucenefiles-volume
{{- if .Values.extraConfig }}
- name: application-extra-config
mountPath: /app/config/application-extra.yaml
readOnly: true
subPath: application-extra.yaml
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@@ -147,3 +136,8 @@ spec:
emptyDir: {} emptyDir: {}
- name: lucenefiles-volume - name: lucenefiles-volume
emptyDir: {} emptyDir: {}
{{- if .Values.extraConfig }}
- name: application-extra-config
configMap:
name: {{ include "hapi-fhir-jpaserver.fullname" . }}-application-config
{{- end }}

View File

@@ -11,20 +11,17 @@ spec:
restartPolicy: Never restartPolicy: Never
containers: containers:
- name: test-metadata-endpoint - name: test-metadata-endpoint
image: docker.io/curlimages/curl:7.87.0@sha256:f7f265d5c64eb4463a43a99b6bf773f9e61a50aaa7cefaf564f43e42549a01dd image: "{{ .Values.curl.image.registry }}/{{ .Values.curl.image.repository }}:{{ .Values.curl.image.tag }}"
command: ["curl", "--fail-with-body"] command: ["curl", "--fail-with-body"]
args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/metadata?_summary=true"] args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/metadata?_summary=true"]
{{- with .Values.restrictedContainerSecurityContext }} {{- with .Values.restrictedContainerSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- with .Values.tests.resources }}
resources: resources:
limits: {{- toYaml . | nindent 8 }}
cpu: 100m {{- end }}
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
livenessProbe: livenessProbe:
exec: exec:
command: ["true"] command: ["true"]
@@ -32,20 +29,17 @@ spec:
exec: exec:
command: ["true"] command: ["true"]
- name: test-patient-endpoint - name: test-patient-endpoint
image: docker.io/curlimages/curl:7.87.0@sha256:f7f265d5c64eb4463a43a99b6bf773f9e61a50aaa7cefaf564f43e42549a01dd image: "{{ .Values.curl.image.registry }}/{{ .Values.curl.image.repository }}:{{ .Values.curl.image.tag }}"
command: ["curl", "--fail-with-body"] command: ["curl", "--fail-with-body"]
args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/Patient?_count=1&_summary=true"] args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.service.port }}/fhir/Patient?_count=1&_summary=true"]
{{- with .Values.restrictedContainerSecurityContext }} {{- with .Values.restrictedContainerSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- with .Values.tests.resources }}
resources: resources:
limits: {{- toYaml . | nindent 8 }}
cpu: 100m {{- end }}
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
livenessProbe: livenessProbe:
exec: exec:
command: ["true"] command: ["true"]
@@ -53,20 +47,17 @@ spec:
exec: exec:
command: ["true"] command: ["true"]
- name: test-metrics-endpoint - name: test-metrics-endpoint
image: docker.io/curlimages/curl:7.87.0@sha256:f7f265d5c64eb4463a43a99b6bf773f9e61a50aaa7cefaf564f43e42549a01dd image: "{{ .Values.curl.image.registry }}/{{ .Values.curl.image.repository }}:{{ .Values.curl.image.tag }}"
command: ["curl", "--fail-with-body"] command: ["curl", "--fail-with-body"]
args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.metrics.service.port }}/actuator/prometheus"] args: ["http://{{ include "hapi-fhir-jpaserver.fullname" . }}:{{ .Values.metrics.service.port }}/actuator/prometheus"]
{{- with .Values.restrictedContainerSecurityContext }} {{- with .Values.restrictedContainerSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- with .Values.tests.resources }}
resources: resources:
limits: {{- toYaml . | nindent 8 }}
cpu: 100m {{- end }}
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
livenessProbe: livenessProbe:
exec: exec:
command: ["true"] command: ["true"]

View File

@@ -7,7 +7,7 @@ image:
# -- the path inside the repository # -- the path inside the repository
repository: hapiproject/hapi repository: hapiproject/hapi
# -- the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. # -- the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image.
tag: "v6.2.2@sha256:9c4e8af94d81ac0049dbb589e4cd855bf78c9c13be6f6844e814c63d63545b44" tag: "v6.6.0@sha256:c00367865ae5dad4e171cbb68bfc1c39818854079d1565bee4c86a45e78335d0"
# -- image pullPolicy to use # -- image pullPolicy to use
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
@@ -131,27 +131,42 @@ postgresql:
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
# -- readiness probe
# @ignored
readinessProbe: readinessProbe:
httpGet:
path: /readyz
port: http
failureThreshold: 5 failureThreshold: 5
initialDelaySeconds: 30 initialDelaySeconds: 30
periodSeconds: 20 periodSeconds: 20
successThreshold: 1 successThreshold: 1
timeoutSeconds: 20 timeoutSeconds: 20
startupProbe: # -- liveness probe
failureThreshold: 10 # @ignored
initialDelaySeconds: 30
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 30
livenessProbe: livenessProbe:
httpGet:
path: /livez
port: http
failureThreshold: 5 failureThreshold: 5
initialDelaySeconds: 30 initialDelaySeconds: 30
periodSeconds: 20 periodSeconds: 20
successThreshold: 1 successThreshold: 1
timeoutSeconds: 30 timeoutSeconds: 30
# -- startup probe
# @ignored
startupProbe:
httpGet:
path: /readyz
port: http
failureThreshold: 10
initialDelaySeconds: 30
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 30
externalDatabase: externalDatabase:
# -- external database host used with `postgresql.enabled=false` # -- external database host used with `postgresql.enabled=false`
host: localhost host: localhost
@@ -208,3 +223,32 @@ restrictedContainerSecurityContext:
runAsGroup: 65534 runAsGroup: 65534
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
# @ignored
curl:
image:
registry: docker.io
repository: curlimages/curl
tag: 8.2.0@sha256:daf3f46a2639c1613b25e85c9ee4193af8a1d538f92483d67f9a3d7f21721827
tests:
# -- configure the test pods resource requests and limits
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# -- additional Spring Boot application config. Mounted as a file and automatically loaded by the application.
extraConfig: ""
# # For example:
# |
# hapi:
# fhir:
# implementationguides:
# gh_0_1_0:
# url: https://build.fhir.org/ig/hl7-eu/gravitate-health/package.tgz
# name: hl7.eu.fhir.gh
# version: 0.1.0

View File

@@ -5,16 +5,17 @@ import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings.ClientIdStrategyEnum; import ca.uhn.fhir.jpa.api.config.JpaStorageSettings.ClientIdStrategyEnum;
import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel; import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel;
import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.api.EncodingEnum;
import com.google.common.collect.ImmutableList;
import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Set;
@ConfigurationProperties(prefix = "hapi.fhir") @ConfigurationProperties(prefix = "hapi.fhir")
@Configuration @Configuration
@@ -33,6 +34,7 @@ public class AppProperties {
private Boolean allow_multiple_delete = false; private Boolean allow_multiple_delete = false;
private Boolean allow_override_default_search_params = true; private Boolean allow_override_default_search_params = true;
private Boolean auto_create_placeholder_reference_targets = false; private Boolean auto_create_placeholder_reference_targets = false;
private final Set<String> auto_version_reference_at_paths = new HashSet<>();
private Boolean dao_scheduling_enabled = true; private Boolean dao_scheduling_enabled = true;
private Boolean delete_expunge_enabled = false; private Boolean delete_expunge_enabled = false;
private Boolean enable_index_missing_fields = false; private Boolean enable_index_missing_fields = false;
@@ -85,7 +87,7 @@ public class AppProperties {
private Integer bundle_batch_pool_size = 20; private Integer bundle_batch_pool_size = 20;
private Integer bundle_batch_pool_max_size = 100; private Integer bundle_batch_pool_max_size = 100;
private final List<String> local_base_urls = new ArrayList<>(); private final Set<String> local_base_urls = new HashSet<>();
private final List<String> custom_interceptor_classes = new ArrayList<>(); private final List<String> custom_interceptor_classes = new ArrayList<>();
@@ -307,6 +309,10 @@ public class AppProperties {
this.auto_create_placeholder_reference_targets = auto_create_placeholder_reference_targets; this.auto_create_placeholder_reference_targets = auto_create_placeholder_reference_targets;
} }
public Set<String> getAuto_version_reference_at_paths() {
return auto_version_reference_at_paths;
}
public Integer getDefault_page_size() { public Integer getDefault_page_size() {
return default_page_size; return default_page_size;
} }
@@ -571,13 +577,13 @@ public class AppProperties {
this.bundle_batch_pool_max_size = bundle_batch_pool_max_size; this.bundle_batch_pool_max_size = bundle_batch_pool_max_size;
} }
public List<String> getLocal_base_urls() { public Set<String> getLocal_base_urls() {
return local_base_urls; return local_base_urls;
} }
public static class Cors { public static class Cors {
private Boolean allow_Credentials = true; private Boolean allow_Credentials = true;
private List<String> allowed_origin = ImmutableList.of("*"); private List<String> allowed_origin = List.of("*");
public List<String> getAllowed_origin() { public List<String> getAllowed_origin() {
return allowed_origin; return allowed_origin;

View File

@@ -9,7 +9,6 @@ import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMod
import ca.uhn.fhir.jpa.model.entity.StorageSettings; import ca.uhn.fhir.jpa.model.entity.StorageSettings;
import ca.uhn.fhir.jpa.starter.AppProperties; import ca.uhn.fhir.jpa.starter.AppProperties;
import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider; import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider;
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl; import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender; import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
import ca.uhn.fhir.rest.server.mail.IMailSvc; import ca.uhn.fhir.rest.server.mail.IMailSvc;
@@ -26,8 +25,6 @@ import org.springframework.context.annotation.Primary;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.util.HashSet;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -49,6 +46,7 @@ public class FhirServerConfigCommon {
ourLog.info("Server configured to " + (appProperties.getExpunge_enabled() ? "enable" : "disable") + " expunges"); ourLog.info("Server configured to " + (appProperties.getExpunge_enabled() ? "enable" : "disable") + " expunges");
ourLog.info("Server configured to " + (appProperties.getAllow_override_default_search_params() ? "allow" : "deny") + " overriding default search params"); ourLog.info("Server configured to " + (appProperties.getAllow_override_default_search_params() ? "allow" : "deny") + " overriding default search params");
ourLog.info("Server configured to " + (appProperties.getAuto_create_placeholder_reference_targets() ? "allow" : "disable") + " auto-creating placeholder references"); ourLog.info("Server configured to " + (appProperties.getAuto_create_placeholder_reference_targets() ? "allow" : "disable") + " auto-creating placeholder references");
ourLog.info("Server configured to auto-version references at paths {}", appProperties.getAuto_version_reference_at_paths());
if (appProperties.getSubscription().getEmail() != null) { if (appProperties.getSubscription().getEmail() != null) {
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail(); AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
@@ -84,8 +82,9 @@ public class FhirServerConfigCommon {
public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) { public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
JpaStorageSettings jpaStorageSettings = new JpaStorageSettings(); JpaStorageSettings jpaStorageSettings = new JpaStorageSettings();
jpaStorageSettings.setIndexMissingFields(appProperties.getEnable_index_missing_fields() ? JpaStorageSettings.IndexEnabledEnum.ENABLED : JpaStorageSettings.IndexEnabledEnum.DISABLED); jpaStorageSettings.setIndexMissingFields(appProperties.getEnable_index_missing_fields() ? StorageSettings.IndexEnabledEnum.ENABLED : StorageSettings.IndexEnabledEnum.DISABLED);
jpaStorageSettings.setAutoCreatePlaceholderReferenceTargets(appProperties.getAuto_create_placeholder_reference_targets()); jpaStorageSettings.setAutoCreatePlaceholderReferenceTargets(appProperties.getAuto_create_placeholder_reference_targets());
jpaStorageSettings.setAutoVersionReferenceAtPaths(appProperties.getAuto_version_reference_at_paths());
jpaStorageSettings.setEnforceReferentialIntegrityOnWrite(appProperties.getEnforce_referential_integrity_on_write()); jpaStorageSettings.setEnforceReferentialIntegrityOnWrite(appProperties.getEnforce_referential_integrity_on_write());
jpaStorageSettings.setEnforceReferentialIntegrityOnDelete(appProperties.getEnforce_referential_integrity_on_delete()); jpaStorageSettings.setEnforceReferentialIntegrityOnDelete(appProperties.getEnforce_referential_integrity_on_delete());
jpaStorageSettings.setAllowContainsSearches(appProperties.getAllow_contains_searches()); jpaStorageSettings.setAllowContainsSearches(appProperties.getAllow_contains_searches());
@@ -127,9 +126,9 @@ public class FhirServerConfigCommon {
jpaStorageSettings.setFilterParameterEnabled(appProperties.getFilter_search_enabled()); jpaStorageSettings.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
jpaStorageSettings.setAdvancedHSearchIndexing(appProperties.getAdvanced_lucene_indexing()); jpaStorageSettings.setAdvancedHSearchIndexing(appProperties.getAdvanced_lucene_indexing());
jpaStorageSettings.setTreatBaseUrlsAsLocal(new HashSet<>(appProperties.getLocal_base_urls())); jpaStorageSettings.setTreatBaseUrlsAsLocal(appProperties.getLocal_base_urls());
if (appProperties.getLastn_enabled()) { if (appProperties.getLastn_enabled()) {
jpaStorageSettings.setLastNEnabled(true); jpaStorageSettings.setLastNEnabled(true);
} }

View File

@@ -26,7 +26,7 @@ public class FhirTesterConfig {
* server, as well as one public server. If you are creating a project to * server, as well as one public server. If you are creating a project to
* deploy somewhere else, you might choose to only put your own server's * deploy somewhere else, you might choose to only put your own server's
* address here. * address here.
* * <p>
* Note the use of the ${serverBase} variable below. This will be replaced with * Note the use of the ${serverBase} variable below. This will be replaced with
* the base URL as reported by the server itself. Often for a simple Tomcat * the base URL as reported by the server itself. Often for a simple Tomcat
* (or other container) installation, this will end up being something * (or other container) installation, this will end up being something

View File

@@ -24,7 +24,6 @@ import ca.uhn.fhir.jpa.config.util.ResourceCountCacheUtil;
import ca.uhn.fhir.jpa.config.util.ValidationSupportConfigUtil; import ca.uhn.fhir.jpa.config.util.ValidationSupportConfigUtil;
import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl; import ca.uhn.fhir.jpa.dao.FulltextSearchSvcImpl;
import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc;
import ca.uhn.fhir.jpa.dao.mdm.MdmLinkDaoJpaImpl;
import ca.uhn.fhir.jpa.dao.search.HSearchSortHelperImpl; import ca.uhn.fhir.jpa.dao.search.HSearchSortHelperImpl;
import ca.uhn.fhir.jpa.dao.search.IHSearchSortHelper; import ca.uhn.fhir.jpa.dao.search.IHSearchSortHelper;
import ca.uhn.fhir.jpa.delete.ThreadSafeResourceDeleterSvc; import ca.uhn.fhir.jpa.delete.ThreadSafeResourceDeleterSvc;
@@ -44,12 +43,10 @@ import ca.uhn.fhir.jpa.starter.AppProperties;
import ca.uhn.fhir.jpa.starter.annotations.OnCorsPresent; import ca.uhn.fhir.jpa.starter.annotations.OnCorsPresent;
import ca.uhn.fhir.jpa.starter.annotations.OnImplementationGuidesPresent; import ca.uhn.fhir.jpa.starter.annotations.OnImplementationGuidesPresent;
import ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory; import ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory;
import ca.uhn.fhir.jpa.starter.ips.IpsConfigCondition;
import ca.uhn.fhir.jpa.starter.util.EnvironmentHelper; import ca.uhn.fhir.jpa.starter.util.EnvironmentHelper;
import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor; import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor;
import ca.uhn.fhir.jpa.util.ResourceCountCache; import ca.uhn.fhir.jpa.util.ResourceCountCache;
import ca.uhn.fhir.jpa.validation.JpaValidationSupportChain; import ca.uhn.fhir.jpa.validation.JpaValidationSupportChain;
import ca.uhn.fhir.mdm.dao.IMdmLinkDao;
import ca.uhn.fhir.mdm.provider.MdmProviderLoader; import ca.uhn.fhir.mdm.provider.MdmProviderLoader;
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
import ca.uhn.fhir.narrative2.NullNarrativeGenerator; import ca.uhn.fhir.narrative2.NullNarrativeGenerator;
@@ -64,7 +61,6 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
import ca.uhn.fhir.validation.IValidatorModule; import ca.uhn.fhir.validation.IValidatorModule;
import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.ResultSeverityEnum;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport; import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport;
import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -205,7 +201,7 @@ public class StarterJpaConfig {
packageInstallationSpec.setReloadExisting(appProperties.getReload_existing_implementationguides()); packageInstallationSpec.setReloadExisting(appProperties.getReload_existing_implementationguides());
if (appProperties.getInstall_transitive_ig_dependencies()) { if (appProperties.getInstall_transitive_ig_dependencies()) {
packageInstallationSpec.setFetchDependencies(true); packageInstallationSpec.setFetchDependencies(true);
packageInstallationSpec.setDependencyExcludes(ImmutableList.of("hl7.fhir.r2.core", "hl7.fhir.r3.core", "hl7.fhir.r4.core", "hl7.fhir.r5.core")); packageInstallationSpec.setDependencyExcludes(List.of("hl7.fhir.r2.core", "hl7.fhir.r3.core", "hl7.fhir.r4.core", "hl7.fhir.r5.core"));
} }
packageInstallerSvc.install(packageInstallationSpec); packageInstallerSvc.install(packageInstallationSpec);
} }

View File

@@ -47,12 +47,12 @@ public class RepositoryValidationInterceptorFactoryDstu3 implements IRepositoryV
public RepositoryValidatingInterceptor buildUsingStoredStructureDefinitions() { public RepositoryValidatingInterceptor buildUsingStoredStructureDefinitions() {
IBundleProvider results = structureDefinitionResourceProvider.search(new SearchParameterMap().add(StructureDefinition.SP_KIND, new TokenParam("resource"))); IBundleProvider results = structureDefinitionResourceProvider.search(new SearchParameterMap().add(StructureDefinition.SP_KIND, new TokenParam("resource")));
Map<String, List<StructureDefinition>> structureDefintions = results.getResources(0, results.size()) Map<String, List<StructureDefinition>> structureDefinitions = results.getResources(0, results.size())
.stream() .stream()
.map(StructureDefinition.class::cast) .map(StructureDefinition.class::cast)
.collect(Collectors.groupingBy(StructureDefinition::getType)); .collect(Collectors.groupingBy(StructureDefinition::getType));
structureDefintions.forEach((key, value) -> { structureDefinitions.forEach((key, value) -> {
String[] urls = value.stream().map(StructureDefinition::getUrl).toArray(String[]::new); String[] urls = value.stream().map(StructureDefinition::getUrl).toArray(String[]::new);
repositoryValidatingRuleBuilder.forResourcesOfType(key).requireAtLeastOneProfileOf(urls).and().requireValidationToDeclaredProfiles(); repositoryValidatingRuleBuilder.forResourcesOfType(key).requireAtLeastOneProfileOf(urls).and().requireValidationToDeclaredProfiles();
}); });

View File

@@ -15,18 +15,18 @@ import ca.uhn.fhir.jpa.ips.generator.IpsGeneratorSvcImpl;
@Conditional(IpsConfigCondition.class) @Conditional(IpsConfigCondition.class)
public class StarterIpsConfig { public class StarterIpsConfig {
@Bean @Bean
IIpsGenerationStrategy IpsGenerationStrategy() IIpsGenerationStrategy ipsGenerationStrategy()
{ {
return new DefaultIpsGenerationStrategy(); return new DefaultIpsGenerationStrategy();
} }
@Bean @Bean
public IpsOperationProvider IpsOperationProvider(IIpsGeneratorSvc theIpsGeneratorSvc){ public IpsOperationProvider ipsOperationProvider(IIpsGeneratorSvc theIpsGeneratorSvc){
return new IpsOperationProvider(theIpsGeneratorSvc); return new IpsOperationProvider(theIpsGeneratorSvc);
} }
@Bean @Bean
public IIpsGeneratorSvc IpsGeneratorSvcImpl(FhirContext theFhirContext, IIpsGenerationStrategy theGenerationStrategy, DaoRegistry theDaoRegistry) public IIpsGeneratorSvc ipsGeneratorSvcImpl(FhirContext theFhirContext, IIpsGenerationStrategy theGenerationStrategy, DaoRegistry theDaoRegistry)
{ {
return new IpsGeneratorSvcImpl(theFhirContext, theGenerationStrategy, theDaoRegistry); return new IpsGeneratorSvcImpl(theFhirContext, theGenerationStrategy, theDaoRegistry);
} }

View File

@@ -6,7 +6,6 @@ import ca.uhn.fhir.jpa.starter.AppProperties;
import ca.uhn.fhir.mdm.api.IMdmSettings; import ca.uhn.fhir.mdm.api.IMdmSettings;
import ca.uhn.fhir.mdm.rules.config.MdmRuleValidator; import ca.uhn.fhir.mdm.rules.config.MdmRuleValidator;
import ca.uhn.fhir.mdm.rules.config.MdmSettings; import ca.uhn.fhir.mdm.rules.config.MdmSettings;
import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@@ -17,6 +16,7 @@ import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
@Configuration @Configuration
@Conditional(MdmConfigCondition.class) @Conditional(MdmConfigCondition.class)
@@ -27,7 +27,7 @@ public class MdmConfig {
IMdmSettings mdmSettings(@Autowired MdmRuleValidator theMdmRuleValidator, AppProperties appProperties) throws IOException { IMdmSettings mdmSettings(@Autowired MdmRuleValidator theMdmRuleValidator, AppProperties appProperties) throws IOException {
DefaultResourceLoader resourceLoader = new DefaultResourceLoader(); DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("mdm-rules.json"); Resource resource = resourceLoader.getResource("mdm-rules.json");
String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8); String json = IOUtils.toString(resource.getInputStream(), StandardCharsets.UTF_8);
return new MdmSettings(theMdmRuleValidator).setEnabled(appProperties.getMdm_enabled()).setScriptText(json); return new MdmSettings(theMdmRuleValidator).setEnabled(appProperties.getMdm_enabled()).setScriptText(json);
} }
} }

View File

@@ -17,7 +17,6 @@ import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings;
import org.hibernate.search.mapper.orm.schema.management.SchemaManagementStrategyName; import org.hibernate.search.mapper.orm.schema.management.SchemaManagementStrategyName;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy; import org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy;
import org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy;
import org.springframework.core.env.CompositePropertySource; import org.springframework.core.env.CompositePropertySource;
import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.EnumerablePropertySource; import org.springframework.core.env.EnumerablePropertySource;

View File

@@ -99,6 +99,8 @@ hapi:
# allow_multiple_delete: true # allow_multiple_delete: true
# allow_override_default_search_params: true # allow_override_default_search_params: true
# auto_create_placeholder_reference_targets: false # auto_create_placeholder_reference_targets: false
### tells the server to automatically append the current version of the target resource to references at these paths
# auto_version_reference_at_paths: Device.patient, Device.location, Device.parent, DeviceMetric.parent, DeviceMetric.source, Observation.device, Observation.subject
# cr_enabled: true # cr_enabled: true
# ips_enabled: false # ips_enabled: false
# default_encoding: JSON # default_encoding: JSON

View File

@@ -11,7 +11,7 @@ import org.springframework.boot.test.context.SpringBootTest;
// "hapi.fhir.enable_repository_validating_interceptor=true", // "hapi.fhir.enable_repository_validating_interceptor=true",
"hapi.fhir.fhir_version=r4" "hapi.fhir.fhir_version=r4"
}) })
public class CustomBeanTest { class CustomBeanTest {
@Autowired @Autowired
some.custom.pkg1.CustomBean customBean1; some.custom.pkg1.CustomBean customBean1;

View File

@@ -21,7 +21,7 @@ import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum;
"hapi.fhir.fhir_version=r4" "hapi.fhir.fhir_version=r4"
}) })
public class CustomInterceptorTest { class CustomInterceptorTest {
@LocalServerPort @LocalServerPort
private int port; private int port;

View File

@@ -21,7 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
"hapi.fhir.fhir_version=dstu2", "hapi.fhir.fhir_version=dstu2",
"spring.datasource.url=jdbc:h2:mem:dbr2", "spring.datasource.url=jdbc:h2:mem:dbr2",
}) })
public class ExampleServerDstu2IT { class ExampleServerDstu2IT {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerDstu2IT.class); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerDstu2IT.class);
private IGenericClient ourClient; private IGenericClient ourClient;

View File

@@ -49,7 +49,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
}) })
public class ExampleServerDstu3IT implements IServerSupport { class ExampleServerDstu3IT implements IServerSupport {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerDstu2IT.class); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerDstu2IT.class);
private IGenericClient ourClient; private IGenericClient ourClient;
@@ -71,8 +71,8 @@ public class ExampleServerDstu3IT implements IServerSupport {
ourClient.registerInterceptor(new LoggingInterceptor(true)); ourClient.registerInterceptor(new LoggingInterceptor(true));
} }
@Test @Test
public void testCreateAndRead() { void testCreateAndRead() {
String methodName = "testCreateResourceConditional"; String methodName = "testCreateResourceConditional";
@@ -154,7 +154,7 @@ public class ExampleServerDstu3IT implements IServerSupport {
} }
@Test @Test
public void testWebsocketSubscription() throws Exception { void testWebsocketSubscription() throws Exception {
/* /*
* Create subscription * Create subscription
*/ */

View File

@@ -52,7 +52,7 @@ class ExampleServerR4BIT {
@Test @Test
public void testBatchPutWithIdenticalTags() { void testBatchPutWithIdenticalTags() {
String batchPuts = "{\n" + String batchPuts = "{\n" +
"\t\"resourceType\": \"Bundle\",\n" + "\t\"resourceType\": \"Bundle\",\n" +
"\t\"id\": \"patients\",\n" + "\t\"id\": \"patients\",\n" +

View File

@@ -87,7 +87,7 @@ class ExampleServerR4IT {
} }
@Test @Test
public void testBatchPutWithIdenticalTags() { void testBatchPutWithIdenticalTags() {
String batchPuts = "{\n" + String batchPuts = "{\n" +
"\t\"resourceType\": \"Bundle\",\n" + "\t\"resourceType\": \"Bundle\",\n" +
"\t\"id\": \"patients\",\n" + "\t\"id\": \"patients\",\n" +

View File

@@ -45,15 +45,15 @@ public class ExampleServerR5IT {
private IGenericClient ourClient; private IGenericClient ourClient;
private FhirContext ourCtx; private FhirContext ourCtx;
public static final String SUBSCRIPTION_TOPIC_TEST_URL = "http://example.com/topic/test"; public static final String SUBSCRIPTION_TOPIC_TEST_URL = "http://example.com/topic/test";
@LocalServerPort @LocalServerPort
private int port; private int port;
@Test @Test
public void testCreateAndRead() { void testCreateAndRead() {
String methodName = "testCreateResourceConditional"; String methodName = "testCreateResourceConditional";
@@ -66,7 +66,7 @@ public class ExampleServerR5IT {
} }
@Test @Test
public void testWebsocketSubscription() throws Exception { void testWebsocketSubscription() throws Exception {
String endpoint = "ws://localhost:" + port + "/websocket"; String endpoint = "ws://localhost:" + port + "/websocket";
/* /*
* Create topic * Create topic

View File

@@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
"hapi.fhir.partitioning.partitioning_include_in_search_hashes=false", "hapi.fhir.partitioning.partitioning_include_in_search_hashes=false",
}) })
public class MultitenantServerR4IT { class MultitenantServerR4IT {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerDstu2IT.class); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerDstu2IT.class);
@@ -40,7 +40,7 @@ public class MultitenantServerR4IT {
@Test @Test
public void testCreateAndReadInTenantA() { void testCreateAndReadInTenantA() {
// Create tenant A // Create tenant A
@@ -66,7 +66,7 @@ public class MultitenantServerR4IT {
} }
@Test @Test
public void testCreateAndReadInTenantB() { void testCreateAndReadInTenantB() {
// Create tenant A // Create tenant A

View File

@@ -18,7 +18,7 @@ public class SocketImplementation {
private final String myCriteria; private final String myCriteria;
protected String myError; protected String myError;
protected boolean myGotBound; protected boolean myGotBound;
private final List<String> myMessages = new ArrayList<String>(); private final List<String> myMessages = new ArrayList<>();
protected int myPingCount; protected int myPingCount;
protected String mySubsId; protected String mySubsId;
private Session session; private Session session;