Expand tests, fix break

This commit is contained in:
dotasek 2022-11-28 18:47:58 -05:00
parent fce80bb9b1
commit 8d485c0f34
7 changed files with 61 additions and 12 deletions

View File

@ -31,9 +31,11 @@ public class Immunization30_40 {
if (src.hasStatus())
tgt.setStatusElement(convertImmunizationStatus(src.getStatusElement()));
if (src.hasNotGiven()) {
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Immunization.ImmunizationStatus> notDoneElement = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Immunization.ImmunizationStatusEnumFactory());
notDoneElement.setValue(Immunization.ImmunizationStatus.NOTDONE);
tgt.setStatusElement(notDoneElement);
if (src.getNotGiven()) {
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Immunization.ImmunizationStatus> notDoneElement = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Immunization.ImmunizationStatusEnumFactory());
notDoneElement.setValue(Immunization.ImmunizationStatus.NOTDONE);
tgt.setStatusElement(notDoneElement);
}
tgt.addExtension(getExtensionForNotGiven(src.getNotGiven()));
}
if (src.hasVaccineCode())

View File

@ -4,8 +4,6 @@ import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_40;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@ -21,7 +19,7 @@ public class Immunization30_40Test {
public static Stream<Arguments> getR4toDSTU3Arguments() {
return Stream.of(
Arguments.of("test1", "/immunization_40-not-done.json", "/immunization_30_completed_notGiven.json")
Arguments.of("test1", "/immunization_40_not-done.json", "/immunization_30_completed_notGiven.json")
);
}
@ParameterizedTest(name = "Test r4 -> dstu3 immunization conversions {0}")
@ -41,7 +39,8 @@ public class Immunization30_40Test {
public static Stream<Arguments> getDSTU3toR4Arguments() {
return Stream.of(
Arguments.of("test1", "/immunization_30_completed_notGiven.json", "/immunization_40-not-done-notGiven.json")
Arguments.of("test1", "/immunization_30_completed_notGiven.json", "/immunization_40_not-done_notGiven.json"),
Arguments.of("test2", "/immunization_30_completed.json", "/immunization_40_completed_given.json")
);
}
@ -60,9 +59,4 @@ public class Immunization30_40Test {
"Failed comparing\n" + r4_parser.composeString(r4_expected) + "\nand\n" + r4_parser.composeString(r4_conv));
}
@Test
@DisplayName("")
public void test3() throws IOException {
}
}

View File

@ -0,0 +1,24 @@
{
"resourceType": "Immunization",
"id": "notGiven",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">dummyDiv</div>"
},
"status": "completed",
"notGiven": false,
"vaccineCode": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/cvx",
"code": "01",
"display": "DTP"
}
]
},
"patient": {
"reference": "Patient/example"
},
"date": "2013-01-10",
"primarySource": true
}

View File

@ -0,0 +1,29 @@
{
"resourceType": "Immunization",
"id": "notGiven",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">dummyDiv</div>"
},
"status": "completed",
"extension":[
{
"url":"http://hl7.org/fhir/3.0/StructureDefinition/extension-Immunization.notGiven",
"valueBoolean":false
}
],
"vaccineCode": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/cvx",
"code": "01",
"display": "DTP"
}
]
},
"patient": {
"reference": "Patient/example"
},
"occurrenceDateTime": "2013-01-10",
"primarySource": true
}