Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to the latest FHIR SDK Artifacts #3211

Merged
merged 9 commits into from
Apr 23, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.hl7.fhir.r4.model.EpisodeOfCare
import org.hl7.fhir.r4.model.Group
import org.hl7.fhir.r4.model.Immunization
import org.hl7.fhir.r4.model.ListResource
import org.hl7.fhir.r4.model.Location
import org.hl7.fhir.r4.model.Observation
import org.hl7.fhir.r4.model.Patient
Expand Down Expand Up @@ -81,6 +82,7 @@
"Task_Restriction" -> Task.TaskRestrictionComponent()
"AdverseEvent_SuspectEntity" -> AdverseEvent.AdverseEventSuspectEntityComponent()
"Location_Position" -> Location.LocationPositionComponent()
"List_Entry" -> ListResource.ListEntryComponent()

Check warning on line 85 in android/engine/src/main/java/org/smartregister/fhircore/engine/util/helper/TransformSupportServices.kt

View check run for this annotation

Codecov / codecov/patch

android/engine/src/main/java/org/smartregister/fhircore/engine/util/helper/TransformSupportServices.kt#L85

Added line #L85 was not covered by tests
else -> ResourceFactory.createResourceOrType(name)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@

package org.smartregister.fhircore.engine

import android.content.Context
import androidx.test.core.app.ApplicationProvider
import androidx.work.WorkManager
import androidx.work.WorkRequest
import ca.uhn.fhir.context.FhirContext
import ca.uhn.fhir.context.FhirVersionEnum
import ca.uhn.fhir.parser.IParser
import com.google.android.fhir.FhirEngine
import com.google.android.fhir.datacapture.mapping.ResourceMapper
import com.google.android.fhir.datacapture.mapping.StructureMapExtractionContext
Expand Down Expand Up @@ -70,12 +65,10 @@ import org.smartregister.fhircore.engine.util.helper.TransformSupportServices
class FhirExtractionTest : RobolectricTest() {
@get:Rule(order = 0) val hiltRule = HiltAndroidRule(this)
val fhirEngine: FhirEngine = mockk()
val context = ApplicationProvider.getApplicationContext<Context>()

@Inject lateinit var transformSupportServices: TransformSupportServices
lateinit var structureMapUtilities: StructureMapUtilities
private lateinit var structureMapUtilities: StructureMapUtilities
private val defaultRepository: DefaultRepository = mockk()
private val iParser: IParser = FhirContext.forCached(FhirVersionEnum.R4).newJsonParser()

@Before
fun setup() {
Expand All @@ -100,7 +93,6 @@ class FhirExtractionTest : RobolectricTest() {
questionnaireResponse = questionnaireResponse,
structureMapExtractionContext =
StructureMapExtractionContext(
context = context,
structureMapProvider = { _, _ -> resources.structureMap },
transformSupportServices = transformSupportServices,
),
Expand Down Expand Up @@ -190,7 +182,6 @@ class FhirExtractionTest : RobolectricTest() {
questionnaireResponse = questionnaireResponse,
structureMapExtractionContext =
StructureMapExtractionContext(
context = context,
structureMapProvider = { _, _ -> resources.structureMap },
transformSupportServices = transformSupportServices,
),
Expand Down
6 changes: 3 additions & 3 deletions android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ android-x-test= "1.5.2"
core-testing = "2.2.0"
coverallsGradlePlugin = "2.12.0"
cqfFhirCr = "3.0.0-PRE9"
data-capture = "1.1.0-preview7-SNAPSHOT"
data-capture = "1.1.0-preview8-SNAPSHOT"
datastore = "1.0.0"
desugar-jdk-libs = "2.0.4"
dokkaBase = "1.8.20"
easy-rules-jexl = "4.1.0"
espresso-core = "3.5.1"
fhir-common-utils = "1.0.0-SNAPSHOT"
fhir-engine = "1.0.0-preview5-SNAPSHOT"
fhir-engine = "1.0.0-preview7.1-SNAPSHOT"
foundation = "1.6.3"
fragment-ktx = "1.6.2"
glide = "4.16.0"
Expand All @@ -37,7 +37,7 @@ jsonPath = "2.8.0"
junit = "1.1.5"
junit-jupiter = "5.9.1"
junit-ktx = "1.1.5"
knowledge = "0.1.0-alpha03-preview3.1-SNAPSHOT"
knowledge = "0.1.0-alpha03-preview4-SNAPSHOT"
kotlin = "1.9.22"
kotlinx-coroutines = "1.7.3"
kotlinx-serialization-json = "1.6.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ object Faker {

override suspend fun purge(type: ResourceType, id: String, forcePurge: Boolean) {}

override suspend fun purge(
type: ResourceType,
ids: Set<String>,
forcePurge: Boolean,
) {}

override suspend fun <R : Resource> search(search: Search): List<SearchResult<R>> =
emptyList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ constructor(
questionnaireResponse = questionnaireResponse,
structureMapExtractionContext =
StructureMapExtractionContext(
context = context,
transformSupportServices = transformSupportServices,
structureMapProvider = { structureMapUrl: String?, _: IWorkerContext ->
structureMapUrl?.substringAfterLast("/")?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class RegisterContentTest : RobolectricTest() {
sourceGroup: String,
): StructureMapExtractionContext {
return StructureMapExtractionContext(
context = context,
transformSupportServices = transformSupportServices,
structureMapProvider = { _: String, _: IWorkerContext ->
StructureMapUtilities(worker, transformSupportServices)
Expand Down
Loading