Added unit test classes for TestPlan conversion

This commit is contained in:
Richard Ettema 2023-05-18 21:06:49 -04:00
parent e9c2a5f622
commit e6c1cd22f4
7 changed files with 200 additions and 43 deletions

View File

@ -147,7 +147,7 @@ public class TestPlan30_50 {
tgt.addContact(ContactDetail30_50.convertContactDetail((org.hl7.fhir.dstu3.model.ContactDetail) ext.getValue()));
}
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
tgt.setDescriptionElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext30_50.convertUsageContext((org.hl7.fhir.dstu3.model.UsageContext) ext.getValue()));
@ -368,11 +368,11 @@ public class TestPlan30_50 {
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content")) {
tgt.setContent(Reference30_50.convertReference((org.hl7.fhir.dstu3.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content").getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceString")) {
tgt.setSource(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceString").getValue()));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString")) {
tgt.setSource(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString").getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceReference")) {
tgt.setSource(Reference30_50.convertReference((org.hl7.fhir.dstu3.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceReference").getValue()));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference")) {
tgt.setSource(Reference30_50.convertReference((org.hl7.fhir.dstu3.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference").getValue()));
}
}
@ -477,7 +477,7 @@ public class TestPlan30_50 {
private static void convertTestPlanTestCaseTestRun(TestPlanTestCaseTestRunComponent src, Extension tgt) {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
if (src.hasNarrativeElement()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.narrative", MarkDown30_50.convertMarkdown(src.getNarrativeElement()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.narrative", MarkDown30_50.convertMarkdown(src.getNarrativeElement()));
}
if (src.hasScript()) {
org.hl7.fhir.dstu3.model.Extension tgte = new org.hl7.fhir.dstu3.model.Extension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script");
@ -489,29 +489,29 @@ public class TestPlan30_50 {
private static void convertTestPlanTestCaseTestRunScript(TestPlanTestCaseTestRunScriptComponent src, Extension tgt) {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
if (src.hasLanguage()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.language", CodeableConcept30_50.convertCodeableConcept(src.getLanguage()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.language", CodeableConcept30_50.convertCodeableConcept(src.getLanguage()));
}
if (src.hasSourceStringType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.sourceString", String30_50.convertString(src.getSourceStringType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.sourceString", String30_50.convertString(src.getSourceStringType()));
}
if (src.hasSourceReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.sourceReference", Reference30_50.convertReference(src.getSourceReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.sourceReference", Reference30_50.convertReference(src.getSourceReference()));
}
}
private static void convertTestPlanTestCaseTestData(TestPlanTestCaseTestDataComponent src, Extension tgt) {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
if (src.hasType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.type", Coding30_50.convertCoding(src.getType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.type", Coding30_50.convertCoding(src.getType()));
}
if (src.hasContent()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.content", Reference30_50.convertReference(src.getContent()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content", Reference30_50.convertReference(src.getContent()));
}
if (src.hasSourceStringType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.sourceString", String30_50.convertString(src.getSourceStringType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString", String30_50.convertString(src.getSourceStringType()));
}
if (src.hasSourceReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.sourceReference", Reference30_50.convertReference(src.getSourceReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference", Reference30_50.convertReference(src.getSourceReference()));
}
}
@ -535,20 +535,20 @@ public class TestPlan30_50 {
private static void convertTestPlanTestCaseAssertionObject(CodeableReference src, Extension tgt) {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
if (src.hasConcept()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.assertion.object.concept", CodeableConcept30_50.convertCodeableConcept(src.getConcept()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.assertion.object.concept", CodeableConcept30_50.convertCodeableConcept(src.getConcept()));
}
if (src.hasReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.assertion.object.reference", Reference30_50.convertReference(src.getReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.assertion.object.reference", Reference30_50.convertReference(src.getReference()));
}
}
private static void convertTestPlanTestCaseAssertionResult(CodeableReference src, Extension tgt) {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
if (src.hasConcept()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.assertion.result.concept", CodeableConcept30_50.convertCodeableConcept(src.getConcept()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.assertion.result.concept", CodeableConcept30_50.convertCodeableConcept(src.getConcept()));
}
if (src.hasReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.assertion.result.reference", Reference30_50.convertReference(src.getReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.assertion.result.reference", Reference30_50.convertReference(src.getReference()));
}
}

View File

