Skip to content

Commit

Permalink
fix(fhir): add default advisor to allow null values to be passed...
Browse files Browse the repository at this point in the history
...to convertors
  • Loading branch information
cmark committed Oct 10, 2024
1 parent 9be1283 commit 7043925
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.b2international.fhir.conv;

import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50;
import org.hl7.fhir.exceptions.FHIRFormatError;

Expand All @@ -26,24 +27,26 @@
*/
public class OperationConvertor_40_50 {

private static final BaseAdvisor_40_50 IGNORE_NULLS = new BaseAdvisor_40_50(false);

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r5.model.DataType> T convertType(org.hl7.fhir.r4.model.Type type) {
return (T) VersionConvertorFactory_40_50.convertType(type);
return (T) VersionConvertorFactory_40_50.convertType(type, IGNORE_NULLS);
}

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r4.model.Type> T convertType(org.hl7.fhir.r5.model.DataType type) {
return (T) VersionConvertorFactory_40_50.convertType(type);
return (T) VersionConvertorFactory_40_50.convertType(type, IGNORE_NULLS);
}

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r5.model.Resource> T convertResource(org.hl7.fhir.r4.model.Resource resource) {
return (T) VersionConvertorFactory_40_50.convertResource(resource);
return (T) VersionConvertorFactory_40_50.convertResource(resource, IGNORE_NULLS);
}

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r4.model.Resource> T convertResource(org.hl7.fhir.r5.model.Resource resource) {
return (T) VersionConvertorFactory_40_50.convertResource(resource);
return (T) VersionConvertorFactory_40_50.convertResource(resource, IGNORE_NULLS);
}

//////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.b2international.fhir.conv;

import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_43_50;
import org.hl7.fhir.exceptions.FHIRFormatError;

Expand All @@ -26,24 +27,26 @@
*/
public class OperationConvertor_43_50 {

private static final BaseAdvisor_43_50 IGNORE_NULLS = new BaseAdvisor_43_50(false);

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r5.model.DataType> T convertType(org.hl7.fhir.r4b.model.DataType type) {
return (T) VersionConvertorFactory_43_50.convertType(type);
return (T) VersionConvertorFactory_43_50.convertType(type, IGNORE_NULLS);
}

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r4b.model.DataType> T convertType(org.hl7.fhir.r5.model.DataType type) {
return (T) VersionConvertorFactory_43_50.convertType(type);
return (T) VersionConvertorFactory_43_50.convertType(type, IGNORE_NULLS);
}

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r5.model.Resource> T convertResource(org.hl7.fhir.r4b.model.Resource resource) {
return (T) VersionConvertorFactory_43_50.convertResource(resource);
return (T) VersionConvertorFactory_43_50.convertResource(resource, IGNORE_NULLS);
}

@SuppressWarnings("unchecked")
public static final <T extends org.hl7.fhir.r4b.model.Resource> T convertResource(org.hl7.fhir.r5.model.Resource resource) {
return (T) VersionConvertorFactory_43_50.convertResource(resource);
return (T) VersionConvertorFactory_43_50.convertResource(resource, IGNORE_NULLS);
}

//////////////
Expand Down

0 comments on commit 7043925

Please sign in to comment.