update conversions for discovered issues for R5
This commit is contained in:
parent
f38da36b33
commit
8ac01bd5a4
|
@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50;
|
|||
|
||||
import org.hl7.fhir.convertors.context.ConversionContext40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r4.model.UrlType;
|
||||
import org.hl7.fhir.r5.model.DataType;
|
||||
|
||||
public class Url40_50 {
|
||||
public static org.hl7.fhir.r5.model.UrlType convertUrl(org.hl7.fhir.r4.model.UrlType src) throws FHIRException {
|
||||
|
@ -15,4 +17,29 @@ public class Url40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.UrlType convertUriToUrl(org.hl7.fhir.r4.model.UriType src) throws FHIRException {
|
||||
org.hl7.fhir.r5.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UrlType();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.UriType convertUrlToUri(org.hl7.fhir.r5.model.UrlType src) throws FHIRException {
|
||||
org.hl7.fhir.r4.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r4.model.UriType();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.UriType convertUrlToUri(org.hl7.fhir.r4.model.UrlType src) throws FHIRException {
|
||||
org.hl7.fhir.r5.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UriType();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.UrlType convertUriToUrl(org.hl7.fhir.r5.model.UriType src) throws FHIRException {
|
||||
org.hl7.fhir.r4.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r4.model.UrlType();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -115,8 +115,9 @@ public class MessageHeader40_50 {
|
|||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference40_50.convertReference(src.getTarget()));
|
||||
if (src.hasEndpoint())
|
||||
tgt.setEndpoint(Uri40_50.convertUri(src.getEndpointElement()));
|
||||
if (src.hasEndpoint()) {
|
||||
tgt.setEndpoint(Url40_50.convertUrl(src.getEndpointElement()));
|
||||
}
|
||||
if (src.hasReceiver())
|
||||
tgt.setReceiver(Reference40_50.convertReference(src.getReceiver()));
|
||||
return tgt;
|
||||
|
@ -131,8 +132,9 @@ public class MessageHeader40_50 {
|
|||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference40_50.convertReference(src.getTarget()));
|
||||
if (src.hasEndpointUrlType())
|
||||
if (src.hasEndpointUrlType()) {
|
||||
tgt.setEndpointElement(Url40_50.convertUrl(src.getEndpointUrlType()));
|
||||
}
|
||||
if (src.hasReceiver())
|
||||
tgt.setReceiver(Reference40_50.convertReference(src.getReceiver()));
|
||||
return tgt;
|
||||
|
@ -152,7 +154,7 @@ public class MessageHeader40_50 {
|
|||
if (src.hasContact())
|
||||
tgt.setContact(ContactPoint40_50.convertContactPoint(src.getContact()));
|
||||
if (src.hasEndpoint())
|
||||
tgt.setEndpoint(Uri40_50.convertUri(src.getEndpointElement()));
|
||||
tgt.setEndpoint(Url40_50.convertUrl(src.getEndpointElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,8 +67,13 @@ public class Observation40_50 {
|
|||
if (src.hasIssued())
|
||||
tgt.setIssuedElement(Instant40_50.convertInstant(src.getIssuedElement()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference40_50.convertReference(t));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
if (src.hasValue()) {
|
||||
if (src.hasValueStringType()) {
|
||||
tgt.setValue(String40_50.convertStringToMarkdown(src.getValueStringType()));
|
||||
} else {
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
}
|
||||
}
|
||||
if (src.hasDataAbsentReason())
|
||||
tgt.setDataAbsentReason(CodeableConcept40_50.convertCodeableConcept(src.getDataAbsentReason()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getInterpretation())
|
||||
|
@ -117,8 +122,13 @@ public class Observation40_50 {
|
|||
if (src.hasIssued())
|
||||
tgt.setIssuedElement(Instant40_50.convertInstant(src.getIssuedElement()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference40_50.convertReference(t));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
if (src.hasValue()) {
|
||||
if (src.hasValueMarkdownType()) {
|
||||
tgt.setValue(String40_50.convertMarkdownToString(src.getValueMarkdownType()));
|
||||
} else {
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
}
|
||||
}
|
||||
if (src.hasDataAbsentReason())
|
||||
tgt.setDataAbsentReason(CodeableConcept40_50.convertCodeableConcept(src.getDataAbsentReason()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation())
|
||||
|
@ -263,8 +273,13 @@ public class Observation40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
if (src.hasValue()) {
|
||||
if (src.hasValueStringType()) {
|
||||
tgt.setValue(String40_50.convertStringToMarkdown(src.getValueStringType()));
|
||||
} else {
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
}
|
||||
}
|
||||
if (src.hasDataAbsentReason())
|
||||
tgt.setDataAbsentReason(CodeableConcept40_50.convertCodeableConcept(src.getDataAbsentReason()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getInterpretation())
|
||||
|
@ -281,8 +296,13 @@ public class Observation40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyBackboneElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
if (src.hasValue()) {
|
||||
if (src.hasValueMarkdownType()) {
|
||||
tgt.setValue(String40_50.convertMarkdownToString(src.getValueMarkdownType()));
|
||||
} else {
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
}
|
||||
}
|
||||
if (src.hasDataAbsentReason())
|
||||
tgt.setDataAbsentReason(CodeableConcept40_50.convertCodeableConcept(src.getDataAbsentReason()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation())
|
||||
|
|
|
@ -144,6 +144,16 @@ public class JavaEnumerationsGenerator extends JavaBaseGenerator {
|
|||
write(" throw new FHIRException(\"Unknown "+name+" code '\"+codeString+\"'\");\r\n");
|
||||
write(" }\r\n");
|
||||
|
||||
write(" public static boolean isValidCode(String codeString) {\r\n");
|
||||
write(" if (codeString == null || \"\".equals(codeString))\r\n");
|
||||
write(" return false;\r\n");
|
||||
write(" return Utilities.existsInList(codeString");
|
||||
for (ValueSetExpansionContainsComponent c : vs.getExpansion().getContains()) {
|
||||
write(", \""+c.getCode()+"\"");
|
||||
}
|
||||
write(");\r\n");
|
||||
write(" }\r\n");
|
||||
|
||||
write(" public String toCode() {\r\n");
|
||||
write(" switch (this) {\r\n");
|
||||
for (ValueSetExpansionContainsComponent c : vs.getExpansion().getContains()) {
|
||||
|
|
|
@ -239,6 +239,7 @@ public class ToolingExtensions {
|
|||
public static final String WEB_EXTENSION_STYLE = "http://build.fhir.org/ig/FHIR/fhir-tools-ig/format-extensions.html#extension-related-extensions";
|
||||
public static final String EXT_IGDEP_COMMENT = "http://hl7.org/fhir/tools/StructureDefinition/implementationguide-dependency-comment";
|
||||
public static final String EXT_XPATH_CONSTRAINT = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ElementDefinition.constraint.xpath";
|
||||
public static final String EXT_OBLIGATION = "http://hl7.org/fhir/tools/StructureDefinition/obligation";
|
||||
;
|
||||
|
||||
// specific extension helpers
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -19,7 +19,7 @@
|
|||
|
||||
<properties>
|
||||
<hapi_fhir_version>6.2.1</hapi_fhir_version>
|
||||
<validator_test_case_version>1.2.13</validator_test_case_version>
|
||||
<validator_test_case_version>1.2.14-SNAPSHOT</validator_test_case_version>
|
||||
<junit_jupiter_version>5.7.1</junit_jupiter_version>
|
||||
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
|
||||
<maven_surefire_version>3.0.0-M5</maven_surefire_version>
|
||||
|
|
Loading…
Reference in New Issue