Skip to content

Commit

Permalink
Merge branch 'google:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jingtang10 authored Jul 26, 2024
2 parents c2026a5 + 9bd76c8 commit 9637279
Show file tree
Hide file tree
Showing 42 changed files with 1,672 additions and 280 deletions.
28 changes: 8 additions & 20 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ import org.gradle.api.artifacts.DependencyConstraint
import org.gradle.kotlin.dsl.exclude

object Dependencies {
object Cql {
const val evaluator = "org.opencds.cqf.fhir:cqf-fhir-cr:${Versions.Cql.clinicalReasoning}"
const val evaluatorFhirJackson =
"org.opencds.cqf.fhir:cqf-fhir-jackson:${Versions.Cql.clinicalReasoning}"
const val evaluatorFhirUtilities =
"org.opencds.cqf.fhir:cqf-fhir-utility:${Versions.Cql.clinicalReasoning}"
}

object HapiFhir {
const val fhirBaseModule = "ca.uhn.hapi.fhir:hapi-fhir-base"
const val fhirClientModule = "ca.uhn.hapi.fhir:hapi-fhir-client"
Expand Down Expand Up @@ -139,11 +131,6 @@ object Dependencies {
const val xmlUnit = "org.xmlunit:xmlunit-core:${Versions.xmlUnit}"

object Versions {

object Cql {
const val clinicalReasoning = "3.0.0-PRE9-SNAPSHOT"
}

const val androidFhirCommon = "0.1.0-alpha05"
const val androidFhirEngine = "0.1.0-beta05"
const val androidFhirKnowledge = "0.1.0-alpha03"
Expand Down Expand Up @@ -195,16 +182,17 @@ object Dependencies {
}

fun Configuration.removeIncompatibleDependencies() {
exclude(module = "xpp3")
exclude(module = "xpp3_min")
exclude(module = "xmlpull")
exclude(module = "hapi-fhir-caching-caffeine")
exclude(module = "javax.json")
exclude(module = "jcl-over-slf4j")
exclude(group = "org.apache.httpcomponents")
exclude(group = "org.antlr", module = "antlr4")
exclude(group = "org.eclipse.persistence", module = "org.eclipse.persistence.moxy")
exclude(module = "hapi-fhir-caching-caffeine")
exclude(module = "xmlpull")
exclude(module = "xpp3")
exclude(module = "xpp3_min")
exclude(group = "ch.qos.logback", module = "logback-classic")
exclude(group = "com.github.ben-manes.caffeine", module = "caffeine")
exclude(group = "org.eclipse.persistence", module = "org.eclipse.persistence.moxy")
exclude(group = "org.antlr", module = "antlr4")
exclude(group = "org.apache.httpcomponents")
}

fun hapiFhirConstraints(): Map<String, DependencyConstraint.() -> Unit> {
Expand Down
19 changes: 16 additions & 3 deletions buildSrc/src/main/kotlin/LicenseeConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,24 @@ fun Project.configureLicensee() {
}

// Jakarta XML Binding API
allowDependency("jakarta.xml.bind", "jakarta.xml.bind-api", "2.3.3") {
allowDependency("jakarta.xml.bind", "jakarta.xml.bind-api", "4.0.1") {
because("BSD 3-clause.")
}

// Jakarta Activation API 2.1 Specification
allowDependency("jakarta.activation", "jakarta.activation-api", "1.2.2") {
allowDependency("jakarta.activation", "jakarta.activation-api", "2.1.2") {
because(
"Licensed under Eclipse Distribution License 1.0. http://www.eclipse.org/org/documents/edl-v10.php",
)
}

// Jakarta Annotation API 2.1 Specification
allowDependency("jakarta.annotation", "jakarta.annotation-api", "2.1.1") {
because(
"Licensed under EPL 2.0",
)
}

// Javax Annotation API
allowDependency("javax.annotation", "javax.annotation-api", "1.3.2") {
because("Dual-licensed under CDDL 1.1 and GPL v2 with classpath exception.")
Expand All @@ -108,7 +115,7 @@ fun Project.configureLicensee() {
because("BSD 3-clause. http://www.antlr.org/license.html")
}
// ANTLR 4
allowDependency("org.antlr", "antlr4-runtime", "4.10.1") {
allowDependency("org.antlr", "antlr4-runtime", "4.13.1") {
because("BSD 3-clause. http://www.antlr.org/license.html")
}

Expand Down Expand Up @@ -195,6 +202,12 @@ fun Project.configureLicensee() {
allowDependency("com.ibm.icu", "icu4j", "72.1") {
because("BSD, part MIT and Apache 2.0. https://github.com/unicode-org/icu/blob/main/LICENSE")
}

// Logback
allowDependency("ch.qos.logback", "logback-classic", "1.4.14") { because("LGPL") }

// Logback
allowDependency("ch.qos.logback", "logback-core", "1.4.14") { because("LGPL") }
}
}

Expand Down
46 changes: 9 additions & 37 deletions catalog/src/main/assets/behavior_calculated_expression.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,20 @@
"resourceType": "Questionnaire",
"item": [
{
"linkId": "a-birthdate",
"text": "Birth Date (select age to auto calculate if not known)",
"type": "date",
"extension": [
{
"url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
"valueExpression": {
"language": "text/fhirpath",
"expression": "%resource.repeat(item).where(linkId='a-age-years' and answer.empty().not()).select(today() - answer.value)"
}
}
]
"linkId": "birthdate",
"text": "Date of birth",
"type": "date"
},
{
"linkId": "a-age-years",
"linkId": "age",
"text": "Age",
"type": "quantity",
"type": "integer",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
"valueCoding": {
"system": "http://unitsofmeasure.org",
"code": "years",
"display": "years"
}
},
{
"url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
"valueCoding": {
"system": "http://unitsofmeasure.org",
"code": "months",
"display": "months"
}
}
],
"initial": [
{
"valueQuantity": {
"value": 1,
"unit": "months",
"system": "http://unitsofmeasure.org",
"code": "months"
"url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
"valueExpression": {
"language": "text/fhirpath",
"expression": "%resource.repeat(item).where(linkId='birthdate' and answer.empty().not()).select(today().toString().substring(0,4).toInteger() - answer.value.toString().substring(0,4).toInteger() + iif(today().toString().substring(5,2) & today().toString().substring(8,2) > answer.value.toString().substring(5,2) & answer.value.toString().substring(8,2), 1, 0) - 1)"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion catalog/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<string name="component_name_initial_value">Initial Value</string>
<string
name="behavior_name_calculated_expression_info"
>Input age to automatically calculate birthdate until birthdate is updated manually.</string>
>Input date of birth to automatically calculate age until age is updated manually.</string>
<string
name="behavior_name_calculated_expression"
>Calculated Expression</string>
Expand Down
21 changes: 21 additions & 0 deletions docs/contrib/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ This page documents [Git](https://git-scm.com) tips for contributors to this pro

This project generally follows [these guidelines](https://github.com/google/fhir-data-pipes/blob/master/doc/review_process.md) from our `fhir-data-pipes` sister project.

## Overview

We use the following workflow:

1. Contributors can open "draft" PRs for any Work In Progress (WIP) which does not require review yet.
It's OK if the checks do not pass yet.

1. When a PR is ready for code review, the contributor marks the PR as "Ready for review". For a smooth review, the PR must pass all the checks.
At this point, the PR should only have 1 single commit; please "squash" (or use `--amend`) your "local history",
before pushing to a branch to open a PR (or when your WIP Draft PR is ready for review). The commit message
of this initial commit should explain what this PR is all about.

1. Maintainers, or other Contributors, will now review the PR. They may add comments requesting changes.

1. When contributors update PRs to make changes requested by reviewers, those should be added as
additional new single commits per round of review,
typically with a generic message such as _"Incorporated review feedback."_
Do NOT squash (or amend) these review updates into the original commit.

1. Maintainers (with write acces) _squash_ all commits of PRs into a single commit when merging.

## Usage

### Edit on GitHub Web UI
Expand Down
15 changes: 15 additions & 0 deletions docs/contrib/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,18 @@ This section defines the process one goes through when making changes to any of
* Update your/any dependent PR (PR using the library) with the new _Artifact ID_ and make/trigger the CI

**NB:** For a specific example on working with FHIR SDK's Common Library during development, see [Common Library](#common-library).

# Database migration

If you are making changes to the database schema (in the `engine` or the `knowledge` module), you
need to consider how applications with Android FHIR SDK dependencies can upgrade to the new schema
without losing or corrupting existing data already on device. This can be done with [Room database
migration](https://developer.android.com/training/data-storage/room/migrating-db-versions).

> [!TIP]
> A new JSON schema file will be generated under the `schemas` folder in the module when you
update the database version. If you are having trouble with this, make sure you run the gradle
> command with `--rerun-tasks`:
> ```
> ./gradlew :<module>:build --rerun-tasks
> ```
9 changes: 3 additions & 6 deletions engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ publishArtifact(Releases.Engine)

createJacocoTestReportTask()

// Generate database schema in the schemas folder
ksp { arg("room.schemaLocation", "$projectDir/schemas") }

val generateSearchParamsTask =
project.tasks.register("generateSearchParamsTask", GenerateSearchParamsTask::class) {
srcOutputDir.set(project.layout.buildDirectory.dir("gen/main"))
Expand All @@ -39,12 +42,6 @@ android {
// need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir"
consumerProguardFile("proguard-rules.pro")

javaCompileOptions {
annotationProcessorOptions {
compilerArgumentProviders(RoomSchemaArgProvider(File(projectDir, "schemas")))
}
}
}

sourceSets {
Expand Down
Loading

0 comments on commit 9637279

Please sign in to comment.