@ -147,7 +147,7 @@ public class TestPlan40_50 {
tgt.addContact(ContactDetail40_50.convertContactDetail((org.hl7.fhir.r4.model.ContactDetail) ext.getValue()));
}
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
tgt.setDescriptionElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext40_50.convertUsageContext((org.hl7.fhir.r4.model.UsageContext) ext.getValue()));
@ -368,11 +368,11 @@ public class TestPlan40_50 {
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content")) {
tgt.setContent(Reference40_50.convertReference((org.hl7.fhir.r4.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content").getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceString")) {
tgt.setSource(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceString").getValue()));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString")) {
tgt.setSource(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString").getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceReference")) {
tgt.setSource(Reference40_50.convertReference((org.hl7.fhir.r4.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceReference").getValue()));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference")) {
tgt.setSource(Reference40_50.convertReference((org.hl7.fhir.r4.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference").getValue()));
}
}
@ -477,7 +477,7 @@ public class TestPlan40_50 {
private static void convertTestPlanTestCaseTestRun(TestPlanTestCaseTestRunComponent src, Extension tgt) {
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
if (src.hasNarrativeElement()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.narrative", MarkDown40_50.convertMarkdown(src.getNarrativeElement()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.narrative", MarkDown40_50.convertMarkdown(src.getNarrativeElement()));
}
if (src.hasScript()) {
org.hl7.fhir.r4.model.Extension tgte = new org.hl7.fhir.r4.model.Extension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script");
@ -489,29 +489,29 @@ public class TestPlan40_50 {
private static void convertTestPlanTestCaseTestRunScript(TestPlanTestCaseTestRunScriptComponent src, Extension tgt) {
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
if (src.hasLanguage()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.language", CodeableConcept40_50.convertCodeableConcept(src.getLanguage()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.language", CodeableConcept40_50.convertCodeableConcept(src.getLanguage()));
}
if (src.hasSourceStringType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.sourceString", String40_50.convertString(src.getSourceStringType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.sourceString", String40_50.convertString(src.getSourceStringType()));
}
if (src.hasSourceReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.sourceReference", Reference40_50.convertReference(src.getSourceReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.sourceReference", Reference40_50.convertReference(src.getSourceReference()));
}
}
private static void convertTestPlanTestCaseTestData(TestPlanTestCaseTestDataComponent src, Extension tgt) {
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
if (src.hasType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.type", Coding40_50.convertCoding(src.getType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.type", Coding40_50.convertCoding(src.getType()));
}
if (src.hasContent()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.content", Reference40_50.convertReference(src.getContent()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content", Reference40_50.convertReference(src.getContent()));
}
if (src.hasSourceStringType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.sourceString", String40_50.convertString(src.getSourceStringType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString", String40_50.convertString(src.getSourceStringType()));
}
if (src.hasSourceReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.sourceReference", Reference40_50.convertReference(src.getSourceReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference", Reference40_50.convertReference(src.getSourceReference()));
}
}

View File

@ -147,7 +147,7 @@ public class TestPlan43_50 {
tgt.addContact(ContactDetail43_50.convertContactDetail((org.hl7.fhir.r4b.model.ContactDetail) ext.getValue()));
}
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext43_50.convertUsageContext((org.hl7.fhir.r4b.model.UsageContext) ext.getValue()));
@ -368,11 +368,11 @@ public class TestPlan43_50 {
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content")) {
tgt.setContent(Reference43_50.convertReference((org.hl7.fhir.r4b.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content").getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceString")) {
tgt.setSource(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceString").getValue()));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString")) {
tgt.setSource(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString").getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceReference")) {
tgt.setSource(Reference43_50.convertReference((org.hl7.fhir.r4b.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.script.sourceReference").getValue()));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference")) {
tgt.setSource(Reference43_50.convertReference((org.hl7.fhir.r4b.model.Reference) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference").getValue()));
}
}
@ -477,7 +477,7 @@ public class TestPlan43_50 {
private static void convertTestPlanTestCaseTestRun(TestPlanTestCaseTestRunComponent src, Extension tgt) {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasNarrativeElement()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.narrative", MarkDown43_50.convertMarkdown(src.getNarrativeElement()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.narrative", MarkDown43_50.convertMarkdown(src.getNarrativeElement()));
}
if (src.hasScript()) {
org.hl7.fhir.r4b.model.Extension tgte = new org.hl7.fhir.r4b.model.Extension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script");
@ -489,29 +489,29 @@ public class TestPlan43_50 {
private static void convertTestPlanTestCaseTestRunScript(TestPlanTestCaseTestRunScriptComponent src, Extension tgt) {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasLanguage()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.language", CodeableConcept43_50.convertCodeableConcept(src.getLanguage()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.language", CodeableConcept43_50.convertCodeableConcept(src.getLanguage()));
}
if (src.hasSourceStringType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.sourceString", String43_50.convertString(src.getSourceStringType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.sourceString", String43_50.convertString(src.getSourceStringType()));
}
if (src.hasSourceReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.script.sourceReference", Reference43_50.convertReference(src.getSourceReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testRun.script.sourceReference", Reference43_50.convertReference(src.getSourceReference()));
}
}
private static void convertTestPlanTestCaseTestData(TestPlanTestCaseTestDataComponent src, Extension tgt) {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.type", Coding43_50.convertCoding(src.getType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.type", Coding43_50.convertCoding(src.getType()));
}
if (src.hasContent()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.content", Reference43_50.convertReference(src.getContent()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.content", Reference43_50.convertReference(src.getContent()));
}
if (src.hasSourceStringType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.sourceString", String43_50.convertString(src.getSourceStringType()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceString", String43_50.convertString(src.getSourceStringType()));
}
if (src.hasSourceReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testCase.testRun.testData.sourceReference", Reference43_50.convertReference(src.getSourceReference()));
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestPlan.testCase.testData.sourceReference", Reference43_50.convertReference(src.getSourceReference()));
}
}

