diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 852fa5c76d2..7ee01e19f20 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -48,8 +48,10 @@ jobs:
env:
BASE: ${{ github['base_ref'] }}
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/${BASE}:refs/remotes/origin/${BASE}
- - name: Build samples
- run: mvn -B install --file fhir-examples --no-transfer-progress
+ - name: Build tools and samples
+ run: |
+ mvn -B install --file fhir-tools --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
+ mvn -B install --file fhir-examples --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
- name: Build parent with tests
env:
BASE: origin/${{ github['base_ref'] }}
@@ -124,8 +126,10 @@ jobs:
uses: joschi/setup-jdk@v2.3.0
with:
java-version: ${{ matrix.java }}
- - name: Build samples
- run: mvn -B install --file fhir-examples --no-transfer-progress
+ - name: Build samples and tools
+ run: |
+ mvn -B install --file fhir-examples --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
+ mvn -B install --file fhir-tools --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
- name: Build parent without tests
# As the e2e tests are the fastest, opting to put javadoc:javadoc in fhir-parent
# The profile avoids UML diagram creation
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 07a5f7ce786..dc794edae8a 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -21,8 +21,10 @@ jobs:
uses: joschi/setup-jdk@v2.3.0
with:
java-version: ${{ matrix.java }}
- - name: Build samples
- run: mvn -B install --file fhir-examples --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
+ - name: Build tools and samples
+ run: |
+ mvn -B install --file fhir-tools --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
+ mvn -B install --file fhir-examples --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
- name: Build parent without tests
run: |
mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline -f fhir-parent -DexcludeReactor=true -Dmaven.wagon.http.retryHandler.count=3
diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml
index aa9f1fff852..20cda0549f4 100644
--- a/.github/workflows/javadocs.yml
+++ b/.github/workflows/javadocs.yml
@@ -2,7 +2,7 @@ name: Javadocs Build for Site
on:
push:
- tags:
+ tags:
- '*'
jobs:
@@ -36,6 +36,10 @@ jobs:
uses: joschi/setup-jdk@v2.3.0
with:
java-version: ${{ matrix.java }}
+ - name: Build fhir-tools
+ run: |
+ cd fhir
+ mvn -B -ntp clean install --file fhir-tools -Dmaven.wagon.http.retryHandler.count=3
- name: Build fhir-examples
run: |
cd fhir
@@ -62,7 +66,7 @@ jobs:
then
rm -rf ./javadocs/latest/
fi
- # Helps debug the situation
+ # Helps debug the situation
ls -al javadocs
echo "Starting the movement of the data around"
mkdir -p javadocs/latest
@@ -75,7 +79,7 @@ jobs:
echo "
Javadocs" > javadocs/index.html
for DIR in `find ./javadocs -type d -maxdepth 1 -mindepth 1 -exec basename {} \; | sort -r | grep -v rc3 `
do
- echo "${DIR}" >> javadocs/index.html
+ echo "${DIR}" >> javadocs/index.html
echo "
" >> javadocs/index.html
done
echo "" >> javadocs/index.html
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index d4871e9637a..072808e8591 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -27,9 +27,11 @@ jobs:
minimum-size: 8GB
maximum-size: 8GB
disk-root: "C:"
- - name: Build samples
+ - name: Build tools and samples
shell: powershell
- run: mvn -B install --file fhir-examples/pom.xml --no-transfer-progress
+ run: |
+ mvn -B install --file fhir-tools --no-transfer-progress
+ mvn -B install --file fhir-examples --no-transfer-progress
- name: Download Dependencies
shell: powershell
run: mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline -f fhir-parent -DexcludeReactor=true
diff --git a/build/audit/bin/setup-prerequisites.sh b/build/audit/bin/setup-prerequisites.sh
index 79392f9567c..b01edb3ecce 100644
--- a/build/audit/bin/setup-prerequisites.sh
+++ b/build/audit/bin/setup-prerequisites.sh
@@ -18,6 +18,7 @@ required_build(){
fi
# build binaries
+ mvn -B install --file fhir-tools --no-transfer-progress
mvn -B install --file fhir-examples --no-transfer-progress
mvn -B install --file fhir-parent -DskipTests -P include-fhir-igs,integration --no-transfer-progress
@@ -40,10 +41,10 @@ audit_build(){
pushd $(pwd) > /dev/null
if [ -z "${WORKSPACE}" ]
-then
+then
echo "The WORKSPACE value is unset"
exit -1
-fi
+fi
# Change to the release directory
cd "${WORKSPACE}"
@@ -54,5 +55,5 @@ audit_build "${1}"
# Reset to Original Directory
popd > /dev/null
-# EOF
-###############################################################################
\ No newline at end of file
+# EOF
+###############################################################################
diff --git a/build/migration/bin/1_previous-setup.sh b/build/migration/bin/1_previous-setup.sh
index 4f5906acfa6..2c86f153c94 100644
--- a/build/migration/bin/1_previous-setup.sh
+++ b/build/migration/bin/1_previous-setup.sh
@@ -20,6 +20,7 @@ required_build(){
fi
# build binaries
+ mvn -T2C -B install --file fhir-tools --no-transfer-progress
mvn -T2C -B install --file fhir-examples --no-transfer-progress
# 12.6.0 no longer exists.
@@ -63,10 +64,10 @@ migration_build(){
pushd $(pwd) > /dev/null
if [ -z "${WORKSPACE}" ]
-then
+then
echo "The WORKSPACE value is unset"
exit -1
-fi
+fi
# Change to the release directory
cd "${WORKSPACE}/prev"
@@ -77,5 +78,5 @@ migration_build "${1}"
# Reset to Original Directory
popd > /dev/null
-# EOF
-###############################################################################
\ No newline at end of file
+# EOF
+###############################################################################
diff --git a/build/migration/bin/4_current-migrate.sh b/build/migration/bin/4_current-migrate.sh
index fb839bc9ac1..f8cbeab3f6a 100644
--- a/build/migration/bin/4_current-migrate.sh
+++ b/build/migration/bin/4_current-migrate.sh
@@ -15,6 +15,7 @@ run_migrate(){
echo "Building the current docker image and the current java artifacts"
pushd $(pwd) > /dev/null
cd "${WORKSPACE}/fhir"
+ mvn -T2C -B install --file fhir-tools --no-transfer-progress
mvn -T2C -B install --file fhir-examples --no-transfer-progress
mvn -T2C -B install --file fhir-parent -DskipTests -P include-fhir-igs,integration --no-transfer-progress
@@ -24,7 +25,7 @@ run_migrate(){
popd > /dev/null
if [ ! -z "${migration}" ] && [ -f "${WORKSPACE}/fhir/build/migration/${migration}/4_current-migrate.sh" ]
- then
+ then
echo "Running [${migration}] migration"
bash ${WORKSPACE}/fhir/build/migration/${migration}/4_current-migrate.sh
fi
@@ -44,4 +45,4 @@ run_migrate "${1}"
popd > /dev/null
# EOF
-###############################################################################
\ No newline at end of file
+###############################################################################
diff --git a/build/notifications/bin/setup-prerequisites.sh b/build/notifications/bin/setup-prerequisites.sh
index f500a8126d5..b1cd5fc1484 100644
--- a/build/notifications/bin/setup-prerequisites.sh
+++ b/build/notifications/bin/setup-prerequisites.sh
@@ -18,6 +18,7 @@ required_build(){
fi
# build binaries
+ mvn -B install --file fhir-tools --no-transfer-progress
mvn -B install --file fhir-examples --no-transfer-progress
mvn -B install --file fhir-parent -DskipTests -P include-fhir-igs,integration --no-transfer-progress
@@ -40,10 +41,10 @@ notifications_build(){
pushd $(pwd) > /dev/null
if [ -z "${WORKSPACE}" ]
-then
+then
echo "The WORKSPACE value is unset"
exit -1
-fi
+fi
# Change to the release directory
cd "${WORKSPACE}"
@@ -54,5 +55,5 @@ notifications_build "${1}"
# Reset to Original Directory
popd > /dev/null
-# EOF
-###############################################################################
\ No newline at end of file
+# EOF
+###############################################################################
diff --git a/build/persistence/bin/setup-prerequisites.sh b/build/persistence/bin/setup-prerequisites.sh
index 9d1078afd47..ffc98ab0860 100644
--- a/build/persistence/bin/setup-prerequisites.sh
+++ b/build/persistence/bin/setup-prerequisites.sh
@@ -18,6 +18,7 @@ required_build(){
fi
# build binaries
+ mvn -B install --file fhir-tools --no-transfer-progress
mvn -B install --file fhir-examples --no-transfer-progress
mvn -B install --file fhir-parent -DskipTests -P include-fhir-igs,integration --no-transfer-progress
@@ -40,10 +41,10 @@ persistence_build(){
pushd $(pwd) > /dev/null
if [ -z "${WORKSPACE}" ]
-then
+then
echo "The WORKSPACE value is unset"
exit -1
-fi
+fi
# Change to the release directory
cd "${WORKSPACE}"
@@ -54,5 +55,5 @@ persistence_build "${1}"
# Reset to Original Directory
popd > /dev/null
-# EOF
-###############################################################################
\ No newline at end of file
+# EOF
+###############################################################################
diff --git a/build/reindex/bin/setup-prerequisites.sh b/build/reindex/bin/setup-prerequisites.sh
index 0c87d88ccea..7de8f500cd6 100644
--- a/build/reindex/bin/setup-prerequisites.sh
+++ b/build/reindex/bin/setup-prerequisites.sh
@@ -19,6 +19,7 @@ required_build(){
fi
# build binaries
+ mvn -T2C -B install --file fhir-tools --no-transfer-progress
mvn -T2C -B install --file fhir-examples --no-transfer-progress
mvn -T2C -B install --file fhir-parent -DskipTests -P include-fhir-igs,integration --no-transfer-progress
@@ -53,10 +54,10 @@ reindex_build(){
pushd $(pwd) > /dev/null
if [ -z "${WORKSPACE}" ]
-then
+then
echo "The WORKSPACE value is unset"
exit -1
-fi
+fi
# Change to the release directory
cd "${WORKSPACE}"
@@ -67,5 +68,5 @@ reindex_build "${1}"
# Reset to Original Directory
popd > /dev/null
-# EOF
-###############################################################################
\ No newline at end of file
+# EOF
+###############################################################################
diff --git a/build/security/setup.sh b/build/security/setup.sh
index f823105836f..490a064b2e4 100644
--- a/build/security/setup.sh
+++ b/build/security/setup.sh
@@ -5,11 +5,11 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################################
-# Create the artifacts and the docker image so that the layer can be compiled in
+# Create the artifacts and the docker image so that the layer can be compiled in
# Only run if workspace is set
if [ -z "${WORKSPACE}" ]
-then
+then
echo 'Export Variable is not set "${WORKSPACE}"'
else
pushd `pwd`
@@ -18,20 +18,21 @@ else
# Creates the Temporary Folder to park intermediate results
if [ -d build/security/logs/tmp ]
- then
+ then
rm -rf build/security/logs/tmp
fi
if [ -d build/security/logs/output ]
- then
+ then
rm -rf build/security/logs/output
fi
mkdir -p build/security/logs/tmp
mkdir -p build/security/logs/output
+ mvn clean install -f fhir-tools/ -DskipTests -B -ntp
mvn clean install -f fhir-examples/ -DskipTests -B -ntp
mvn clean install -f fhir-parent/ -DskipTests -B -ntp
docker build fhir-install -t ibmcom/ibm-fhir-server
popd `pwd`
echo "Finished the setup"
fi
-# EOF
\ No newline at end of file
+# EOF
diff --git a/conformance/fhir-ig-carin-bb/pom.xml b/conformance/fhir-ig-carin-bb/pom.xml
index 3802f321797..3de16b8aac2 100644
--- a/conformance/fhir-ig-carin-bb/pom.xml
+++ b/conformance/fhir-ig-carin-bb/pom.xml
@@ -56,4 +56,21 @@
test
+
+
+
+
+ ${project.groupId}
+ fhir-tools
+ ${fhir-tools.version}
+
+
+
+ condense-json
+
+
+
+
+
+
diff --git a/conformance/fhir-ig-carin-bb/src/main/resources/hl7/fhir/us/carin-bb/100/package/openapi/c4bb.openapi.json b/conformance/fhir-ig-carin-bb/src/main/resources/hl7/fhir/us/carin-bb/100/package/openapi/c4bb.openapi.json
deleted file mode 100644
index 9b20180b69d..00000000000
--- a/conformance/fhir-ig-carin-bb/src/main/resources/hl7/fhir/us/carin-bb/100/package/openapi/c4bb.openapi.json
+++ /dev/null
@@ -1,797 +0,0 @@
-{
- "openapi": "3.0.2",
- "info": {
- "title": "C4BB CapabilityStatement",
- "description": "This Section describes the expected capabilities of the C4BB Server actor which is responsible for providing responses to the queries submitted by the C4BB Requestors. \n\nThe EOB Resource is the focal Consumer-Directed Payer Data Exchange (CDPDE) Resource. Several Reference Resources are defined directly/indirectly from the EOB: Coverage, Patient, Organization (Payer ID), Practioner, and Organization (Facility).\n\nThe Coverage Reference Resource SHALL be returned with data that was effective as of the date of service of the claim; for example, the data will reflect the employer name in effect at that time. However, for other reference resources, payers MAY decide to provide either the data that was in effect as of the date of service or the current data. All reference resources within the EOB will have meta.lastUpdated flagged as must support. Payers SHALL provide the last time the data was updated or the date of creation in the payers system of record, whichever comes last. Apps will use the meta.lastUpdated values to determine if the reference resources are as of the current date or date of service.",
- "license": {
- "name": "Creative Commons Zero v1.0 Universal",
- "url": "http://spdx.org/licenses/CC0-1.0.html"
- },
- "version": "1.0.0",
- "contact": {
- "name": "HL7 Financial Management Working Group",
- "email": "fm@lists.HL7.org",
- "url": "http://www.hl7.org/Special/committees/fm/index.cfm"
- }
- },
- "externalDocs": {
- "url": "http://hl7.org/fhir/us/carin-bb/CapabilityStatement/c4bb",
- "description": "FHIR CapabilityStatement"
- },
- "paths": {
- "/metadata": {
- "summary": "Access to the Server\u0027s Capability Statement",
- "description": "All FHIR Servers return a CapabilityStatement that describes what services they perform",
- "get": {
- "summary": "Return the server\u0027s capability statement",
- "operationId": "metadata",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the capbility statement",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/CapabilityStatement"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/CapabilityStatement.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/Coverage/{rid}": {
- "summary": "Read/Write/etc resource instance of type Coverage",
- "description": "Access to services to manage the state of a single resource of type Coverage",
- "get": {
- "summary": "Read the current state of the resource",
- "operationId": "readCoverage",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Coverage"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Coverage.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/ExplanationOfBenefit": {
- "summary": "manage the collection of resources of type ExplanationOfBenefit",
- "description": "Access to services to manage the collection of all resources of type ExplanationOfBenefit",
- "get": {
- "summary": "Search all resources of type ExplanationOfBenefit based on a set of criteria",
- "operationId": "searchExplanationOfBenefit",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Bundle"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Bundle.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/elements"
- },
- {
- "name": "_id",
- "in": "query",
- "schema": {
- "type": "string"
- },
- "description": "Logical id of this artifact"
- },
- {
- "name": "patient",
- "in": "query",
- "schema": {
- "type": "string"
- },
- "description": "The reference to the patient"
- },
- {
- "name": "_lastUpdated",
- "in": "query",
- "schema": {
- "type": "string",
- "pattern": "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
- },
- "description": "When the resource version last changed"
- },
- {
- "name": "type",
- "in": "query",
- "schema": {
- "type": "string"
- },
- "description": "The type of the ExplanationOfBenefit"
- },
- {
- "name": "identifier",
- "in": "query",
- "schema": {
- "type": "string"
- },
- "description": "The business/claim identifier of the Explanation of Benefit"
- },
- {
- "name": "service-date",
- "in": "query",
- "schema": {
- "type": "string",
- "pattern": "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
- },
- "description": "Date of the service for the EOB. The service-date search parameter simplifies search, since a client doesn\u0027t need to know that for inpatient and outpatient institutional EOB dates they need to search by billablePeriod.period.start, for a pharmacy EOB by item.servicedDate, and for a professional and non-clinician EOB - by item.servicedPeriod.period.start."
- }
- ]
- }
- },
- "/ExplanationOfBenefit/{rid}": {
- "summary": "Read/Write/etc resource instance of type ExplanationOfBenefit",
- "description": "Access to services to manage the state of a single resource of type ExplanationOfBenefit",
- "get": {
- "summary": "Read the current state of the resource",
- "operationId": "readExplanationOfBenefit",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/ExplanationOfBenefit"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/ExplanationOfBenefit.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/Organization/{rid}": {
- "summary": "Read/Write/etc resource instance of type Organization",
- "description": "Access to services to manage the state of a single resource of type Organization",
- "get": {
- "summary": "Read the current state of the resource",
- "operationId": "readOrganization",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Organization"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Organization.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/Organization/{rid}/_history/{hid}": {
- "summary": "Read a past version of resource instance of type Organization",
- "description": "Access a to specified previous version of a single resource of type Organization",
- "get": {
- "summary": "Read a past state of the resource",
- "operationId": "vreadOrganization",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag for that version",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Organization"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Organization.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/hid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/Patient/{rid}": {
- "summary": "Read/Write/etc resource instance of type Patient",
- "description": "Access to services to manage the state of a single resource of type Patient",
- "get": {
- "summary": "Read the current state of the resource",
- "operationId": "readPatient",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Patient"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Patient.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/Patient/{rid}/_history/{hid}": {
- "summary": "Read a past version of resource instance of type Patient",
- "description": "Access a to specified previous version of a single resource of type Patient",
- "get": {
- "summary": "Read a past state of the resource",
- "operationId": "vreadPatient",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag for that version",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Patient"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Patient.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/hid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/Practitioner/{rid}": {
- "summary": "Read/Write/etc resource instance of type Practitioner",
- "description": "Access to services to manage the state of a single resource of type Practitioner",
- "get": {
- "summary": "Read the current state of the resource",
- "operationId": "readPractitioner",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Practitioner"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Practitioner.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- },
- "/Practitioner/{rid}/_history/{hid}": {
- "summary": "Read a past version of resource instance of type Practitioner",
- "description": "Access a to specified previous version of a single resource of type Practitioner",
- "get": {
- "summary": "Read a past state of the resource",
- "operationId": "vreadPractitioner",
- "responses": {
- "default": {
- "description": "Error, with details",
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/OperationOutcome"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/OperationOutcome.xsd"
- }
- }
- }
- },
- "200": {
- "description": "the resource being returned",
- "headers": {
- "ETag": {
- "description": "Version from Resource.meta.version as a weak ETag for that version",
- "schema": {
- "type": "string"
- }
- }
- },
- "content": {
- "application/fhir+json": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/fhir.schema.json#/definitions/Practitioner"
- }
- },
- "application/fhir+xml": {
- "schema": {
- "$ref": "https://hl7.org/fhir/R4/Practitioner.xsd"
- }
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/components/parameters/rid"
- },
- {
- "$ref": "#/components/parameters/hid"
- },
- {
- "$ref": "#/components/parameters/summary"
- },
- {
- "$ref": "#/components/parameters/format"
- },
- {
- "$ref": "#/components/parameters/pretty"
- },
- {
- "$ref": "#/components/parameters/elements"
- }
- ]
- }
- }
- },
- "components": {
- "parameters": {
- "rid": {
- "name": "rid",
- "in": "path",
- "description": "id of the resource (\u003dResource.id)",
- "required": true,
- "allowEmptyValue": false,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- },
- "hid": {
- "name": "hid",
- "in": "path",
- "description": "id of the history entry (\u003dResource.meta.versionId)",
- "required": true,
- "allowEmptyValue": false,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- },
- "summary": {
- "name": "_summary",
- "in": "query",
- "description": "Requests the server to return a designated subset of the resource",
- "allowEmptyValue": true,
- "style": "form",
- "schema": {
- "type": "string",
- "enum": [
- "true",
- "text",
- "data",
- "count",
- "false"
- ]
- }
- },
- "format": {
- "name": "_format",
- "in": "query",
- "description": "Specify alternative response formats by their MIME-types (when a client is unable acccess accept: header)",
- "allowEmptyValue": true,
- "style": "form",
- "schema": {
- "type": "string",
- "format": "mime-type"
- }
- },
- "pretty": {
- "name": "_pretty",
- "in": "query",
- "description": "Ask for a pretty printed response for human convenience",
- "allowEmptyValue": true,
- "style": "form",
- "schema": {
- "type": "boolean"
- }
- },
- "elements": {
- "name": "_elements",
- "in": "query",
- "description": "Requests the server to return a collection of elements from the resource",
- "allowEmptyValue": true,
- "style": "form",
- "explode": false,
- "schema": {
- "type": "array",
- "format": "string",
- "items": {
- "format": "string"
- }
- }
- },
- "count": {
- "name": "_count",
- "in": "query",
- "description": "The maximum number of search results on a page. The server is not bound to return the number requested, but cannot return more",
- "schema": {
- "type": "number"
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/conformance/fhir-ig-us-core/pom.xml b/conformance/fhir-ig-us-core/pom.xml
index c1c4f19df29..3bbc4b11d0f 100644
--- a/conformance/fhir-ig-us-core/pom.xml
+++ b/conformance/fhir-ig-us-core/pom.xml
@@ -32,4 +32,21 @@
test
+
+
+
+
+ ${project.groupId}
+ fhir-tools
+ ${fhir-tools.version}
+
+
+
+ condense-json
+
+
+
+
+
+
diff --git a/fhir-parent/pom.xml b/fhir-parent/pom.xml
index 88cb318d235..9bec0ba19c3 100644
--- a/fhir-parent/pom.xml
+++ b/fhir-parent/pom.xml
@@ -982,6 +982,23 @@
+
+
+ com.ibm.fhir
+
+ fhir-tools
+
+
+ [4.10.0-SNAPSHOT,)
+
+
+ condense-json
+
+
+
+
+
+
diff --git a/fhir-registry/pom.xml b/fhir-registry/pom.xml
index 4afe0ec1de8..128e573f524 100644
--- a/fhir-registry/pom.xml
+++ b/fhir-registry/pom.xml
@@ -21,4 +21,20 @@
test
+
+
+
+ ${project.groupId}
+ fhir-tools
+ ${fhir-tools.version}
+
+
+
+ condense-json
+
+
+
+
+
+
diff --git a/fhir-tools/pom.xml b/fhir-tools/pom.xml
index 0b04496f02d..1f00dc976ac 100644
--- a/fhir-tools/pom.xml
+++ b/fhir-tools/pom.xml
@@ -209,9 +209,9 @@
- org.glassfish
+ org.eclipse.parsson
jakarta.json
- 2.0.1
+ 1.0.0
org.skyscreamer
diff --git a/fhir-tools/src/main/java/com/ibm/fhir/ig/plugin/CondenseAndCopyFileVisitor.java b/fhir-tools/src/main/java/com/ibm/fhir/ig/plugin/CondenseAndCopyFileVisitor.java
new file mode 100644
index 00000000000..a068f2883aa
--- /dev/null
+++ b/fhir-tools/src/main/java/com/ibm/fhir/ig/plugin/CondenseAndCopyFileVisitor.java
@@ -0,0 +1,68 @@
+/*
+ * (C) Copyright IBM Corp. 2021
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+package com.ibm.fhir.ig.plugin;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+
+import jakarta.json.Json;
+import jakarta.json.JsonObject;
+import jakarta.json.JsonReader;
+import jakarta.json.JsonReaderFactory;
+import jakarta.json.JsonWriter;
+import jakarta.json.JsonWriterFactory;
+
+/**
+ * A FileVisitor that strips non-meaningful whitespace from JSON files as it copies
+ * them to a new directory.
+ */
+public class CondenseAndCopyFileVisitor extends SimpleFileVisitor {
+ final JsonReaderFactory jsonReaderFactory = Json.createReaderFactory(null);
+ final JsonWriterFactory jsonWriterFactory = Json.createWriterFactory(null);
+ final Path resourcesDir;
+ final Path outputDir;
+
+ int count = 0;
+
+ public CondenseAndCopyFileVisitor(Path resourcesDir, Path outputDirectory) {
+ this.resourcesDir = resourcesDir;
+ this.outputDir = outputDirectory;
+ }
+
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+ if (file.toString().endsWith(".json")) {
+ String relativePath = resourcesDir.relativize(file).toString();
+ Path target = Paths.get(outputDir.toString(), relativePath);
+
+ JsonObject jsonObject = null;
+ try (BufferedReader reader = Files.newBufferedReader(file)) {
+ JsonReader jsonReader = jsonReaderFactory.createReader(reader);
+ jsonObject = jsonReader.readObject();
+ }
+ try (BufferedWriter writer = Files.newBufferedWriter(target)) {
+ JsonWriter jsonWriter = jsonWriterFactory.createWriter(writer);
+ jsonWriter.write(jsonObject);
+ }
+ count++;
+ }
+ return FileVisitResult.CONTINUE;
+ }
+
+ /**
+ * @return the number of processed files
+ */
+ public int getCount() {
+ return count;
+ }
+}
diff --git a/fhir-tools/src/main/java/com/ibm/fhir/ig/plugin/IGResourceCondenserPlugin.java b/fhir-tools/src/main/java/com/ibm/fhir/ig/plugin/IGResourceCondenserPlugin.java
new file mode 100644
index 00000000000..53026f1b1e1
--- /dev/null
+++ b/fhir-tools/src/main/java/com/ibm/fhir/ig/plugin/IGResourceCondenserPlugin.java
@@ -0,0 +1,69 @@
+/*
+ * (C) Copyright IBM Corp. 2019, 2021
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package com.ibm.fhir.ig.plugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import org.apache.maven.model.Resource;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Execute;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+
+/**
+ * This class coordinates the calls to the fhir-tool plugin
+ *
+ * The phase is process-resources. To find a list of phases -
+ * https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
+ *
+ * Run the following to setup the plugin:
+ *
+ * mvn clean install -f fhir-tools/pom.xml
+ *
+ *
+ * @requiresDependencyResolution runtime
+ */
+@Mojo(name = "condense-json", //$NON-NLS-1$
+ requiresProject = true,
+ requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM,
+ requiresDependencyCollection = ResolutionScope.RUNTIME_PLUS_SYSTEM,
+ defaultPhase = LifecyclePhase.PROCESS_RESOURCES,
+ requiresOnline = false,
+ threadSafe = false)
+@Execute(phase = LifecyclePhase.PROCESS_RESOURCES)
+public class IGResourceCondenserPlugin extends AbstractMojo {
+
+ @Parameter( defaultValue = "${project.build.outputDirectory}", required = true )
+ private File outputDirectory;
+
+ @Parameter( defaultValue = "${project.resources}", required = true, readonly = true )
+ private List resources;
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ for (Resource resource : resources) {
+ try {
+ Path resourcesDir = Paths.get(resource.getDirectory());
+ CondenseAndCopyFileVisitor visitor = new CondenseAndCopyFileVisitor(resourcesDir, outputDirectory.toPath());
+ Files.walkFileTree(resourcesDir, visitor);
+
+ getLog().info("processed " + visitor.getCount() + " JSON files");
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error while condensing and copying resources", e);
+ }
+ }
+ }
+}
diff --git a/fhir-tools/src/main/java/com/ibm/fhir/model/plugin/ModelPlugin.java b/fhir-tools/src/main/java/com/ibm/fhir/model/plugin/ModelPlugin.java
index ab356a1f662..2b7b78491ac 100644
--- a/fhir-tools/src/main/java/com/ibm/fhir/model/plugin/ModelPlugin.java
+++ b/fhir-tools/src/main/java/com/ibm/fhir/model/plugin/ModelPlugin.java
@@ -1,5 +1,5 @@
/*
- * (C) Copyright IBM Corp. 2019, 2020
+ * (C) Copyright IBM Corp. 2019, 2021
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -26,7 +26,7 @@
/**
* This class coordinates the calls to the fhir-tool plugin
*
- * The phase is initialize. To find a list of phases -
+ * The phase is generate-sources. To find a list of phases -
* https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
*
* Run the following to setup the plugin: