bug fixes from loading all published packages

This commit is contained in:
Grahame Grieve 2022-09-20 04:47:41 -04:00
parent ba56fc1a89
commit e044bf6607
2 changed files with 18 additions and 2 deletions

View File

@ -224,7 +224,7 @@ public class OperationDefinition14_50 {
if (src.hasDocumentation())
tgt.setDocumentationElement(String14_50.convertStringToMarkdown(src.getDocumentationElement()));
if (src.hasType())
tgt.setType(Enumerations.FHIRTypes.fromCode(src.getType()));
tgt.setType(Enumerations.FHIRTypes.fromCode(fixTypeCode(src.getType())));
if (src.hasSearchType())
tgt.setSearchTypeElement(Enumerations14_50.convertSearchParamType(src.getSearchTypeElement()));
tgt.addTargetProfile(src.getProfile().getReference());
@ -235,6 +235,14 @@ public class OperationDefinition14_50 {
return tgt;
}
private static String fixTypeCode(String type) {
if ("Type".equals(type)) {
return "DataType";
} else {
return type;
}
}
static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationKind> convertOperationKind(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.OperationDefinition.OperationKind> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;

View File

@ -61,7 +61,7 @@ public class CapabilityStatement30_50 {
if (src.hasImplementation())
tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation()));
if (src.hasFhirVersion())
tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion()));
tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(fixCode(src.getFhirVersion())));
if (src.hasAcceptUnknown())
tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
@ -78,6 +78,14 @@ public class CapabilityStatement30_50 {
return tgt;
}
private static String fixCode(String v) {
if ("STU3".equals(v)) {
return "3.0.2";
} else {
return v;
}
}
public static org.hl7.fhir.dstu3.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r5.model.CapabilityStatement src) throws FHIRException {
if (src == null)
return null;