@@ -12,7 +12,6 @@ class BundleTransformer(private val fhirContext: FhirContext) {
1212 private val log = KotlinLogging .logger(" de.unimuenster.imi.fhir.transform.BundleTransformer" )
1313 private val fhirClient = fhirContext.newRestfulGenericClient(" http://local/fhir" )
1414 private val jsonParser = fhirContext.newJsonParser()
15- private var resourceCache: IBaseResource ? = null
1615 private val fhirPathEngine = if (fhirContext.version.version == FhirVersionEnum .DSTU3 ) {
1716 FhirPathEngineWrapperSTU3 (fhirContext, fhirClient)
1817 } else {
@@ -62,20 +61,14 @@ class BundleTransformer(private val fhirContext: FhirContext) {
6261
6362
6463 private fun readInResource (resourceString : String ): IBaseResource {
65- if (resourceCache != null ) {
66- return resourceCache!!
67- } else {
68- val resource: IBaseResource
69- try {
70- resource = jsonParser.parseResource(resourceString)
71- } catch (e: Exception ) {
72- log.error(" Could not convert resource to Bundle instance: " , e)
73- throw Exception (" ConversionError" )
74- }
75-
76- this .resourceCache = resource
77- return resource
64+ val resource: IBaseResource
65+ try {
66+ resource = jsonParser.parseResource(resourceString)
67+ } catch (e: Exception ) {
68+ log.error(" Could not convert resource to Bundle instance: " , e)
69+ throw Exception (" ConversionError" )
7870 }
71+ return resource
7972 }
8073
8174 private fun processBundleEntry (
0 commit comments