Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f3182b9781
|
@ -31,7 +31,10 @@ public class BaseAdvisor_43_50 extends BaseAdvisor50<org.hl7.fhir.r4b.model.Exte
|
||||||
return true;
|
return true;
|
||||||
} else if (lastPath.equals("Basic") && url.startsWith("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.")) {
|
} else if (lastPath.equals("Basic") && url.startsWith("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.")) {
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else if (lastPath.equals("SubscriptionTopic") && url.startsWith("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
|
||||||
|
|
||||||
|
import org.hl7.fhir.convertors.context.ConversionContext10_50;
|
||||||
|
import org.hl7.fhir.convertors.context.ConversionContext43_50;
|
||||||
|
import org.hl7.fhir.exceptions.FHIRException;
|
||||||
|
|
||||||
|
public class Integer64_43_50 {
|
||||||
|
public static org.hl7.fhir.r5.model.Integer64Type convertStringToInteger64(org.hl7.fhir.r4b.model.StringType src) throws FHIRException {
|
||||||
|
org.hl7.fhir.r5.model.Integer64Type tgt = src.hasValue() ? new org.hl7.fhir.r5.model.Integer64Type(src.getValueAsString()) : new org.hl7.fhir.r5.model.Integer64Type();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static org.hl7.fhir.r4b.model.StringType convertInteger64ToString(org.hl7.fhir.r5.model.Integer64Type src) throws FHIRException {
|
||||||
|
org.hl7.fhir.r4b.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.StringType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.StringType();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
}
|
|
@ -244,6 +244,10 @@ public class Resource43_50 {
|
||||||
return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r4b.model.StructureDefinition) src);
|
return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r4b.model.StructureDefinition) src);
|
||||||
if (src instanceof org.hl7.fhir.r4b.model.StructureMap)
|
if (src instanceof org.hl7.fhir.r4b.model.StructureMap)
|
||||||
return StructureMap43_50.convertStructureMap((org.hl7.fhir.r4b.model.StructureMap) src);
|
return StructureMap43_50.convertStructureMap((org.hl7.fhir.r4b.model.StructureMap) src);
|
||||||
|
if (src instanceof org.hl7.fhir.r4b.model.SubscriptionStatus)
|
||||||
|
return SubscriptionStatus43_50.convertSubscriptionStatus((org.hl7.fhir.r4b.model.SubscriptionStatus)src);
|
||||||
|
if (src instanceof org.hl7.fhir.r4b.model.SubscriptionTopic)
|
||||||
|
return SubscriptionTopic43_50.convertSubscriptionTopic((org.hl7.fhir.r4b.model.SubscriptionTopic)src);
|
||||||
if (src instanceof org.hl7.fhir.r4b.model.Substance)
|
if (src instanceof org.hl7.fhir.r4b.model.Substance)
|
||||||
return Substance43_50.convertSubstance((org.hl7.fhir.r4b.model.Substance) src);
|
return Substance43_50.convertSubstance((org.hl7.fhir.r4b.model.Substance) src);
|
||||||
if (src instanceof org.hl7.fhir.r4b.model.SupplyDelivery)
|
if (src instanceof org.hl7.fhir.r4b.model.SupplyDelivery)
|
||||||
|
@ -478,6 +482,10 @@ public class Resource43_50 {
|
||||||
return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r5.model.StructureDefinition) src);
|
return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r5.model.StructureDefinition) src);
|
||||||
if (src instanceof org.hl7.fhir.r5.model.StructureMap)
|
if (src instanceof org.hl7.fhir.r5.model.StructureMap)
|
||||||
return StructureMap43_50.convertStructureMap((org.hl7.fhir.r5.model.StructureMap) src);
|
return StructureMap43_50.convertStructureMap((org.hl7.fhir.r5.model.StructureMap) src);
|
||||||
|
if (src instanceof org.hl7.fhir.r5.model.SubscriptionStatus)
|
||||||
|
return SubscriptionStatus43_50.convertSubscriptionStatus((org.hl7.fhir.r5.model.SubscriptionStatus)src);
|
||||||
|
if (src instanceof org.hl7.fhir.r5.model.SubscriptionTopic)
|
||||||
|
return SubscriptionTopic43_50.convertSubscriptionTopic((org.hl7.fhir.r5.model.SubscriptionTopic)src);
|
||||||
if (src instanceof org.hl7.fhir.r5.model.Substance)
|
if (src instanceof org.hl7.fhir.r5.model.Substance)
|
||||||
return Substance43_50.convertSubstance((org.hl7.fhir.r5.model.Substance) src);
|
return Substance43_50.convertSubstance((org.hl7.fhir.r5.model.Substance) src);
|
||||||
if (src instanceof org.hl7.fhir.r5.model.SupplyDelivery)
|
if (src instanceof org.hl7.fhir.r5.model.SupplyDelivery)
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
package org.hl7.fhir.convertors.conv43_50.resources43_50;
|
||||||
|
|
||||||
|
import org.hl7.fhir.convertors.context.ConversionContext43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
|
||||||
|
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer64_43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
|
||||||
|
|
||||||
|
public class SubscriptionStatus43_50 {
|
||||||
|
public static org.hl7.fhir.r4b.model.SubscriptionStatus convertSubscriptionStatus(org.hl7.fhir.r5.model.SubscriptionStatus src) {
|
||||||
|
if (src == null)
|
||||||
|
return null;
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionStatus tgt = new org.hl7.fhir.r4b.model.SubscriptionStatus();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
|
||||||
|
|
||||||
|
if (src.hasType())
|
||||||
|
{
|
||||||
|
tgt.setTypeElement(convertSubscriptionNotificationType(src.getTypeElement()));
|
||||||
|
}
|
||||||
|
if (src.hasStatus()) {
|
||||||
|
tgt.setStatusElement(convertSubscriptionStatus(src.getStatusElement()));
|
||||||
|
}
|
||||||
|
if (src.hasEventsSinceSubscriptionStart()) {
|
||||||
|
org.hl7.fhir.r4b.model.StringType value = new org.hl7.fhir.r4b.model.StringType();
|
||||||
|
value.setValue(src.getEventsSinceSubscriptionStartElement().getValueAsString());
|
||||||
|
tgt.setEventsSinceSubscriptionStartElement(value);
|
||||||
|
}
|
||||||
|
if (src.hasNotificationEvent()) {
|
||||||
|
for (org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent element : src.getNotificationEvent()) {
|
||||||
|
tgt.addNotificationEvent(convertSubscriptionStatusNotificationEventComponent(element));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (src.hasSubscription()) {
|
||||||
|
tgt.setSubscription(Reference43_50.convertReference(src.getSubscription()));
|
||||||
|
}
|
||||||
|
if (src.hasTopic()) {
|
||||||
|
tgt.setTopicElement(Canonical43_50.convertCanonical(src.getTopicElement()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent convertSubscriptionStatusNotificationEventComponent(org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent tgt = new org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent();
|
||||||
|
if (src.hasEventNumber()) {
|
||||||
|
tgt.setEventNumberElement(Integer64_43_50.convertInteger64ToString(src.getEventNumberElement()));
|
||||||
|
}
|
||||||
|
if (src.hasFocus()) {
|
||||||
|
tgt.setFocus(Reference43_50.convertReference(src.getFocus()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus> convertSubscriptionStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes> src) {
|
||||||
|
org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatusEnumFactory enumFactory = new org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatusEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case ACTIVE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ACTIVE);
|
||||||
|
case ERROR: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ERROR);
|
||||||
|
case ENTEREDINERROR: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.ERROR);
|
||||||
|
case OFF: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.OFF);
|
||||||
|
case REQUESTED: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.REQUESTED);
|
||||||
|
case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus.NULL);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType> convertSubscriptionNotificationType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType> src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case EVENTNOTIFICATION: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.EVENTNOTIFICATION);
|
||||||
|
case HANDSHAKE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.HANDSHAKE);
|
||||||
|
case HEARTBEAT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.HEARTBEAT);
|
||||||
|
case QUERYEVENT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.QUERYEVENT);
|
||||||
|
case QUERYSTATUS: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.QUERYSTATUS);
|
||||||
|
case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType.NULL);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static org.hl7.fhir.r5.model.SubscriptionStatus convertSubscriptionStatus(org.hl7.fhir.r4b.model.SubscriptionStatus src) {
|
||||||
|
if (src == null)
|
||||||
|
return null;
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionStatus tgt = new org.hl7.fhir.r5.model.SubscriptionStatus();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
|
||||||
|
|
||||||
|
if (src.hasType())
|
||||||
|
{
|
||||||
|
tgt.setTypeElement(convertSubscriptionNotificationType(src.getTypeElement()));
|
||||||
|
}
|
||||||
|
if (src.hasStatus()) {
|
||||||
|
tgt.setStatusElement(convertSubscriptionStatus(src.getStatusElement()));
|
||||||
|
}
|
||||||
|
if (src.hasEventsSinceSubscriptionStart()) {
|
||||||
|
org.hl7.fhir.r5.model.Integer64Type value = new org.hl7.fhir.r5.model.Integer64Type();
|
||||||
|
value.fromStringValue(src.getEventsSinceSubscriptionStartElement().getValueAsString());
|
||||||
|
tgt.setEventsSinceSubscriptionStartElement(value);
|
||||||
|
}
|
||||||
|
if (src.hasNotificationEvent()) {
|
||||||
|
for (org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent element : src.getNotificationEvent()) {
|
||||||
|
tgt.addNotificationEvent(convertSubscriptionStatusNotificationEventComponent(element));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (src.hasSubscription()) {
|
||||||
|
tgt.setSubscription(Reference43_50.convertReference(src.getSubscription()));
|
||||||
|
}
|
||||||
|
if (src.hasTopic()) {
|
||||||
|
tgt.setTopicElement(Canonical43_50.convertCanonical(src.getTopicElement()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent convertSubscriptionStatusNotificationEventComponent(org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent tgt = new org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionStatusNotificationEventComponent();
|
||||||
|
if (src.hasEventNumber()) {
|
||||||
|
tgt.setEventNumberElement(Integer64_43_50.convertStringToInteger64(src.getEventNumberElement()));
|
||||||
|
}
|
||||||
|
if (src.hasFocus()) {
|
||||||
|
tgt.setFocus(Reference43_50.convertReference(src.getFocus()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes> convertSubscriptionStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.SubscriptionStatus> src) {
|
||||||
|
org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodesEnumFactory enumFactory = new org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodesEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case ACTIVE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.ACTIVE);
|
||||||
|
case ERROR: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.ERROR);
|
||||||
|
case OFF: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.OFF);
|
||||||
|
case REQUESTED: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.REQUESTED);
|
||||||
|
case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SubscriptionStatusCodes.NULL);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType> convertSubscriptionNotificationType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionStatus.SubscriptionNotificationType> src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory enumFactory = new org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationTypeEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case EVENTNOTIFICATION: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.EVENTNOTIFICATION);
|
||||||
|
case HANDSHAKE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.HANDSHAKE);
|
||||||
|
case HEARTBEAT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.HEARTBEAT);
|
||||||
|
case QUERYEVENT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.QUERYEVENT);
|
||||||
|
case QUERYSTATUS: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.QUERYSTATUS);
|
||||||
|
case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionStatus.SubscriptionNotificationType.NULL);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,473 @@
|
||||||
|
package org.hl7.fhir.convertors.conv43_50.resources43_50;
|
||||||
|
|
||||||
|
import org.hl7.fhir.convertors.context.ConversionContext43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
|
||||||
|
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
|
||||||
|
import org.hl7.fhir.r4b.model.SubscriptionTopic;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
public class SubscriptionTopic43_50 {
|
||||||
|
public static org.hl7.fhir.r4b.model.SubscriptionTopic convertSubscriptionTopic(org.hl7.fhir.r5.model.SubscriptionTopic src) {
|
||||||
|
if (src == null)
|
||||||
|
return null;
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic tgt = new org.hl7.fhir.r4b.model.SubscriptionTopic();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
|
||||||
|
if (src.hasUrl())
|
||||||
|
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
|
||||||
|
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
|
||||||
|
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
|
||||||
|
if (src.hasTitle())
|
||||||
|
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
|
||||||
|
for (org.hl7.fhir.r5.model.CanonicalType t : src.getDerivedFrom())
|
||||||
|
tgt.getDerivedFrom().add(Canonical43_50.convertCanonical(t));
|
||||||
|
if (src.hasStatus())
|
||||||
|
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
|
||||||
|
if (src.hasVersion())
|
||||||
|
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
|
||||||
|
if (src.hasTitle())
|
||||||
|
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
|
||||||
|
if (src.hasStatus())
|
||||||
|
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
|
||||||
|
if (src.hasExperimental())
|
||||||
|
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
|
||||||
|
if (src.hasDate())
|
||||||
|
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
|
||||||
|
if (src.hasPublisher())
|
||||||
|
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
|
||||||
|
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
|
||||||
|
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
|
||||||
|
if (src.hasDescription())
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
|
||||||
|
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
|
||||||
|
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
|
||||||
|
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
|
||||||
|
if (src.hasPurpose())
|
||||||
|
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
|
||||||
|
if (src.hasCopyright())
|
||||||
|
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
|
||||||
|
if (src.hasCopyrightLabel()) {
|
||||||
|
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.copyrightLabel", String43_50.convertString(src.getCopyrightLabelElement()));
|
||||||
|
}
|
||||||
|
if (src.hasName()) {
|
||||||
|
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name", String43_50.convertString(src.getNameElement()));
|
||||||
|
}
|
||||||
|
if (src.hasApprovalDate())
|
||||||
|
tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
|
||||||
|
if (src.hasLastReviewDate())
|
||||||
|
tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
|
||||||
|
if (src.hasEffectivePeriod())
|
||||||
|
tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
|
||||||
|
for(org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent triggerComponent : src.getResourceTrigger()) {
|
||||||
|
tgt.addResourceTrigger(convertResourceTrigger(triggerComponent));}
|
||||||
|
for (org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent canFilterByComponent : src.getCanFilterBy()) {
|
||||||
|
tgt.addCanFilterBy(convertCanFilterBy(canFilterByComponent));
|
||||||
|
}
|
||||||
|
for (org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent eventTrigger : src.getEventTrigger()) {
|
||||||
|
tgt.addEventTrigger(convertEventTrigger(eventTrigger));
|
||||||
|
}
|
||||||
|
for (org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent notificationShape : src.getNotificationShape()) {
|
||||||
|
tgt.addNotificationShape(convertNotificationShape(notificationShape));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SubscriptionTopic.SubscriptionTopicEventTriggerComponent convertEventTrigger(org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent tgt = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent();
|
||||||
|
if (src.hasDescription()) {
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
}
|
||||||
|
if (src.hasEvent()) {
|
||||||
|
tgt.setEvent(CodeableConcept43_50.convertCodeableConcept(src.getEvent()));
|
||||||
|
}
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent convertNotificationShape(org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent tgt = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent();
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
if (src.hasInclude()) {
|
||||||
|
tgt.setInclude(src.getInclude().stream().map(String43_50::convertString).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
if (src.hasRevInclude()) {
|
||||||
|
tgt.setRevInclude(src.getRevInclude().stream().map(String43_50::convertString).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent convertCanFilterBy(org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent tgt = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent();
|
||||||
|
if (src.hasDescription()) {
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
if (src.hasFilterParameter()) {
|
||||||
|
tgt.setFilterParameterElement(String43_50.convertString(src.getFilterParameterElement()));
|
||||||
|
}
|
||||||
|
if (src.hasFilterDefinition()) {
|
||||||
|
// TODO r4b spec has this, but the Java model does not
|
||||||
|
}
|
||||||
|
if (src.hasModifier() || src.hasComparator()) {
|
||||||
|
List<org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier>> tgtModifiers = convertR5ModifierToR4BModifier(src.getModifier());
|
||||||
|
|
||||||
|
List<org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier>> tgtComparatorModifiers = convertR5ComparatorToR4BModifier(src.getComparator());
|
||||||
|
|
||||||
|
tgt.setModifier(Stream.concat(tgtModifiers.stream(), tgtComparatorModifiers.stream())
|
||||||
|
.collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier>> convertR5ComparatorToR4BModifier(List<org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator>> srcList) {
|
||||||
|
return srcList.stream().map(SubscriptionTopic43_50::convertR5ComparatorToR4BModifier).filter(x -> x != null).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier> convertR5ComparatorToR4BModifier(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator> src){
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NULL);
|
||||||
|
case EQ: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.EQ);
|
||||||
|
case NE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NE);
|
||||||
|
case GT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.GT);
|
||||||
|
case LT: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.LT);
|
||||||
|
case GE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.GE);
|
||||||
|
case LE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.LE);
|
||||||
|
case SA: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.SA);
|
||||||
|
case EB: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.EB);
|
||||||
|
case AP: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.AP);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier>> convertR5ModifierToR4BModifier(List<org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode>> srcList) {
|
||||||
|
return srcList.stream().map(SubscriptionTopic43_50::convertR5ModifierToR4BModifier).filter(x -> x != null).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier> convertR5ModifierToR4BModifier(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode> src){
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifierEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NULL);
|
||||||
|
case IN: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.IN);
|
||||||
|
case NOTIN: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.NOTIN);
|
||||||
|
case BELOW: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.BELOW);
|
||||||
|
case ABOVE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.ABOVE);
|
||||||
|
case OFTYPE: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier.OFTYPE);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
private static org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent convertResourceTrigger(org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent tgt = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
|
||||||
|
if (src.hasDescription()) {
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
if (src.hasSupportedInteraction()) {
|
||||||
|
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger> srcItem : src.getSupportedInteraction()) {
|
||||||
|
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger> newElement = tgt.addSupportedInteractionElement();
|
||||||
|
newElement.setValue(convertInteractionTrigger(srcItem.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (src.hasQueryCriteria()) {
|
||||||
|
tgt.setQueryCriteria(convertResourceTriggerQueryCriteriaComponent(src.getQueryCriteria()));
|
||||||
|
}
|
||||||
|
if (src.hasFhirPathCriteria()) {
|
||||||
|
tgt.setFhirPathCriteriaElement(String43_50.convertString(src.getFhirPathCriteriaElement()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent convertResourceTriggerQueryCriteriaComponent(org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent tgt = new org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent();
|
||||||
|
if (src.hasPrevious()) {
|
||||||
|
tgt.setPreviousElement(String43_50.convertString(src.getPreviousElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResultForCreate()) {
|
||||||
|
tgt.setResultForCreateElement(convertCriteriaNotExistsBehavior(src.getResultForCreateElement()));
|
||||||
|
}
|
||||||
|
if (src.hasCurrent()) {
|
||||||
|
tgt.setCurrentElement(String43_50.convertString(src.getCurrentElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResultForDelete()) {
|
||||||
|
tgt.setResultForDeleteElement(convertCriteriaNotExistsBehavior(src.getResultForDeleteElement()));
|
||||||
|
}
|
||||||
|
if (src.hasRequireBoth()) {
|
||||||
|
tgt.setRequireBothElement(Boolean43_50.convertBoolean(src.getRequireBothElement()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior> convertCriteriaNotExistsBehavior(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior> src) {
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory enumFactory = new org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case TESTFAILS: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTFAILS);
|
||||||
|
case TESTPASSES: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTPASSES);
|
||||||
|
case NULL: return new org.hl7.fhir.r4b.model.Enumeration<>(enumFactory, org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior.NULL);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger convertInteractionTrigger(org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger value) {
|
||||||
|
switch(value) {
|
||||||
|
case CREATE : return org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger.CREATE;
|
||||||
|
case UPDATE: return org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger.UPDATE;
|
||||||
|
case DELETE: return org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger.DELETE;
|
||||||
|
case NULL: return org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger.NULL;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static org.hl7.fhir.r5.model.SubscriptionTopic convertSubscriptionTopic(org.hl7.fhir.r4b.model.SubscriptionTopic src) {
|
||||||
|
if (src == null)
|
||||||
|
return null;
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic tgt = new org.hl7.fhir.r5.model.SubscriptionTopic();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
|
||||||
|
|
||||||
|
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name")) {
|
||||||
|
tgt.setNameElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name").getValue()));
|
||||||
|
}
|
||||||
|
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.copyrightLabel")) {
|
||||||
|
tgt.setCopyrightLabelElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.copyrightLabel").getValue()));
|
||||||
|
}
|
||||||
|
if (src.hasUrl())
|
||||||
|
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
|
||||||
|
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
|
||||||
|
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
|
||||||
|
if (src.hasTitle())
|
||||||
|
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
|
||||||
|
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getDerivedFrom())
|
||||||
|
tgt.getDerivedFrom().add(Canonical43_50.convertCanonical(t));
|
||||||
|
if (src.hasStatus())
|
||||||
|
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
|
||||||
|
if (src.hasVersion())
|
||||||
|
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
|
||||||
|
if (src.hasTitle())
|
||||||
|
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
|
||||||
|
if (src.hasStatus())
|
||||||
|
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
|
||||||
|
if (src.hasExperimental())
|
||||||
|
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
|
||||||
|
if (src.hasDate())
|
||||||
|
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
|
||||||
|
if (src.hasPublisher())
|
||||||
|
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
|
||||||
|
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
|
||||||
|
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
|
||||||
|
if (src.hasDescription())
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
|
||||||
|
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
|
||||||
|
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction())
|
||||||
|
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
|
||||||
|
if (src.hasPurpose())
|
||||||
|
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
|
||||||
|
if (src.hasCopyright())
|
||||||
|
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
|
||||||
|
if (src.hasApprovalDate())
|
||||||
|
tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
|
||||||
|
if (src.hasLastReviewDate())
|
||||||
|
tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
|
||||||
|
if (src.hasEffectivePeriod())
|
||||||
|
tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
|
||||||
|
for(org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent triggerComponent : src.getResourceTrigger()) {
|
||||||
|
tgt.addResourceTrigger(convertResourceTrigger(triggerComponent));
|
||||||
|
}
|
||||||
|
for (org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent eventTrigger : src.getEventTrigger()) {
|
||||||
|
tgt.addEventTrigger(convertEventTrigger(eventTrigger));
|
||||||
|
}
|
||||||
|
for (org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent canFilterByComponent : src.getCanFilterBy()) {
|
||||||
|
tgt.addCanFilterBy(convertCanFilterBy(canFilterByComponent));
|
||||||
|
}
|
||||||
|
for (org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent notificationShape : src.getNotificationShape()) {
|
||||||
|
tgt.addNotificationShape(convertNotificationShape(notificationShape));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent convertNotificationShape(org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent tgt = new org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicNotificationShapeComponent();
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
if (src.hasInclude()) {
|
||||||
|
tgt.setInclude(src.getInclude().stream().map(String43_50::convertString).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
if (src.hasRevInclude()) {
|
||||||
|
tgt.setRevInclude(src.getRevInclude().stream().map(String43_50::convertString).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent convertEventTrigger(org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent tgt = new org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicEventTriggerComponent();
|
||||||
|
if (src.hasDescription()) {
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
}
|
||||||
|
if (src.hasEvent()) {
|
||||||
|
tgt.setEvent(CodeableConcept43_50.convertCodeableConcept(src.getEvent()));
|
||||||
|
}
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent convertCanFilterBy(org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent tgt = new org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicCanFilterByComponent();
|
||||||
|
if (src.hasDescription()) {
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
if (src.hasFilterParameter()) {
|
||||||
|
tgt.setFilterParameterElement(String43_50.convertString(src.getFilterParameterElement()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (src.hasModifier()) {
|
||||||
|
List<org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode>> tgtModifiers = convertR4BModifierToR5Modifier(src.getModifier());
|
||||||
|
tgt.setModifier(tgtModifiers);
|
||||||
|
|
||||||
|
List<org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator>> tgtComparators = covertR4BModifierToR5Comparator(src.getModifier());
|
||||||
|
tgt.setComparator(tgtComparators);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator>> covertR4BModifierToR5Comparator(List<org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier>> srcList) {
|
||||||
|
return srcList.stream().map(SubscriptionTopic43_50::convertR4BModifierToR5Comparator).filter(x -> x != null).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchComparator> convertR4BModifierToR5Comparator(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier> src) {
|
||||||
|
org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory enumFactory = new org.hl7.fhir.r5.model.Enumerations.SearchComparatorEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.NULL);
|
||||||
|
case EQ: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.EQ);
|
||||||
|
case NE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.NE);
|
||||||
|
case GT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.GT);
|
||||||
|
case LT: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.LT);
|
||||||
|
case GE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.GE);
|
||||||
|
case LE: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.LE);
|
||||||
|
case SA: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.SA);
|
||||||
|
case EB: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.EB);
|
||||||
|
case AP: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchComparator.AP);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode>> convertR4BModifierToR5Modifier(
|
||||||
|
List
|
||||||
|
<org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier>> srcList) {
|
||||||
|
return srcList.stream().map(SubscriptionTopic43_50::convertR4BModifierToR5Modifier).filter(x -> x != null).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
private static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchModifierCode> convertR4BModifierToR5Modifier(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionSearchModifier> src) {
|
||||||
|
org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory enumFactory = new org.hl7.fhir.r5.model.Enumerations.SearchModifierCodeEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
case NULL:
|
||||||
|
return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NULL);
|
||||||
|
case IN:
|
||||||
|
return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.IN);
|
||||||
|
case NOTIN:
|
||||||
|
return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.NOTIN);
|
||||||
|
case BELOW:
|
||||||
|
return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.BELOW);
|
||||||
|
case ABOVE:
|
||||||
|
return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.ABOVE);
|
||||||
|
case OFTYPE:
|
||||||
|
return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.Enumerations.SearchModifierCode.OFTYPE);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent convertResourceTrigger(org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent tgt = new org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerComponent();
|
||||||
|
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
|
||||||
|
if (src.hasDescription()) {
|
||||||
|
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResource()) {
|
||||||
|
tgt.setResourceElement(Uri43_50.convertUri(src.getResourceElement()));
|
||||||
|
}
|
||||||
|
if (src.hasSupportedInteraction()) {
|
||||||
|
for (org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger> srcItem : src.getSupportedInteraction()) {
|
||||||
|
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger> tgtElement = tgt.addSupportedInteractionElement();
|
||||||
|
tgtElement.setValue(convertInteractionTrigger(srcItem.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (src.hasQueryCriteria()) {
|
||||||
|
tgt.setQueryCriteria(convertResourceTriggerQueryCriteriaComponent(src.getQueryCriteria()));
|
||||||
|
}
|
||||||
|
if (src.hasFhirPathCriteria()) {
|
||||||
|
tgt.setFhirPathCriteriaElement(String43_50.convertString(src.getFhirPathCriteriaElement()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent convertResourceTriggerQueryCriteriaComponent(org.hl7.fhir.r4b.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent tgt = new org.hl7.fhir.r5.model.SubscriptionTopic.SubscriptionTopicResourceTriggerQueryCriteriaComponent();
|
||||||
|
if (src.hasPrevious()) {
|
||||||
|
tgt.setPreviousElement(String43_50.convertString(src.getPreviousElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResultForCreate()) {
|
||||||
|
tgt.setResultForCreateElement(convertCriteriaNotExistsBehavior(src.getResultForCreateElement()));
|
||||||
|
}
|
||||||
|
if (src.hasCurrent()) {
|
||||||
|
tgt.setCurrentElement(String43_50.convertString(src.getCurrentElement()));
|
||||||
|
}
|
||||||
|
if (src.hasResultForDelete()) {
|
||||||
|
tgt.setResultForDeleteElement(convertCriteriaNotExistsBehavior(src.getResultForDeleteElement()));
|
||||||
|
}
|
||||||
|
if (src.hasRequireBoth()) {
|
||||||
|
tgt.setRequireBothElement(Boolean43_50.convertBoolean(src.getRequireBothElement()));
|
||||||
|
}
|
||||||
|
return tgt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior> convertCriteriaNotExistsBehavior(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.SubscriptionTopic.CriteriaNotExistsBehavior> src) {
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory enumFactory = new org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehaviorEnumFactory();
|
||||||
|
switch(src.getValue()) {
|
||||||
|
|
||||||
|
case TESTFAILS: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTFAILS);
|
||||||
|
case TESTPASSES: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.TESTPASSES);
|
||||||
|
case NULL: return new org.hl7.fhir.r5.model.Enumeration<>(enumFactory, org.hl7.fhir.r5.model.SubscriptionTopic.CriteriaNotExistsBehavior.NULL);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger convertInteractionTrigger(org.hl7.fhir.r4b.model.SubscriptionTopic.InteractionTrigger value) {
|
||||||
|
switch(value) {
|
||||||
|
case CREATE : return org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger.CREATE;
|
||||||
|
case UPDATE: return org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger.UPDATE;
|
||||||
|
case DELETE: return org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger.DELETE;
|
||||||
|
case NULL: return org.hl7.fhir.r5.model.SubscriptionTopic.InteractionTrigger.NULL;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package org.hl7.fhir.convertors.conv43_50;
|
||||||
|
|
||||||
|
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_43_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 SubscriptionStatus43_50Test {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Test r5 -> r4 SubscriptionTopic conversion.")
|
||||||
|
public void testR5_R4b() throws IOException {
|
||||||
|
InputStream r5_input = this.getClass().getResourceAsStream("/subscription_status_50.json");
|
||||||
|
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionStatus r5_actual = (org.hl7.fhir.r5.model.SubscriptionStatus) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
|
||||||
|
org.hl7.fhir.r4b.model.Resource r4b_conv = VersionConvertorFactory_43_50.convertResource(r5_actual);
|
||||||
|
|
||||||
|
org.hl7.fhir.r4b.formats.JsonParser r4b_parser = new org.hl7.fhir.r4b.formats.JsonParser();
|
||||||
|
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
r4b_parser.compose(stream, r4b_conv);
|
||||||
|
|
||||||
|
org.hl7.fhir.r4b.model.Resource r4b_streamed = new org.hl7.fhir.r4b.formats.JsonParser().parse(new ByteArrayInputStream(stream.toByteArray()));
|
||||||
|
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_43_50.convertResource(r4b_streamed);
|
||||||
|
|
||||||
|
assertTrue(r5_actual.equalsDeep(r5_conv), "should be the same");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Test r4b -> r5 SubscriptionTopic conversion.")
|
||||||
|
public void testR4b_R5() throws IOException {
|
||||||
|
InputStream r4b_input = this.getClass().getResourceAsStream("/subscription_status_43.json");
|
||||||
|
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionStatus r4b_actual = (org.hl7.fhir.r4b.model.SubscriptionStatus) new org.hl7.fhir.r4b.formats.JsonParser().parse(r4b_input);
|
||||||
|
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_43_50.convertResource(r4b_actual);
|
||||||
|
|
||||||
|
org.hl7.fhir.r5.formats.JsonParser r5_parser = new org.hl7.fhir.r5.formats.JsonParser();
|
||||||
|
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
r5_parser.compose(stream, r5_conv);
|
||||||
|
|
||||||
|
org.hl7.fhir.r5.model.Resource r5_streamed = new org.hl7.fhir.r5.formats.JsonParser().parse(new ByteArrayInputStream(stream.toByteArray()));
|
||||||
|
org.hl7.fhir.r4b.model.Resource r4b_conv = VersionConvertorFactory_43_50.convertResource(r5_streamed);
|
||||||
|
|
||||||
|
assertTrue(r4b_actual.equalsDeep(r4b_conv), "should be the same");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package org.hl7.fhir.convertors.conv43_50;
|
||||||
|
|
||||||
|
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_43_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 SubscriptionTopic43_50Test {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Test r5 -> r4b SubscriptionTopic conversion.")
|
||||||
|
public void testR5_R4b() throws IOException {
|
||||||
|
InputStream r5_input = this.getClass().getResourceAsStream("/subscription_topic_50.json");
|
||||||
|
|
||||||
|
org.hl7.fhir.r5.model.SubscriptionTopic r5_actual = (org.hl7.fhir.r5.model.SubscriptionTopic) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
|
||||||
|
org.hl7.fhir.r4b.model.Resource r4b_conv = VersionConvertorFactory_43_50.convertResource(r5_actual);
|
||||||
|
|
||||||
|
org.hl7.fhir.r4b.formats.JsonParser r4b_parser = new org.hl7.fhir.r4b.formats.JsonParser();
|
||||||
|
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
r4b_parser.compose(stream, r4b_conv);
|
||||||
|
|
||||||
|
org.hl7.fhir.r4b.model.Resource r4b_streamed = new org.hl7.fhir.r4b.formats.JsonParser().parse(new ByteArrayInputStream(stream.toByteArray()));
|
||||||
|
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_43_50.convertResource(r4b_streamed);
|
||||||
|
|
||||||
|
assertTrue(r5_actual.equalsDeep(r5_conv), "should be the same");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Test r4b -> r5 SubscriptionTopic conversion.")
|
||||||
|
public void testR4b_R5() throws IOException {
|
||||||
|
InputStream r4b_input = this.getClass().getResourceAsStream("/subscription_topic_43.json");
|
||||||
|
|
||||||
|
org.hl7.fhir.r4b.model.SubscriptionTopic r4b_actual = (org.hl7.fhir.r4b.model.SubscriptionTopic) new org.hl7.fhir.r4b.formats.JsonParser().parse(r4b_input);
|
||||||
|
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_43_50.convertResource(r4b_actual);
|
||||||
|
|
||||||
|
org.hl7.fhir.r5.formats.JsonParser r5_parser = new org.hl7.fhir.r5.formats.JsonParser();
|
||||||
|
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
r5_parser.compose(stream, r5_conv);
|
||||||
|
|
||||||
|
org.hl7.fhir.r5.model.Resource r5_streamed = new org.hl7.fhir.r5.formats.JsonParser().parse(new ByteArrayInputStream(stream.toByteArray()));
|
||||||
|
org.hl7.fhir.r4b.model.Resource r4b_conv = VersionConvertorFactory_43_50.convertResource(r5_streamed);
|
||||||
|
|
||||||
|
assertTrue(r4b_actual.equalsDeep(r4b_conv), "should be the same");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"resourceType": "SubscriptionStatus",
|
||||||
|
"status": "active",
|
||||||
|
"type": "event-notification",
|
||||||
|
"eventsSinceSubscriptionStart": "1",
|
||||||
|
"notificationEvent": [ {
|
||||||
|
"eventNumber": "1",
|
||||||
|
"focus": {
|
||||||
|
"reference": "Encounter/3"
|
||||||
|
}
|
||||||
|
} ],
|
||||||
|
"subscription": {
|
||||||
|
"reference": "Subscription/2"
|
||||||
|
},
|
||||||
|
"topic": "http://example.com/topic/test"
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"resourceType" : "SubscriptionStatus",
|
||||||
|
"id" : "example",
|
||||||
|
"text" : {
|
||||||
|
"status" : "generated",
|
||||||
|
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative: SubscriptionStatus</b><a name=\"example\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource SubscriptionStatus "example" </p></div><p><b>status</b>: active</p><p><b>type</b>: event-notification</p><p><b>eventsSinceSubscriptionStart</b>: 1000</p><h3>NotificationEvents</h3><table class=\"grid\"><tr><td>-</td><td><b>EventNumber</b></td></tr><tr><td>*</td><td>1000</td></tr></table><p><b>subscription</b>: <a href=\"broken-link.html\">http://example.org/FHIR/R5/Subscription/123</a></p><p><b>topic</b>: <a href=\"http://example.org/FHIR/R5/SubscriptionTopic/admission\">http://example.org/FHIR/R5/SubscriptionTopic/admission</a></p></div>"
|
||||||
|
},
|
||||||
|
"status" : "active",
|
||||||
|
"type" : "event-notification",
|
||||||
|
"eventsSinceSubscriptionStart" : "1000",
|
||||||
|
"notificationEvent" : [{
|
||||||
|
"eventNumber" : "1000"
|
||||||
|
}],
|
||||||
|
"subscription" : {
|
||||||
|
"reference" : "http://example.org/FHIR/R5/Subscription/123"
|
||||||
|
},
|
||||||
|
"topic" : "http://example.org/FHIR/R5/SubscriptionTopic/admission"
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"resourceType": "SubscriptionTopic",
|
||||||
|
"id": "1",
|
||||||
|
"meta": {
|
||||||
|
"versionId": "1",
|
||||||
|
"lastUpdated": "2023-04-13T19:11:45.601-04:00"
|
||||||
|
},
|
||||||
|
"url": "http://example.com/topic/test",
|
||||||
|
"status": "active",
|
||||||
|
"resourceTrigger": [ {
|
||||||
|
"resource": "Encounter",
|
||||||
|
"supportedInteraction": [ "create" ],
|
||||||
|
"queryCriteria": {
|
||||||
|
"previous": "Encounter?status=planned",
|
||||||
|
"current": "Encounter?status=finished",
|
||||||
|
"requireBoth": true
|
||||||
|
}
|
||||||
|
} ]
|
||||||
|
}
|
|
@ -0,0 +1,118 @@
|
||||||
|
{
|
||||||
|
"resourceType" : "SubscriptionTopic",
|
||||||
|
"id" : "example",
|
||||||
|
"text" : {
|
||||||
|
"status" : "generated",
|
||||||
|
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative: SubscriptionTopic</b><a name=\"example\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource SubscriptionTopic "example" </p></div><p><b>url</b>: <code>http://example.org/FHIR/R5/SubscriptionTopic/example</code></p><p><b>identifier</b>: id:\u00a0urn:uuid:1caa02ba-051b-4602-8856-65921748ae76</p><p><b>version</b>: 1.0.0-beta.1</p><p><b>title</b>: example</p><p><b>status</b>: draft</p><p><b>date</b>: 2019-01-01</p><p><b>description</b>: Example topic for completed encounters</p><blockquote><p><b>resourceTrigger</b></p><p><b>description</b>: An Encounter has been completed</p><p><b>resource</b>: <a href=\"encounter.html\">Encounter</a></p><p><b>supportedInteraction</b>: update</p><h3>QueryCriteria</h3><table class=\"grid\"><tr><td>-</td><td><b>Previous</b></td><td><b>ResultForCreate</b></td><td><b>Current</b></td><td><b>ResultForDelete</b></td><td><b>RequireBoth</b></td></tr><tr><td>*</td><td>status:not=completed</td><td>test-passes</td><td>status=completed</td><td>test-fails</td><td>true</td></tr></table><p><b>fhirPathCriteria</b>: (%previous.empty() | (%previous.status != 'completed')) and (%current.status = 'completed')</p></blockquote><blockquote><p><b>canFilterBy</b></p><p><b>description</b>: Filter based on the subject of an encounter.</p><p><b>resource</b>: <a href=\"encounter.html\">Encounter</a></p><p><b>filterParameter</b>: subject</p></blockquote><blockquote><p><b>canFilterBy</b></p><p><b>description</b>: Filter based on the group membership of the subject of an encounter.</p><p><b>resource</b>: <a href=\"encounter.html\">Encounter</a></p><p><b>filterParameter</b>: _in</p></blockquote><blockquote><p><b>canFilterBy</b></p><p><b>description</b>: Filter based on the length of an encounter.</p><p><b>resource</b>: <a href=\"encounter.html\">Encounter</a></p><p><b>filterParameter</b>: length</p><p><b>comparator</b>: gt, lt, ge, le</p></blockquote><blockquote><p><b>canFilterBy</b></p><p><b>description</b>: Filter based on the account for billing an encounter.</p><p><b>resource</b>: <a href=\"encounter.html\">Encounter</a></p><p><b>filterParameter</b>: account</p><p><b>modifier</b>: missing, not, identifier</p></blockquote><h3>NotificationShapes</h3><table class=\"grid\"><tr><td>-</td><td><b>Resource</b></td><td><b>Include</b></td></tr><tr><td>*</td><td><a href=\"encounter.html\">Encounter</a></td><td>Encounter:patient&iterate=Patient.link, Encounter:practitioner, Encounter:service-provider, Encounter:account, Encounter:diagnosis, Encounter:observation, Encounter:location</td></tr></table></div>"
|
||||||
|
},
|
||||||
|
"url" : "http://example.org/FHIR/R5/SubscriptionTopic/example",
|
||||||
|
"identifier" : [{
|
||||||
|
"system" : "urn:ietf:rfc:3986",
|
||||||
|
"value" : "urn:uuid:1caa02ba-051b-4602-8856-65921748ae76"
|
||||||
|
}],
|
||||||
|
"name" : "my topic name",
|
||||||
|
"version" : "1.0.0-beta.1",
|
||||||
|
"title" : "example",
|
||||||
|
"status" : "draft",
|
||||||
|
"experimental" : true,
|
||||||
|
"date" : "2019-01-01",
|
||||||
|
"publisher" : "Somebody McSomeoneson",
|
||||||
|
"contact" : [
|
||||||
|
{ "contact" : "Somebody McSomeoneson"}
|
||||||
|
],
|
||||||
|
"description" : "Example topic for completed encounters",
|
||||||
|
"useContext" : [
|
||||||
|
{
|
||||||
|
"code": {
|
||||||
|
"system": "http://hl7.org/fhir/usage-context-type",
|
||||||
|
"code": "focus"
|
||||||
|
},
|
||||||
|
"valueCodeableConcept": {
|
||||||
|
"coding": [
|
||||||
|
{
|
||||||
|
"system": "http://snomed.info/sct",
|
||||||
|
"code": "306206005",
|
||||||
|
"display": "Referral to service (procedure)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"jurisdiction": [
|
||||||
|
{
|
||||||
|
"coding": [
|
||||||
|
{
|
||||||
|
"system": "urn:iso:std:iso:3166",
|
||||||
|
"code": "US",
|
||||||
|
"display": "United States of America (the)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"purpose" : "Some purpose description [link](http://someplace.somewhere)",
|
||||||
|
"copyright": "Some copyright info [link](http://someplace.somewhere)",
|
||||||
|
"copyrightLabel": "A copyright label",
|
||||||
|
"resourceTrigger" : [{
|
||||||
|
"description" : "An Encounter has been completed",
|
||||||
|
"resource" : "http://hl7.org/fhir/StructureDefinition/Encounter",
|
||||||
|
"supportedInteraction" : ["update"],
|
||||||
|
"queryCriteria" : {
|
||||||
|
"previous" : "status:not=completed",
|
||||||
|
"resultForCreate" : "test-passes",
|
||||||
|
"current" : "status=completed",
|
||||||
|
"resultForDelete" : "test-fails",
|
||||||
|
"requireBoth" : true
|
||||||
|
},
|
||||||
|
"fhirPathCriteria" : "(%previous.empty() | (%previous.status != 'completed')) and (%current.status = 'completed')"
|
||||||
|
}],
|
||||||
|
"eventTrigger" : [{
|
||||||
|
"description" : "Patient admission is covered by HL7v2 ADT^A01",
|
||||||
|
"event" : {
|
||||||
|
"coding" : [{
|
||||||
|
"system" : "http://terminology.hl7.org/CodeSystem/v2-0003",
|
||||||
|
"code" : "A01",
|
||||||
|
"display" : "ADT/ACK - Admit/visit notification"
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"resource" : "http://hl7.org/fhir/StructureDefinition/Encounter"
|
||||||
|
}],
|
||||||
|
"canFilterBy" : [{
|
||||||
|
"description" : "Filter based on the subject of an encounter.",
|
||||||
|
"resource" : "Encounter",
|
||||||
|
"filterParameter" : "subject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description" : "Filter based on the group membership of the subject of an encounter.",
|
||||||
|
"resource" : "Encounter",
|
||||||
|
"filterParameter" : "_in"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description" : "Filter based on the length of an encounter.",
|
||||||
|
"resource" : "Encounter",
|
||||||
|
"filterParameter" : "length",
|
||||||
|
"comparator" : ["gt",
|
||||||
|
"lt",
|
||||||
|
"ge",
|
||||||
|
"le"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description" : "Filter based on the account for billing an encounter.",
|
||||||
|
"resource" : "Encounter",
|
||||||
|
"filterParameter" : "account",
|
||||||
|
"modifier" : [
|
||||||
|
"not-in"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"notificationShape" : [{
|
||||||
|
"resource" : "Encounter",
|
||||||
|
"include" : ["Encounter:patient&iterate=Patient.link",
|
||||||
|
"Encounter:practitioner",
|
||||||
|
"Encounter:service-provider",
|
||||||
|
"Encounter:account",
|
||||||
|
"Encounter:diagnosis",
|
||||||
|
"Encounter:observation",
|
||||||
|
"Encounter:location"],
|
||||||
|
"revInclude" : ["Encounter:subject"]
|
||||||
|
}]
|
||||||
|
}
|
Loading…
Reference in New Issue