-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MemberMatch improperly generates date formats which are spec invalid #…
…3252 Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- Loading branch information
Showing
3 changed files
with
173 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...r-match/src/test/java/com/ibm/fhir/operation/davinci/hrex/test/MemberMatchIssuesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.ibm.fhir.operation.davinci.hrex.test; | ||
|
||
import static org.testng.Assert.assertTrue; | ||
|
||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
import com.ibm.fhir.config.FHIRConfiguration; | ||
import com.ibm.fhir.model.resource.Parameters; | ||
import com.ibm.fhir.model.resource.Patient; | ||
import com.ibm.fhir.model.test.TestUtil; | ||
import com.ibm.fhir.operation.davinci.hrex.provider.strategy.DefaultMemberMatchStrategy.MemberMatchPatientSearchCompiler; | ||
|
||
/** | ||
* A set of tests used in debugging issues | ||
*/ | ||
public class MemberMatchIssuesTest { | ||
@BeforeClass | ||
public void setup() { | ||
FHIRConfiguration.setConfigHome("src/test/resources"); | ||
} | ||
|
||
/* | ||
* Addresses issues: MemberMatch improperly generates date formats which are spec invalid #3252 | ||
*/ | ||
@Test | ||
public void testCompilerForInteroperabilityUseCase() throws Exception { | ||
Parameters parameters = TestUtil.readLocalResource("JSON/member-match-in.json"); | ||
Patient patient = parameters.getParameter().get(0).getResource().as(Patient.class); | ||
MemberMatchPatientSearchCompiler compiler = new MemberMatchPatientSearchCompiler(); | ||
patient.accept(compiler); | ||
assertTrue(compiler.getSearchParameters().get("birthdate").contains("eq1970-02-02")); | ||
} | ||
} |
121 changes: 121 additions & 0 deletions
121
operation/fhir-operation-member-match/src/test/resources/JSON/member-match-in.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{ | ||
"resourceType": "Parameters", | ||
"id": "member-match-in", | ||
"parameter": [ | ||
{ | ||
"name": "MemberPatient", | ||
"resource": { | ||
"resourceType": "Patient", | ||
"id": "MASPatient", | ||
"identifier": [ | ||
{ | ||
"system": "https://github.com/synthetichealth/synthea", | ||
"value": "12346" | ||
} | ||
], | ||
"name": [ | ||
{ | ||
"use": "official", | ||
"family": "Meyer", | ||
"given": [ | ||
"Kelly" | ||
] | ||
} | ||
], | ||
"gender": "female", | ||
"birthDate": "1970-02-02" | ||
} | ||
}, | ||
{ | ||
"name": "CoverageToMatch", | ||
"resource": { | ||
"resourceType": "Coverage", | ||
"id": "9876B1", | ||
"contained": [ | ||
{ | ||
"resourceType": "Organization", | ||
"id": "payer", | ||
"identifier": [ | ||
{ | ||
"system": "http://hl7.org/fhir/sid/us-npi", | ||
"value": "9876543210" | ||
} | ||
], | ||
"active": true, | ||
"name": "Old Health Plan", | ||
"endpoint": [ | ||
{ | ||
"reference": "http://example.org/old-payer/fhir" | ||
} | ||
] | ||
} | ||
], | ||
"identifier": [ | ||
{ | ||
"system": "http://example.org/old-payer", | ||
"value": "DH10001235" | ||
} | ||
], | ||
"status": "draft", | ||
"beneficiary": { | ||
"reference": "Patient/1" | ||
}, | ||
"period": { | ||
"start": "2011-05-23", | ||
"end": "2012-05-23" | ||
}, | ||
"payor": [ | ||
{ | ||
"reference": "#payer" | ||
} | ||
], | ||
"class": [ | ||
{ | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/coverage-class", | ||
"code": "group" | ||
} | ||
] | ||
}, | ||
"value": "CB135" | ||
}, | ||
{ | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/coverage-class", | ||
"code": "plan" | ||
} | ||
] | ||
}, | ||
"value": "B37FC" | ||
}, | ||
{ | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/coverage-class", | ||
"code": "subplan" | ||
} | ||
] | ||
}, | ||
"value": "P7" | ||
}, | ||
{ | ||
"type": { | ||
"coding": [ | ||
{ | ||
"system": "http://terminology.hl7.org/CodeSystem/coverage-class", | ||
"code": "class" | ||
} | ||
] | ||
}, | ||
"value": "SILVER" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |