Remake example scenario changes
This commit is contained in:
parent
95d30dee24
commit
3acfd8a879
|
@ -2,16 +2,15 @@ package org.hl7.fhir.convertors.conv40_50.resources40_50;
|
|||
|
||||
import org.hl7.fhir.convertors.context.ConversionContext40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Coding40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.ContactDetail40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.UsageContext40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.MarkDown40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType;
|
||||
import org.hl7.fhir.r4.model.StringType;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
|
@ -43,20 +42,40 @@ import org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType;
|
|||
*/
|
||||
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
|
||||
public class ExampleScenario40_50 {
|
||||
private static final String VERSION_ALGORITHM = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.versionAlgorithm";
|
||||
private static final String TITLE = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.title";
|
||||
private static final String DESCRIPTION = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.description";
|
||||
private static final String COPYRIGHT_LABEL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.copyrightLabel";
|
||||
private static final String WORKFLOW = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.workflow";
|
||||
private static final String INSTANCE_STRUCTURE_VERSION = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.instance.structureVersion";
|
||||
private static final String INSTANCE_STRUCTURE_PROFILE = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.instance.structureProfile";
|
||||
private static final String INSTANCE_CONTENT = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.instance.content";
|
||||
private static final String INSTANCE_VERSION_TITLE = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.instance.version.title";
|
||||
private static final String INSTANCE_VERSION_CONTENT = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.instance.version.content";
|
||||
private static final String PROCESS_STEP_NUMBER = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.process.step.number";
|
||||
private static final String PROCESS_STEP_WORKFLOW = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ExampleScenario.process.step.workflow";
|
||||
|
||||
public static org.hl7.fhir.r5.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r4.model.ExampleScenario src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.ExampleScenario tgt = new org.hl7.fhir.r5.model.ExampleScenario();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt, VERSION_ALGORITHM, TITLE, DESCRIPTION, COPYRIGHT_LABEL);
|
||||
if (src.hasUrl())
|
||||
tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
|
||||
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
if (src.hasVersion())
|
||||
tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
if (src.hasExtension(VERSION_ALGORITHM)) {
|
||||
if (src.getExtensionByUrl(VERSION_ALGORITHM).getValue() instanceof org.hl7.fhir.r4.model.StringType)
|
||||
tgt.setVersionAlgorithm(String40_50.convertString((org.hl7.fhir.r4.model.StringType)src.getExtensionByUrl(VERSION_ALGORITHM).getValue()));
|
||||
else
|
||||
tgt.setVersionAlgorithm(Coding40_50.convertCoding((org.hl7.fhir.r4.model.Coding)src.getExtensionByUrl(VERSION_ALGORITHM).getValue()));
|
||||
}
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasExtension(TITLE))
|
||||
tgt.setTitleElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType)src.getExtensionByUrl(TITLE).getValue()));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement()));
|
||||
if (src.hasExperimental())
|
||||
|
@ -67,12 +86,16 @@ public class ExampleScenario40_50 {
|
|||
tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement()));
|
||||
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
|
||||
tgt.addContact(ContactDetail40_50.convertContactDetail(t));
|
||||
if (src.hasExtension(DESCRIPTION))
|
||||
tgt.setDescriptionElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType)src.getExtensionByUrl(DESCRIPTION).getValue()));
|
||||
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
|
||||
tgt.addUseContext(UsageContext40_50.convertUsageContext(t));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
|
||||
tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasCopyright())
|
||||
tgt.setCopyrightElement(MarkDown40_50.convertMarkdown(src.getCopyrightElement()));
|
||||
if (src.hasExtension(COPYRIGHT_LABEL))
|
||||
tgt.setCopyrightLabelElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType)src.getExtensionByUrl(COPYRIGHT_LABEL).getValue()));
|
||||
if (src.hasPurpose())
|
||||
tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement()));
|
||||
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor())
|
||||
|
@ -81,8 +104,8 @@ public class ExampleScenario40_50 {
|
|||
tgt.addInstance(convertExampleScenarioInstanceComponent(t));
|
||||
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess())
|
||||
tgt.addProcess(convertExampleScenarioProcessComponent(t));
|
||||
// for (org.hl7.fhir.r4.model.CanonicalType t : src.getWorkflow())
|
||||
// tgt.getWorkflow().add(Canonical40_50.convertCanonical(t));
|
||||
for (org.hl7.fhir.r4.model.CanonicalType t : src.getWorkflow())
|
||||
tgt.addExtension(WORKFLOW, Canonical40_50.convertCanonical(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -90,7 +113,13 @@ public class ExampleScenario40_50 {
|
|||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.ExampleScenario tgt = new org.hl7.fhir.r4.model.ExampleScenario();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt, WORKFLOW);
|
||||
if (src.hasVersionAlgorithm()) {
|
||||
if (src.getVersionAlgorithm() instanceof org.hl7.fhir.r5.model.StringType)
|
||||
tgt.addExtension(VERSION_ALGORITHM, String40_50.convertString((org.hl7.fhir.r5.model.StringType)src.getVersionAlgorithm()));
|
||||
else
|
||||
tgt.addExtension(VERSION_ALGORITHM, Coding40_50.convertCoding((org.hl7.fhir.r5.model.Coding)src.getVersionAlgorithm()));
|
||||
}
|
||||
if (src.hasUrl())
|
||||
tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
|
||||
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
|
||||
|
@ -99,6 +128,8 @@ public class ExampleScenario40_50 {
|
|||
tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasTitle())
|
||||
tgt.addExtension(TITLE, String40_50.convertString(src.getTitleElement()));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement()));
|
||||
if (src.hasExperimental())
|
||||
|
@ -109,12 +140,16 @@ public class ExampleScenario40_50 {
|
|||
tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement()));
|
||||
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
|
||||
tgt.addContact(ContactDetail40_50.convertContactDetail(t));
|
||||
if (src.hasDescription())
|
||||
tgt.addExtension(DESCRIPTION, MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
|
||||
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
|
||||
tgt.addUseContext(UsageContext40_50.convertUsageContext(t));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
|
||||
tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasCopyright())
|
||||
tgt.setCopyrightElement(MarkDown40_50.convertMarkdown(src.getCopyrightElement()));
|
||||
if (src.hasCopyrightLabel())
|
||||
tgt.addExtension(COPYRIGHT_LABEL, String40_50.convertString(src.getCopyrightLabelElement()));
|
||||
if (src.hasPurpose())
|
||||
tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement()));
|
||||
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor())
|
||||
|
@ -123,8 +158,9 @@ public class ExampleScenario40_50 {
|
|||
tgt.addInstance(convertExampleScenarioInstanceComponent(t));
|
||||
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess())
|
||||
tgt.addProcess(convertExampleScenarioProcessComponent(t));
|
||||
// for (org.hl7.fhir.r5.model.CanonicalType t : src.getWorkflow())
|
||||
// tgt.getWorkflow().add(Canonical40_50.convertCanonical(t));
|
||||
for (org.hl7.fhir.r5.model.Extension e : src.getExtensionsByUrl(WORKFLOW))
|
||||
tgt.getWorkflow().add(Canonical40_50.convertCanonical(e.getValueCanonicalType()));
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -202,15 +238,27 @@ public class ExampleScenario40_50 {
|
|||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt, INSTANCE_STRUCTURE_VERSION, INSTANCE_STRUCTURE_PROFILE, INSTANCE_CONTENT);
|
||||
if (src.hasResourceId())
|
||||
tgt.setKeyElement(String40_50.convertString(src.getResourceIdElement()));
|
||||
if (src.hasResourceType())
|
||||
if (src.hasResourceType()) {
|
||||
tgt.getStructureType().setCode(src.getResourceType().toCode());
|
||||
tgt.getStructureType().setSystem("http://hl7.org/fhir/fhir-types");
|
||||
}
|
||||
if (src.hasExtension(INSTANCE_STRUCTURE_VERSION))
|
||||
tgt.setStructureVersionElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType)src.getExtensionByUrl(INSTANCE_STRUCTURE_VERSION).getValue()));
|
||||
if (src.hasExtension(INSTANCE_STRUCTURE_PROFILE)) {
|
||||
if (src.getExtensionByUrl(INSTANCE_STRUCTURE_PROFILE).getValue() instanceof org.hl7.fhir.r4.model.CanonicalType)
|
||||
tgt.setStructureProfile(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType)src.getExtensionByUrl(INSTANCE_STRUCTURE_PROFILE).getValue()));
|
||||
else
|
||||
tgt.setStructureProfile(Uri40_50.convertUri((org.hl7.fhir.r4.model.UriType)src.getExtensionByUrl(INSTANCE_STRUCTURE_PROFILE).getValue()));
|
||||
}
|
||||
if (src.hasName())
|
||||
tgt.setTitleElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
|
||||
if (src.hasExtension(INSTANCE_CONTENT))
|
||||
tgt.setContent(Reference40_50.convertReference((org.hl7.fhir.r4.model.Reference)src.getExtensionByUrl(INSTANCE_CONTENT).getValue()));
|
||||
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion())
|
||||
tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t));
|
||||
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance())
|
||||
|
@ -223,9 +271,19 @@ public class ExampleScenario40_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
if (src.hasStructureVersion())
|
||||
tgt.addExtension(INSTANCE_STRUCTURE_VERSION, String40_50.convertString(src.getStructureVersionElement()));
|
||||
if (src.hasStructureProfile()) {
|
||||
if (src.getStructureProfile() instanceof org.hl7.fhir.r5.model.CanonicalType)
|
||||
tgt.addExtension(INSTANCE_STRUCTURE_PROFILE, Canonical40_50.convertCanonical((org.hl7.fhir.r5.model.CanonicalType)src.getStructureProfile()));
|
||||
else
|
||||
tgt.addExtension(INSTANCE_STRUCTURE_PROFILE, Uri40_50.convertUri((org.hl7.fhir.r5.model.UriType)src.getStructureProfile()));
|
||||
}
|
||||
if (src.hasContent())
|
||||
tgt.addExtension(INSTANCE_CONTENT, Reference40_50.convertReference(src.getContent()));
|
||||
if (src.hasKey())
|
||||
tgt.setResourceIdElement(String40_50.convertString(src.getKeyElement()));
|
||||
if (src.hasType())
|
||||
if (src.hasStructureType())
|
||||
tgt.setResourceType(FHIRResourceType.fromCode(src.getStructureType().getCode()));
|
||||
if (src.hasTitle())
|
||||
tgt.setNameElement(String40_50.convertString(src.getTitleElement()));
|
||||
|
@ -258,11 +316,15 @@ public class ExampleScenario40_50 {
|
|||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt, INSTANCE_VERSION_TITLE, INSTANCE_VERSION_CONTENT);
|
||||
if (src.hasVersionId())
|
||||
tgt.setKeyElement(String40_50.convertString(src.getVersionIdElement()));
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
|
||||
if (src.hasExtension(INSTANCE_VERSION_TITLE))
|
||||
tgt.setTitleElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(INSTANCE_VERSION_TITLE).getValue()));
|
||||
if (src.hasExtension(INSTANCE_VERSION_CONTENT))
|
||||
tgt.setContent(Reference40_50.convertReference((org.hl7.fhir.r4.model.Reference) src.getExtensionByUrl(INSTANCE_VERSION_CONTENT).getValue()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -275,6 +337,10 @@ public class ExampleScenario40_50 {
|
|||
tgt.setVersionIdElement(String40_50.convertString(src.getKeyElement()));
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
|
||||
if (src.hasTitle())
|
||||
tgt.addExtension(INSTANCE_VERSION_TITLE, String40_50.convertString(src.getTitleElement()));
|
||||
if (src.hasContent())
|
||||
tgt.addExtension(INSTANCE_VERSION_CONTENT, Reference40_50.convertReference(src.getContent()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -342,9 +408,16 @@ public class ExampleScenario40_50 {
|
|||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt, PROCESS_STEP_NUMBER, PROCESS_STEP_WORKFLOW);
|
||||
if (src.hasOperation())
|
||||
tgt.setNumberElement(String40_50.convertString(src.getOperation().getNumberElement()));
|
||||
else if (src.hasExtension(PROCESS_STEP_NUMBER))
|
||||
tgt.setNumberElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType)src.getExtensionByUrl(PROCESS_STEP_NUMBER).getValue()));
|
||||
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess())
|
||||
tgt.setProcess(convertExampleScenarioProcessComponent(t));
|
||||
if (src.hasExtension(PROCESS_STEP_WORKFLOW))
|
||||
tgt.setWorkflowElement(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType)src.getExtensionByUrl(PROCESS_STEP_WORKFLOW).getValue()));
|
||||
|
||||
if (src.hasPause())
|
||||
tgt.setPauseElement(Boolean40_50.convertBoolean(src.getPauseElement()));
|
||||
if (src.hasOperation())
|
||||
|
@ -359,11 +432,17 @@ public class ExampleScenario40_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
tgt.addProcess(convertExampleScenarioProcessComponent(src.getProcess()));
|
||||
|
||||
if (src.hasProcess())
|
||||
tgt.addProcess(convertExampleScenarioProcessComponent(src.getProcess()));
|
||||
if (src.hasWorkflow())
|
||||
tgt.addExtension(PROCESS_STEP_WORKFLOW, Canonical40_50.convertCanonical(src.getWorkflowElement()));
|
||||
if (src.hasPause())
|
||||
tgt.setPauseElement(Boolean40_50.convertBoolean(src.getPauseElement()));
|
||||
if (src.hasOperation())
|
||||
tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation()));
|
||||
tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation(), src.getNumber()));
|
||||
else
|
||||
tgt.addExtension(PROCESS_STEP_NUMBER, String40_50.convertString(src.getNumberElement()));
|
||||
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative())
|
||||
tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t));
|
||||
return tgt;
|
||||
|
@ -376,8 +455,10 @@ public class ExampleScenario40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
// if (src.hasNumber())
|
||||
// tgt.setNumberElement(String40_50.convertString(src.getNumberElement()));
|
||||
if (src.hasType())
|
||||
if (src.hasType()) {
|
||||
tgt.getType().setSystem("http://hl7.org/fhir/restful-interaction");
|
||||
tgt.getType().setCode(src.getType());
|
||||
}
|
||||
if (src.hasName())
|
||||
tgt.setTitleElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasInitiator())
|
||||
|
@ -397,13 +478,15 @@ public class ExampleScenario40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException {
|
||||
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src, String stepPosition) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
// if (src.hasNumber())
|
||||
// tgt.setNumberElement(String40_50.convertString(src.getNumberElement()));
|
||||
if (src.hasExtension("http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.number"))
|
||||
tgt.setNumber(src.getExtensionByUrl("http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.number").getValueStringType().toString());
|
||||
else
|
||||
tgt.setNumber(stepPosition);
|
||||
if (src.hasType())
|
||||
tgt.setType(src.getType().getCode());
|
||||
if (src.hasTitle())
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package org.hl7.fhir.convertors.conv40_50;
|
||||
|
||||
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class ExampleScenario40_50Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Test r5 -> r4 ExampleScenario conversion.")
|
||||
public void testR5_R4() throws IOException {
|
||||
InputStream r5_input = this.getClass().getResourceAsStream("/example_scenario_50.xml");
|
||||
|
||||
org.hl7.fhir.r5.model.ExampleScenario r5_actual = (org.hl7.fhir.r5.model.ExampleScenario) new org.hl7.fhir.r5.formats.XmlParser().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.ExampleScenario) 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");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,263 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ExampleScenario xmlns="http://hl7.org/fhir">
|
||||
<id value="example"/>
|
||||
<text>
|
||||
<status value="additional"/>
|
||||
<div xmlns="http://www.w3.org/1999/xhtml">Stuff</div>
|
||||
</text>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<url value="http://example.org/ExampleScenario/test"/>
|
||||
<identifier>
|
||||
<system value="http://example.org/NamingSystem/someid"/>
|
||||
<value value="123"/>
|
||||
</identifier>
|
||||
<identifier>
|
||||
<system value="http://example.org/NamingSystem/someid"/>
|
||||
<value value="456"/>
|
||||
</identifier>
|
||||
<version value="1.0"/>
|
||||
<versionAlgorithmCoding>
|
||||
<system value="http://hl7.org/fhir/version-algorithm"/>
|
||||
<code value="semver"/>
|
||||
</versionAlgorithmCoding>
|
||||
<name value="TestScenario"/>
|
||||
<title value="Test Scenario"/>
|
||||
<status value="draft"/>
|
||||
<experimental value="true"/>
|
||||
<date value="2023-07-13"/>
|
||||
<publisher value="HL7"/>
|
||||
<contact>
|
||||
<name value="Admin"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<name value="Other Admin"/>
|
||||
</contact>
|
||||
<description value="Fully populated instance to test conversion"/>
|
||||
<useContext>
|
||||
<code>
|
||||
<system value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
|
||||
<code value="gender"/>
|
||||
</code>
|
||||
<valueCodeableConcept>
|
||||
<text value="male"/>
|
||||
</valueCodeableConcept>
|
||||
</useContext>
|
||||
<useContext>
|
||||
<code>
|
||||
<system value="http://terminology.hl7.org/CodeSystem/usage-context-type"/>
|
||||
<code value="gender"/>
|
||||
</code>
|
||||
<valueCodeableConcept>
|
||||
<text value="other"/>
|
||||
</valueCodeableConcept>
|
||||
</useContext>
|
||||
<jurisdiction>
|
||||
<text value="Everything"/>
|
||||
</jurisdiction>
|
||||
<jurisdiction>
|
||||
<text value="Everywhere"/>
|
||||
</jurisdiction>
|
||||
<purpose value="Purpose: this serves to demonstrate the performing of medication administration, by using remote / mobile devices to a) Get the planned medication administrations and b) Record the performing of these administrations without a permanent connection to the EHR."/>
|
||||
<copyright value="Legalese"/>
|
||||
<copyrightLabel value="Short Legalese"/>
|
||||
<actor>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<key value="Nurse"/>
|
||||
<type value="person"/>
|
||||
<title value="Nurse"/>
|
||||
<description value="The Nurse"/>
|
||||
</actor>
|
||||
<actor>
|
||||
<key value="MAP"/>
|
||||
<type value="system"/>
|
||||
<title value="Nurse's Tablet"/>
|
||||
<description value="The entity that receives the Administration Requests to show the nurse to perform them"/>
|
||||
</actor>
|
||||
<instance>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<key value="iherx001"/>
|
||||
<structureType>
|
||||
<system value="http://hl7.org/fhir/fhir-types"/>
|
||||
<code value="MedicationRequest"/>
|
||||
</structureType>
|
||||
<structureVersion value="5.0.0"/>
|
||||
<structureProfileCanonical value="http://example.org/StructureDefinition/someProfile"/>
|
||||
<title value="Initial Prescription"/>
|
||||
<description value="The initial prescription which describes "medication X, 3 times per day" - the exact scheduling is not in the initial prescription (it is left for the care teams to decide on the schedule)."/>
|
||||
<version>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<key value="iherx001v1"/>
|
||||
<title value="Initial Prescription v1"/>
|
||||
<description value="Initial version"/>
|
||||
<content>
|
||||
<reference value="http://example.org/MedicationRequest/someResource2"/>
|
||||
</content>
|
||||
</version>
|
||||
<version>
|
||||
<key value="iherx001v2"/>
|
||||
<title value="Initial Prescription v2"/>
|
||||
<description value="Second version"/>
|
||||
<content>
|
||||
<reference value="http://example.org/MedicationRequest/someResource3"/>
|
||||
</content>
|
||||
</version>
|
||||
</instance>
|
||||
<instance>
|
||||
<key value="iherx001.001"/>
|
||||
<structureType>
|
||||
<system value="http://hl7.org/fhir/fhir-types"/>
|
||||
<code value="MedicationRequest"/>
|
||||
</structureType>
|
||||
<title value="Request for day 1, morning"/>
|
||||
<content>
|
||||
<reference value="http://example.org/MedicationRequest/someResource"/>
|
||||
</content>
|
||||
<containedInstance>
|
||||
<instanceReference value="iherx001"/>
|
||||
<versionReference value="iherx001v1"/>
|
||||
</containedInstance>
|
||||
<containedInstance>
|
||||
<instanceReference value="iherx001"/>
|
||||
<versionReference value="iherx001v2"/>
|
||||
</containedInstance>
|
||||
</instance>
|
||||
<process>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<title value="Mobile Medication Administration"/>
|
||||
<description value="This scenario demonstrates the process of getting the relevant medication instructions for a patient visit and reporting the results of administration. The scenario is as follows: After the prescription is issued, the institution schedules each individual administration event in the Medication Administration Record (MAR). When preparing for a visit, the nurse queries the MAR for the scheduled administrations, obtaining a bundle of records. The nurse then performs the care activities and registers the results in the device. Upon synchronization of the device and the institution, the results of administration are uploaded to the EHR, thus updating the MAR."/>
|
||||
<preConditions value="Medication administration requests are in the EHR / MAR, scheduled for each individual intake."/>
|
||||
<postConditions value="Medication administration Reports are submitted, EHR is updated."/>
|
||||
<step>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<number value="1"/>
|
||||
<workflow value="http://example.org/ExampleScenario/another-one"/>
|
||||
<alternative>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<title value="A different way"/>
|
||||
<description value="Explanation of a different way"/>
|
||||
<step>
|
||||
<number value="1.A.1"/>
|
||||
<process>
|
||||
<title value="Process title"/>
|
||||
<description value="Process description"/>
|
||||
<preConditions value="What should come before"/>
|
||||
<postConditions value="What will be true after"/>
|
||||
<step>
|
||||
<number value="1.A.1.1"/>
|
||||
<operation>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<type>
|
||||
<system value="http://hl7.org/fhir/restful-interaction"/>
|
||||
<code value="read"/>
|
||||
</type>
|
||||
<title value="Some title"/>
|
||||
<initiator value="Nurse"/>
|
||||
<receiver value="MAP"/>
|
||||
<description value="Some description"/>
|
||||
<initiatorActive value="true"/>
|
||||
<receiverActive value="false"/>
|
||||
<request>
|
||||
<instanceReference value="iherx001"/>
|
||||
<versionReference value="iherx001v1"/>
|
||||
</request>
|
||||
<response>
|
||||
<instanceReference value="iherx001"/>
|
||||
<versionReference value="iherx001v2"/>
|
||||
</response>
|
||||
</operation>
|
||||
</step>
|
||||
<step>
|
||||
<number value="1.A.1.2"/>
|
||||
<operation>
|
||||
<extension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</extension>
|
||||
<modifierExtension url="http://example.org/StructureDefinition/someExtension">
|
||||
<valueBoolean value="true"/>
|
||||
</modifierExtension>
|
||||
<type>
|
||||
<system value="http://hl7.org/fhir/restful-interaction"/>
|
||||
<code value="create"/>
|
||||
</type>
|
||||
<title value="Some title 2"/>
|
||||
<initiator value="MAP"/>
|
||||
<receiver value="Nurse"/>
|
||||
<description value="Some description 2"/>
|
||||
<initiatorActive value="false"/>
|
||||
<receiverActive value="true"/>
|
||||
<request>
|
||||
<instanceReference value="iherx001"/>
|
||||
<versionReference value="iherx001v1"/>
|
||||
</request>
|
||||
<response>
|
||||
<instanceReference value="iherx001"/>
|
||||
<versionReference value="iherx001v2"/>
|
||||
</response>
|
||||
</operation>
|
||||
<alternative>
|
||||
<title value="Another alternative"/>
|
||||
</alternative>
|
||||
</step>
|
||||
</process>
|
||||
</step>
|
||||
</alternative>
|
||||
<pause value="true"/>
|
||||
</step>
|
||||
<step>
|
||||
<number value="2"/>
|
||||
<operation>
|
||||
<title value="Query administration orders"/>
|
||||
<initiator value="MAP"/>
|
||||
<receiver value="Nurse"/>
|
||||
<description value="Query for medication administration orders,\n- For today's shifts\n- For today's patients"/>
|
||||
<request>
|
||||
<instanceReference value="iherx001.001"/>
|
||||
</request>
|
||||
<response>
|
||||
<instanceReference value="iherx001.001"/>
|
||||
</response>
|
||||
</operation>
|
||||
<pause value="true"/>
|
||||
</step>
|
||||
</process>
|
||||
</ExampleScenario>
|
Loading…
Reference in New Issue