Skip to content

Commit e23d9c6

Browse files
authored
Update to org.hl7.fhir.core 6.7.6 (#232)
* Update core to 6.6.8-SNAPSHOT + fix tests * Update to core 6.7.6 + Update presets for CDA + US-CCDA + Fix Tests
1 parent 5cda35f commit e23d9c6

File tree

10 files changed

+40
-44
lines changed

10 files changed

+40
-44
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kotlin.code.style=official
22
kotlin.js.generate.executable.default=false
33

44
# versions
5-
fhirCoreVersion= 6.6.7
5+
fhirCoreVersion= 6.7.6
66

77
junitVersion=5.7.1
88
mockk_version=1.10.2

http-client-tests/resources/explicit-preset-requests/cda.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"validationContext": {
33
"sv": "5.0.0",
44
"igs": [
5-
"hl7.cda.uv.core#2.0.0-sd-snapshot1"
5+
"hl7.cda.uv.core#2.0.1-sd"
66
],
77
"locale": "en"
88
},

http-client-tests/resources/explicit-preset-requests/us-ccda.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"validationContext": {
33
"sv": "5.0.0",
44
"igs": [
5-
"hl7.cda.us.ccda#3.0.0-ballot"
5+
"hl7.cda.us.ccda#4.0.0"
66
],
77
"locale": "en"
88
},

http-client-tests/tests/explicit-queries.http

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Content-Type: application/json
2727

2828
### CDA
2929
# @name CDA
30-
# This example is compo
3130
POST {{host}}/validate
3231
Content-Type: application/json
3332

@@ -42,16 +41,15 @@ Content-Type: application/json
4241
client.test("Issues are Correct", function () {
4342
let issues = response.body.outcomes[0].issues
4443
client.log("issues:" + issues.length)
45-
client.assert(issues.length === 10);
46-
client.assert(containsIssue(issues, 20, 24, "Binding has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
44+
client.assert(issues.length === 9);
45+
client.assert(containsIssue(issues, 20, 24, "Binding for path ClinicalDocument.realmCode[0] in profile StructureDefinition[http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument|2.0.1-sd] has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
4746
client.assert(containsIssue(issues, 251, 184, "The OID '2.16.840.1.114222.4.11.1066' is not known, so the code can't be validated", "CODEINVALID", "WARNING"))
4847
});
4948
%}
5049

5150

52-
### US-CDA
53-
# @name US-CDA
54-
# Check that a request with explicit IG settings returns an expected response
51+
### US-CCDA
52+
# @name US-CCDA
5553
# @timeout 240
5654
POST {{host}}/validate
5755
Content-Type: application/json
@@ -66,8 +64,8 @@ Content-Type: application/json
6664
client.test("Issues are Correct", function() {
6765
let issues = response.body.outcomes[0].issues
6866
client.log("issues:" + issues.length)
69-
client.assert(issues.length === 10)
70-
client.assert(containsIssue(issues, 20, 24, "Binding has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
67+
client.assert(issues.length === 9)
68+
client.assert(containsIssue(issues, 20, 24, "Binding for path ClinicalDocument.realmCode[0] in profile StructureDefinition[http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument|2.0.1-sd] has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
7169
client.assert(!containsIssue(issues, 251, 184, "The OID '2.16.840.1.113883.1.11.19830' is not known, so the code can't be validated", "CODEINVALID", "WARNING"))
7270
})
7371
%}
@@ -114,15 +112,14 @@ Content-Type: application/json
114112
client.test("Issues are Correct", function() {
115113
let issues = response.body.outcomes[0].issues
116114
client.log("issues:" + issues.length)
117-
client.assert(issues.length === 40);
115+
client.assert(issues.length === 62);
118116
client.assert(containsIssue(issues, 2, 37, "The Snomed CT code 373270004 (Substance with penicillin structure and antibacterial mechanism of action) is not a member of the IPS free set", "BUSINESSRULE", "INFORMATION"))
119-
client.assert(containsIssue(issues, 144, 28, "This element does not match any known slice defined in the profile http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-composition|0.4.0-cibuild (this may not be a problem, but you should check that it's not intended to match a slice)", "INFORMATIONAL", "INFORMATION"))
117+
client.assert(containsIssue(issues, 144, 28, "This element does not match any known slice defined in the profile http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-composition|0.5.0-cibuild (this may not be a problem, but you should check that it's not intended to match a slice)", "INFORMATIONAL", "INFORMATION"))
120118
});
121119
%}
122120

123121
### SQL-ON-FHIR
124122
# @name SQL-ON-FHIR
125-
# Check that a request with explicit IG settings returns an expected response
126123
POST {{host}}/validate
127124
Content-Type: application/json
128125

http-client-tests/tests/preset-queries.http

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# These tests do validations using CliContext instances that use the presents in
2+
# These tests do validations using CliContext instances that use the presets in
33
# commonMain/kotlin/constants/Preset
44

55
# Conversely, the preset-queries.http tests will perform the same tests, but using
@@ -28,7 +28,6 @@ Content-Type: application/json
2828

2929
### CDA
3030
# @name CDA
31-
# This example is compo
3231
POST {{host}}/validate
3332
Content-Type: application/json
3433

@@ -43,16 +42,15 @@ Content-Type: application/json
4342
client.test("Issues are Correct", function () {
4443
let issues = response.body.outcomes[0].issues
4544
client.log("issues:" + issues.length)
46-
client.assert(issues.length === 10);
47-
client.assert(containsIssue(issues, 20, 24, "Binding has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
45+
client.assert(issues.length === 9);
46+
client.assert(containsIssue(issues, 20, 24, "Binding for path ClinicalDocument.realmCode[0] in profile StructureDefinition[http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument|2.0.1-sd] has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
4847
client.assert(containsIssue(issues, 251, 184, "The OID '2.16.840.1.114222.4.11.1066' is not known, so the code can't be validated", "CODEINVALID", "WARNING"))
4948
});
5049
%}
5150

5251

53-
### US-CDA
54-
# @name US-CDA
55-
# Check that a request with explicit IG settings returns an expected response
52+
### US-CCDA
53+
# @name US-CCDA
5654
POST {{host}}/validate
5755
Content-Type: application/json
5856

@@ -66,8 +64,8 @@ Content-Type: application/json
6664
client.test("Issues are Correct", function() {
6765
let issues = response.body.outcomes[0].issues
6866
client.log("issues:" + issues.length)
69-
client.assert(issues.length === 10)
70-
client.assert(containsIssue(issues, 20, 24, "Binding has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
67+
client.assert(issues.length === 9)
68+
client.assert(containsIssue(issues, 20, 24, "Binding for path ClinicalDocument.realmCode[0] in profile StructureDefinition[http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument|2.0.1-sd] has no source, so can't be checked", "CODEINVALID", "INFORMATION"))
7169
client.assert(!containsIssue(issues, 251, 184, "The OID '2.16.840.1.113883.1.11.19830' is not known, so the code can't be validated", "CODEINVALID", "WARNING"))
7270
})
7371
%}
@@ -112,15 +110,14 @@ Content-Type: application/json
112110
client.test("Issues are Correct", function() {
113111
let issues = response.body.outcomes[0].issues
114112
client.log("issues:" + issues.length)
115-
client.assert(issues.length === 49);
113+
client.assert(issues.length === 71);
116114
client.assert(containsIssue(issues, 2, 37, "The Snomed CT code 373270004 (Substance with penicillin structure and antibacterial mechanism of action) is not a member of the IPS free set", "BUSINESSRULE", "INFORMATION"))
117-
client.assert(containsIssue(issues, 144, 28, "This element does not match any known slice defined in the profile http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-composition|0.4.0-cibuild (this may not be a problem, but you should check that it's not intended to match a slice)", "INFORMATIONAL", "INFORMATION"))
115+
client.assert(containsIssue(issues, 144, 28, "This element does not match any known slice defined in the profile http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-composition|0.5.0-cibuild (this may not be a problem, but you should check that it's not intended to match a slice)", "INFORMATIONAL", "INFORMATION"))
118116
});
119117
%}
120118

121119
### SQL-ON-FHIR
122120
# @name SQL-ON-FHIR
123-
# Check that a request with explicit IG settings returns an expected response
124121
POST {{host}}/validate
125122
Content-Type: application/json
126123

src/commonMain/kotlin/model/ValidationContext.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ expect class ValidationContext() {
1818
fun setNoExtensibleBindingMessages(noExtensibleBindingMessages: Boolean): ValidationContext
1919

2020
fun isShowTimes(): Boolean
21-
fun setShowTimes(showTimes: Boolean)
21+
fun setShowTimes(showTimes: Boolean) : ValidationContext
2222

2323
fun getTxServer(): String
2424
fun setTxServer(txServer: String): ValidationContext
@@ -48,7 +48,7 @@ expect class ValidationContext() {
4848
fun setSv(sv: String): ValidationContext
4949

5050
fun isAllowExampleUrls() : Boolean
51-
fun setAllowExampleUrls(allowExampleUrls:Boolean)
51+
fun setAllowExampleUrls(allowExampleUrls:Boolean) : ValidationContext
5252

5353
fun setLocale(languageString: String) : ValidationContext
5454

src/jsMain/kotlin/model/ValidationContext.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,18 @@ actual class ValidationContext actual constructor() {
103103
return showTimes
104104
}
105105

106-
actual fun setShowTimes(showTimes: Boolean) {
106+
actual fun setShowTimes(showTimes: Boolean) : ValidationContext {
107107
this.showTimes = showTimes
108+
return this;
108109
}
109110

110111
actual fun isAllowExampleUrls(): Boolean {
111112
return allowExampleUrls
112113
}
113114

114-
actual fun setAllowExampleUrls(allowExampleUrls : Boolean) {
115+
actual fun setAllowExampleUrls(allowExampleUrls : Boolean) : ValidationContext {
115116
this.allowExampleUrls = allowExampleUrls
117+
return this
116118
}
117119

118120
actual fun getTxServer(): String {

src/jvmMain/kotlin/controller/ig/IgControllerImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class IgControllerImpl : IgController, KoinComponent {
3333
val packageInfoList: MutableList<PackageInfo> = mutableListOf()
3434

3535
SIMPLIFIER_VERSIONS.forEach {
36-
val packageList = packageClient.search(igPackageName, null, it, true)
36+
val packageList = packageClient.search(igPackageName, null, it, true, null)
3737
packageList?.map {
3838
PackageInfo(id = it.id, version = null, fhirVersion = null, url = null)
3939
}?.toMutableList()?.forEach({

src/jvmMain/resources/presets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@
111111
"baseEngine": "CDA",
112112
"sv": "5.0.0",
113113
"igs": [
114-
"hl7.cda.uv.core#2.0.0-sd-snapshot1"
114+
"hl7.cda.uv.core#2.0.1-sd"
115115
]
116116
},
117117
"igPackageInfo": [{
118118
"id": "hl7.cda.uv.core",
119-
"version": "2.0.0-sd-snapshot1",
119+
"version": "2.0.1-sd",
120120
"fhirVersion": "5.0.0",
121121
"url": "http://hl7.org/cda/stds/core/ImplementationGuide/hl7.cda.uv.core"
122122
}],
@@ -134,12 +134,12 @@
134134
"baseEngine": "US_CCDA",
135135
"sv": "5.0.0",
136136
"igs": [
137-
"hl7.cda.us.ccda#3.0.0-ballot"
137+
"hl7.cda.us.ccda#4.0.0"
138138
]
139139
},
140140
"igPackageInfo": [{
141141
"id": "hl7.cda.us.ccda",
142-
"version": "3.0.0-ballot",
142+
"version": "4.0.0",
143143
"fhirVersion": "5.0.0",
144144
"url": "http://hl7.org/fhir/us/ccda/ImplementationGuide/hl7.fhir.us.ccda"
145145
}],

src/jvmTest/kotlin/controller/ig/IgControllerTest.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ class IgControllerTest : BaseControllerTest() {
8989
val resultingPackageInfoListR4 = givenAProcessedListOfValidPackageInfoR4()
9090

9191

92-
coEvery { igPackageClient.search(any(), any(), eq("DSTU2"), any()) } returns igPackageInfoListDSTU2
93-
coEvery { igPackageClient.search(any(), any(), eq("STU3"), any()) } returns igPackageInfoListSTU3
94-
coEvery { igPackageClient.search(any(), any(), eq("R4"), any()) } returns igPackageInfoListR4
92+
coEvery { igPackageClient.search(any(), any(), eq("DSTU2"), any(), any()) } returns igPackageInfoListDSTU2
93+
coEvery { igPackageClient.search(any(), any(), eq("STU3"), any(), any()) } returns igPackageInfoListSTU3
94+
coEvery { igPackageClient.search(any(), any(), eq("R4"), any(), any()) } returns igPackageInfoListR4
9595

9696
runBlocking {
9797
val response = igController.listIgsFromSimplifier()
@@ -104,9 +104,9 @@ class IgControllerTest : BaseControllerTest() {
104104
fun `test ig controller returns empty list on null return from simplifier`() {
105105
val nullIgPackageInfoList = givenANullReturnedListOfPackageInfo()
106106

107-
coEvery { igPackageClient.search(any(), any(), eq("DSTU2"), any()) } returns nullIgPackageInfoList
108-
coEvery { igPackageClient.search(any(), any(), eq("STU3"), any()) } returns nullIgPackageInfoList
109-
coEvery { igPackageClient.search(any(), any(), eq("R4"), any()) } returns nullIgPackageInfoList
107+
coEvery { igPackageClient.search(any(), any(), eq("DSTU2"), any(), any()) } returns nullIgPackageInfoList
108+
coEvery { igPackageClient.search(any(), any(), eq("STU3"), any(), any()) } returns nullIgPackageInfoList
109+
coEvery { igPackageClient.search(any(), any(), eq("R4"), any(), any()) } returns nullIgPackageInfoList
110110

111111
runBlocking {
112112
val response = igController.listIgsFromSimplifier()
@@ -118,9 +118,9 @@ class IgControllerTest : BaseControllerTest() {
118118
fun `test ig controller returns empty list on empty list return from simplifier`() {
119119
val emptyIgPackageInfoList = givenAnEmptyReturnedListOfPackageInfo()
120120

121-
coEvery { igPackageClient.search(any(), any(), eq("DSTU2"), any()) } returns emptyIgPackageInfoList
122-
coEvery { igPackageClient.search(any(), any(), eq("STU3"), any()) } returns emptyIgPackageInfoList
123-
coEvery { igPackageClient.search(any(), any(), eq("R4"), any()) } returns emptyIgPackageInfoList
121+
coEvery { igPackageClient.search(any(), any(), eq("DSTU2"), any(), any()) } returns emptyIgPackageInfoList
122+
coEvery { igPackageClient.search(any(), any(), eq("STU3"), any(), any()) } returns emptyIgPackageInfoList
123+
coEvery { igPackageClient.search(any(), any(), eq("R4"), any(), any()) } returns emptyIgPackageInfoList
124124

125125
runBlocking {
126126
val response = igController.listIgsFromSimplifier()

0 commit comments

Comments
 (0)