Skip to content

Commit

Permalink
Issue #1734 - add code/coding/codeableConcept tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
  • Loading branch information
michaelwschroeder committed Mar 31, 2021
1 parent 94c7385 commit f172347
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
20 changes: 20 additions & 0 deletions fhir-examples/src/main/resources/json/ibm/basic/BasicToken.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"resourceType": "Basic",
"text": {
"status": "extensions",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"></div>"
},
"code": {
"text": "test"
},
Expand Down Expand Up @@ -35,6 +39,13 @@
"code": "code"
}
},
{
"url": "http://example.org/Coding-validCodeAndSystem",
"valueCoding": {
"system": "http://terminology.hl7.org/CodeSystem/basic-resource-type",
"code": "diet"
}
},
{
"url": "http://example.org/CodeableConcept",
"valueCodeableConcept": {
Expand All @@ -56,6 +67,15 @@
}]
}
},
{
"url": "http://example.org/CodeableConcept-validCodeAndSystem",
"valueCodeableConcept": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/basic-resource-type",
"code": "diet"
}]
}
},
{
"url": "http://example.org/Identifier",
"valueIdentifier": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,15 @@ public void testSearchToken_code_chained_missing() throws Exception {

@Test
public void testSearchToken_code_in() throws Exception {
assertSearchReturnsSavedResource("text-status:in", "http://hl7.org/fhir/ValueSet/narrative-status");
assertSearchDoesntReturnSavedResource("code:in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchDoesntReturnSavedResource("missing-code:in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchDoesntReturnSavedResource("code:in", "http://hl7.org/fhir/ValueSet/observation-category");
}

@Test
public void testSearchToken_code_not_in() throws Exception {
assertSearchDoesntReturnSavedResource("text-status:not-in", "http://hl7.org/fhir/ValueSet/narrative-status");
assertSearchReturnsSavedResource("code:not-in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchReturnsSavedResource("missing-code:not-in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchReturnsSavedResource("code:not-in", "http://hl7.org/fhir/ValueSet/observation-category");
Expand Down Expand Up @@ -274,12 +276,14 @@ public void testSearchToken_CodeableConcept_chained_missing() throws Exception {

@Test
public void testSearchToken_CodeableConcept_in() throws Exception {
assertSearchReturnsSavedResource("CodeableConcept-validCodeAndSystem:in", "http://hl7.org/fhir/ValueSet/basic-resource-type");
assertSearchDoesntReturnSavedResource("CodeableConcept:in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchDoesntReturnSavedResource("missing-CodeableConcept:in", "http://hl7.org/fhir/ValueSet/concept-property-type");
}

@Test
public void testSearchToken_CodeableConcept_not_in() throws Exception {
assertSearchDoesntReturnSavedResource("CodeableConcept-validCodeAndSystem:not-in", "http://hl7.org/fhir/ValueSet/basic-resource-type");
assertSearchReturnsSavedResource("CodeableConcept:not-in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchReturnsSavedResource("missing-CodeableConcept:not-in", "http://hl7.org/fhir/ValueSet/concept-property-type");
}
Expand Down Expand Up @@ -370,12 +374,14 @@ public void testSearchToken_Coding_chained_missing() throws Exception {

@Test
public void testSearchToken_Coding_in() throws Exception {
assertSearchReturnsSavedResource("Coding-validCodeAndSystem:in", "http://hl7.org/fhir/ValueSet/basic-resource-type");
assertSearchDoesntReturnSavedResource("Coding:in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchDoesntReturnSavedResource("missing-Coding:in", "http://hl7.org/fhir/ValueSet/concept-property-type");
}

@Test
public void testSearchToken_Coding_not_in() throws Exception {
assertSearchDoesntReturnSavedResource("Coding-validCodeAndSystem:not-in", "http://hl7.org/fhir/ValueSet/basic-resource-type");
assertSearchReturnsSavedResource("Coding:not-in", "http://hl7.org/fhir/ValueSet/concept-property-type");
assertSearchReturnsSavedResource("missing-Coding:not-in", "http://hl7.org/fhir/ValueSet/concept-property-type");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,5 +565,53 @@
"xpath": "f:Basic/f:extension[@url='http://example.org/missing-ContactPoint']/f:valueContactPoint",
"xpathUsage": "normal"
}
},{
"fullUrl": "http://ibm.com/fhir/SearchParameter/Basic-text-status",
"resource": {
"resourceType": "SearchParameter",
"id": "Basic-text-status",
"url": "http://ibm.com/fhir/SearchParameter/Basic-text-status",
"name": "text-status",
"status": "active",
"description": "test param",
"code": "text-status",
"base": ["Basic"],
"type": "token",
"expression": "Basic.text.status",
"xpath": "f:Basic/f:text/f:status",
"xpathUsage": "normal"
}
},{
"fullUrl": "http://ibm.com/fhir/SearchParameter/Basic-Coding-validCodeAndSystem",
"resource": {
"resourceType": "SearchParameter",
"id": "Basic-Coding-validCodeAndSystem",
"url": "http://ibm.com/fhir/SearchParameter/Basic-Coding-validCodeAndSystem",
"name": "Coding-validCodeAndSystem",
"status": "active",
"description": "test param",
"code": "Coding-validCodeAndSystem",
"base": ["Basic"],
"type": "token",
"expression": "Basic.extension.where(url='http://example.org/Coding-validCodeAndSystem').value",
"xpath": "f:Basic/f:extension[@url='http://example.org/Coding-validCodeAndSystem']/f:valueCoding",
"xpathUsage": "normal"
}
},{
"fullUrl": "http://ibm.com/fhir/SearchParameter/Basic-CodeableConcept-validCodeAndSystem",
"resource": {
"resourceType": "SearchParameter",
"id": "Basic-CodeableConcept-validCodeAndSystem",
"url": "http://ibm.com/fhir/SearchParameter/Basic-CodeableConcept-validCodeAndSystem",
"name": "CodeableConcept-validCodeAndSystem",
"status": "active",
"description": "test param",
"code": "CodeableConcept-validCodeAndSystem",
"base": ["Basic"],
"type": "token",
"expression": "Basic.extension.where(url='http://example.org/CodeableConcept-validCodeAndSystem').value",
"xpath": "f:Basic/f:extension[@url='http://example.org/CodeableConcept-validCodeAndSystem']/f:valueCodeableConcept",
"xpathUsage": "normal"
}
}]
}

0 comments on commit f172347

Please sign in to comment.