Skip to content

Commit

Permalink
CENTRAXX-19280: test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kairosmike committed Apr 15, 2024
1 parent c47e703 commit fe55de8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/test/groovy/projects/izi/frankfurt/ConsentTest.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package projects.izi.frankfurt

import common.AbstractDslBuilderTest
import de.kairos.centraxx.fhir.r4.utils.FhirUrls
import de.kairos.fhir.dsl.r4.context.Context
import de.kairos.fhir.dsl.r4.execution.Fhir4ScriptRunner
import groovy.json.JsonSlurper
import org.hl7.fhir.r4.model.CodeType
import org.hl7.fhir.r4.model.Consent
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test

import static org.junit.jupiter.api.Assertions.assertEquals
Expand All @@ -19,8 +20,7 @@ class ConsentTest extends AbstractDslBuilderTest {
* If provision closures are nested inside a .each closure, the sub provisions are not populated.
*/
@Test
@Disabled("FIXME")
void testThatConsentPartsArePopulated() {
void testThatConsentIsExported() {

// given: select your groovy script to test
final FileInputStream is = new FileInputStream("src/main/groovy/projects/izi/frankfurt/consent.groovy")
Expand All @@ -33,7 +33,8 @@ class ConsentTest extends AbstractDslBuilderTest {
final Consent consent = (Consent) runner.run(new Context(testDataMap))

// then: test your assertions
assertEquals(2, consent.getProvision().getProvision().size())
assertEquals("unknown", ((CodeType) consent.getProvision().getPeriod().getEndElement()
.getExtensionByUrl(FhirUrls.Extension.FhirDefaults.DATA_ABSENT_REASON).getValue()).getCode())
}

static Map<String, Object> createTestData() {
Expand Down
9 changes: 4 additions & 5 deletions src/test/resources/projects/izi/frankfurt/testConsent.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"id": 35,
"creationdate": "2022-08-26T09:49:26.060+02:00",
"syncId": "24d0990d-8ec0-4cf4-a6b6-96d225ea11f2",
"code": "Studie-HAAR-BLUT-DROGEN",
"code": "BC",
"flexiStudy": {
"id": 133,
"creationdate": "2022-07-19T10:21:29.933+02:00",
Expand Down Expand Up @@ -86,7 +86,7 @@
"relatedColumn": "NAME",
"relatedOid": 35,
"lang": "de",
"value": "Studie-HAAR-BLUT-DROGEN",
"value": "BC",
"modifiedOn": "2022-08-26T09:49:26.060+02:00",
"system": false,
"entityStatus": "ACTIVE"
Expand All @@ -98,7 +98,7 @@
"relatedColumn": "NAME",
"relatedOid": 35,
"lang": "en",
"value": "(en) - Studie-HAAR-BLUT-DROGEN",
"value": "(en) - BC",
"modifiedOn": "2022-08-26T09:49:26.060+02:00",
"system": false,
"entityStatus": "ACTIVE"
Expand Down Expand Up @@ -201,8 +201,7 @@
"precision": "DAY"
},
"validUntil": {
"date": "2022-09-05T00:00:00.000+02:00",
"precision": "DAY"
"precision": "UNKNOWN"
},
"revocation": {
"id": 2,
Expand Down

0 comments on commit fe55de8

Please sign in to comment.