-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into sp/issue-2188-m3-theme
- Loading branch information
Showing
80 changed files
with
3,011 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# Gotta Catch 'Em All! (i.e. don't wait and propose them only "trickled") | ||
open-pull-requests-limit: 99 | ||
|
||
- package-ecosystem: gradle | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
day: monday | ||
time: "04:00" | ||
|
||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
day: monday | ||
time: "04:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "master" ] | ||
schedule: | ||
- cron: '32 13 * * 2' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-22.04-64core | ||
timeout-minutes: 60 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'java' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Switch to Java 17 from Eclipse Temurin distro | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
# TODO: use Autobuild instead of ./gradlew after https://github.com/github/codeql-action/issues/1417 is fixed | ||
# - name: Autobuild | ||
# uses: github/codeql-action/autobuild@v2 | ||
- name: Build with Gradle | ||
run: ./gradlew --scan --full-stacktrace -Dorg.gradle.dependency.verification=off compileDebugAndroidTestSources | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Android FHIR SDK | ||
|
||
[![master](https://github.com/google/android-fhir/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/google/android-fhir/actions/workflows/build.yml) [![master](https://storage.googleapis.com/android-fhir-build-badges/build.svg)](https://storage.googleapis.com/android-fhir-build-badges/build.html) [![codecov](https://codecov.io/gh/google/android-fhir/branch/master/graph/badge.svg?token=PDSC4WRDTQ)](https://codecov.io/gh/google/android-fhir/branch/master) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://chat.fhir.org/#narrow/stream/276344-android) | ||
[![master](https://github.com/google/android-fhir/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/google/android-fhir/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/google/android-fhir/branch/master/graph/badge.svg?token=PDSC4WRDTQ)](https://codecov.io/gh/google/android-fhir/branch/master) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://chat.fhir.org/#narrow/stream/276344-android) | ||
|
||
The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first | ||
healthcare applications using the [HL7® FHIR® standard](https://www.hl7.org/fhir/) on Android. It | ||
|
@@ -15,7 +15,7 @@ The SDK contains the following libraries: | |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| Data Capture Library | [![Google Maven](https://badgen.net/maven/v/metadata-url/dl.google.com/dl/android/maven2/com/google/android/fhir/data-capture/maven-metadata.xml)](https://maven.google.com/web/index.html?#com.google.android.fhir:data-capture) | [code](https://github.com/google/android-fhir/tree/master/datacapture)| [wiki](https://github.com/google/android-fhir/wiki/Structured-Data-Capture-Library) | Android 7.0 (API level 24) | Collect, validate, and process healthcare data on Android | | ||
| FHIR Engine Library | [![Google Maven](https://badgen.net/maven/v/metadata-url/dl.google.com/dl/android/maven2/com/google/android/fhir/engine/maven-metadata.xml)](https://maven.google.com/web/index.html?#com.google.android.fhir:engine) | [code](https://github.com/google/android-fhir/tree/master/engine) | [wiki](https://github.com/google/android-fhir/wiki/FHIR-Engine-Library) | Android 7.0 (API level 24) | Store and manage FHIR resources locally on Android and synchronize with FHIR server | | ||
| Workflow Library | [![Google Maven](https://badgen.net/maven/v/metadata-url/dl.google.com/dl/android/maven2/com/google/android/fhir/workflow/maven-metadata.xml)](https://maven.google.com/web/index.html?#com.google.android.fhir:workflow) | [code](https://github.com/google/android-fhir/tree/master/workflow) | [wiki](https://github.com/google/android-fhir/wiki/Workflow-Library) | Android 8.0 (API level 26) | Provide decision support and analytics in clinical workflow on Android including implementation of specific FHIR operations ($measure_evaluate and $apply) | | ||
| Workflow Library | [![Google Maven](https://badgen.net/maven/v/metadata-url/dl.google.com/dl/android/maven2/com/google/android/fhir/workflow/maven-metadata.xml)](https://maven.google.com/web/index.html?#com.google.android.fhir:workflow) | [code](https://github.com/google/android-fhir/tree/master/workflow) | [wiki](https://github.com/google/android-fhir/wiki/Workflow-Library) | Android 7.0 (API level 24) | Provide decision support and analytics in clinical workflow on Android including implementation of specific FHIR operations ($measure_evaluate and $apply) | | ||
|
||
## Demo apps | ||
|
||
|
@@ -38,7 +38,7 @@ To contribute to the project, please see [Contributing](https://github.com/googl | |
|
||
You can create a [GitHub issue](https://github.com/google/android-fhir/issues) for bugs and feature requests. | ||
|
||
In case you find any security bug, please do NOT create a Github issue. Instead, email us at <[email protected]>. | ||
In case you find any security bug, please do NOT create a GitHub issue. Instead, email us at <[email protected]>. | ||
|
||
If you want to provide any feedback or discuss use cases you can: | ||
* email us at <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"resourceType": "Questionnaire", | ||
"item": [ | ||
{ | ||
"extension": [ | ||
{ | ||
"url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression", | ||
"valueExpression": { | ||
"language": "application/x-fhir-query", | ||
"expression": "Task?subject=Patient/P1&code=33879002&status=ready&_sort=period" | ||
} | ||
}, | ||
{ | ||
"url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn", | ||
"extension": [ | ||
{ | ||
"url": "path", | ||
"valueString": "description + ' - ' + reasonCode.coding.where(system='http://snomed.info/sct').display" | ||
}, | ||
{ | ||
"url": "forDisplay", | ||
"valueBoolean": true | ||
} | ||
] | ||
} | ||
], | ||
"linkId": "vaccines", | ||
"text": "Which vaccine tasks were completed?", | ||
"type": "reference", | ||
"required": true, | ||
"repeats": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"resourceType": "Bundle", | ||
"entry": [ | ||
{ | ||
"resource": { | ||
"resourceType" : "Patient", | ||
"id" : "P1" | ||
} | ||
}, | ||
{ | ||
"resource": { | ||
"resourceType": "Task", | ||
"id": "b8e13d21-1a62-4172-a9ef-57670e6ac238", | ||
"status": "ready", | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"code": "33879002", | ||
"display": "Vaccination routine" | ||
} | ||
] | ||
}, | ||
"description": "BCG at birth", | ||
"for": { | ||
"reference": "Patient/P1" | ||
}, | ||
"reasonCode": { | ||
"coding": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"code": "42284007", | ||
"display": "BCG vaccine" | ||
}, | ||
{ | ||
"system": "https://smartregister.org/immunization/vaccine-codes", | ||
"code": "bcg", | ||
"display": "BCG" | ||
} | ||
], | ||
"text": "BCG" | ||
} | ||
} | ||
}, | ||
{ | ||
"resource": { | ||
"resourceType": "Task", | ||
"id": "4090ba9a-fbbb-4634-a06d-0cbe938ab090", | ||
"status": "cancelled", | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"code": "33879002", | ||
"display": "Vaccination routine" | ||
} | ||
] | ||
}, | ||
"description": "OPV 0 at birth", | ||
"for": { | ||
"reference": "Patient/P1" | ||
}, | ||
"reasonCode": { | ||
"coding": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"code": "111164008", | ||
"display": "Poliovirus vaccine" | ||
}, | ||
{ | ||
"system": "https://smartregister.org/immunization/vaccine-codes", | ||
"code": "opv0", | ||
"display": "OPV 0" | ||
} | ||
], | ||
"text": "OPV 0" | ||
} | ||
} | ||
}, | ||
{ | ||
"resource": { | ||
"resourceType": "Task", | ||
"id": "087e82c6-e346-4725-8db1-7e10aec99be9", | ||
"status": "ready", | ||
"code": { | ||
"coding": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"code": "33879002", | ||
"display": "Vaccination routine" | ||
} | ||
] | ||
}, | ||
"description": "OPV 1 at 6 weeks", | ||
"for": { | ||
"reference": "Patient/P1" | ||
}, | ||
"reasonCode": { | ||
"coding": [ | ||
{ | ||
"system": "http://snomed.info/sct", | ||
"code": "111164008", | ||
"display": "Poliovirus vaccine" | ||
}, | ||
{ | ||
"system": "https://smartregister.org/immunization/vaccine-codes", | ||
"code": "opv1", | ||
"display": "OPV 1" | ||
} | ||
], | ||
"text": "OPV 1" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
catalog/src/main/java/com/google/android/fhir/catalog/CatalogApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2022-2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.android.fhir.catalog | ||
|
||
import android.app.Application | ||
import ca.uhn.fhir.context.FhirContext | ||
import com.google.android.fhir.FhirEngine | ||
import com.google.android.fhir.FhirEngineConfiguration | ||
import com.google.android.fhir.FhirEngineProvider | ||
import com.google.android.fhir.datacapture.DataCaptureConfig | ||
import com.google.android.fhir.search.search | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
import org.hl7.fhir.r4.model.Bundle | ||
|
||
class CatalogApplication : Application(), DataCaptureConfig.Provider { | ||
// Only initiate the FhirEngine when used for the first time, not when the app is created. | ||
private val fhirEngine: FhirEngine by lazy { FhirEngineProvider.getInstance(this) } | ||
|
||
private lateinit var dataCaptureConfig: DataCaptureConfig | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
FhirEngineProvider.init(FhirEngineConfiguration()) | ||
|
||
dataCaptureConfig = | ||
DataCaptureConfig(xFhirQueryResolver = { fhirEngine.search(it).map { it.resource } }) | ||
|
||
CoroutineScope(Dispatchers.IO).launch { | ||
assets | ||
.open("resource_data_bundle.json") | ||
.bufferedReader() | ||
.use { bufferedReader -> bufferedReader.readText() } | ||
.let { stringValue -> | ||
FhirContext.forR4Cached().newJsonParser().parseResource(stringValue) as Bundle | ||
} | ||
.entry | ||
.map { bundleEntryComponent -> bundleEntryComponent.resource } | ||
.let { resources -> fhirEngine.create(*resources.toTypedArray()) } | ||
} | ||
} | ||
|
||
override fun getDataCaptureConfig(): DataCaptureConfig = dataCaptureConfig | ||
} |
Oops, something went wrong.