View File

@ -0,0 +1,34 @@
package org.hl7.fhir.convertors.conv30_50;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
public class TestPlan30_50Test {
@Test
@DisplayName("Test r5 -> dstu3 TestPlan conversion.")
public void testR5_dstu3() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/testplan_50_example.json");
org.hl7.fhir.r5.model.TestPlan r5_actual = (org.hl7.fhir.r5.model.TestPlan) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
org.hl7.fhir.dstu3.model.Resource dstu3_conv = VersionConvertorFactory_30_50.convertResource(r5_actual);
org.hl7.fhir.dstu3.formats.XmlParser r4_parser = new org.hl7.fhir.dstu3.formats.XmlParser();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
r4_parser.compose(stream, dstu3_conv);
org.hl7.fhir.dstu3.model.Resource dstu3_streamed = (org.hl7.fhir.dstu3.model.Basic) new org.hl7.fhir.dstu3.formats.XmlParser().parse(new ByteArrayInputStream(stream.toByteArray()));
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_30_50.convertResource(dstu3_streamed);
assertTrue(r5_actual.equalsDeep(r5_conv), "should be the same");
}
}

View File

@ -0,0 +1,34 @@
package org.hl7.fhir.convertors.conv40_50;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
public class TestPlan40_50Test {
@Test
@DisplayName("Test r5 -> r4 TestPlan conversion.")
public void testR5_R4() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/testplan_50_example.json");
org.hl7.fhir.r5.model.TestPlan r5_actual = (org.hl7.fhir.r5.model.TestPlan) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
org.hl7.fhir.r4.model.Resource r4_conv = VersionConvertorFactory_40_50.convertResource(r5_actual);
org.hl7.fhir.r4.formats.XmlParser r4_parser = new org.hl7.fhir.r4.formats.XmlParser();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
r4_parser.compose(stream, r4_conv);
org.hl7.fhir.r4.model.Resource r4_streamed = (org.hl7.fhir.r4.model.Basic) new org.hl7.fhir.r4.formats.XmlParser().parse(new ByteArrayInputStream(stream.toByteArray()));
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_40_50.convertResource(r4_streamed);
assertTrue(r5_actual.equalsDeep(r5_conv), "should be the same");
}
}

View File

@ -0,0 +1,35 @@
package org.hl7.fhir.convertors.conv43_50;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_43_50;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
public class TestPlan43_50Test {
@Test
@DisplayName("Test r5 -> r4 TestPlan conversion.")
public void testR5_R4() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/testplan_50_example.json");
org.hl7.fhir.r5.model.TestPlan r5_actual = (org.hl7.fhir.r5.model.TestPlan) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
org.hl7.fhir.r4b.model.Resource r4_conv = VersionConvertorFactory_43_50.convertResource(r5_actual);
org.hl7.fhir.r4b.formats.XmlParser r4_parser = new org.hl7.fhir.r4b.formats.XmlParser();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
r4_parser.compose(stream, r4_conv);
org.hl7.fhir.r4b.model.Resource r4_streamed = (org.hl7.fhir.r4b.model.Basic) new org.hl7.fhir.r4b.formats.XmlParser().parse(new ByteArrayInputStream(stream.toByteArray()));
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_43_50.convertResource(r4_streamed);
assertTrue(r5_actual.equalsDeep(r5_conv), "should be the same");
}
}

View File

@ -0,0 +1,54 @@
{
"resourceType": "TestPlan",
"id": "example1",
"url": "http://hl7.org/fhir/TestPlan/example1",
"name": "ExampleTestPlan1",
"title": "Example TestPlan 1",
"date": "2023-05-17T23:02:30.239Z",
"description": "Example TestPlan for testing",
"status": "active",
"publisher": "Health Level 7 (HL7) International",
"category": [
{
"coding": [
{
"system": "http://hl7.org/fhir/testscript-scope-phase-codes",
"code": "integration"
}
]
}
],
"testCase": [
{
"sequence": 1,
"testRun": [
{
"narrative": "Read JSON formatted Observation and validate against the Dev Satisfaction IG",
"script": {
"language": {
"coding": [
{
"system": "http://example.org/fhir/testplan/language",
"code": "testscript"
}
]
},
"sourceString": "http://hl7.org/fhir/TestScript/example1"
}
}
],
"testData": [
{
"type": {
"system": "http://example.org/fhir/testplan/testData-type",
"code": "example"
},
"content": {
"reference": "Observation/example1"
},
"sourceString": "http://hl7.org/fhir/Observation/example1"
}
]
}
]
}