@Test public void getBackboneElementNull() { final Observation observation = new Observation(); Assert.assertTrue( Objects.requireNonNull( utils.getBackboneElement( observation.getComponent(), "testUri", "4711" ) ).isEmpty() ); }
@Override @Nullable public IBaseBackboneElement getBackboneElement( @Nullable List<? extends IBaseBackboneElement> backboneElements, @Nonnull String system, @Nonnull String code ) { if ( backboneElements == null ) { return null; } return backboneElements.stream().map( ObservationComponentComponent.class::cast ) .filter( c -> getCodeTransformerUtils().containsCode( c.getCode(), system, code ) ) .findFirst().orElse( new ObservationComponentComponent() ); }
Dstu3ObservationFhirToDhisTransformerUtils extends AbstractObservationFhirToDhisTransformerUtils { @Override @Nullable public IBaseBackboneElement getBackboneElement( @Nullable List<? extends IBaseBackboneElement> backboneElements, @Nonnull String system, @Nonnull String code ) { if ( backboneElements == null ) { return null; } return backboneElements.stream().map( ObservationComponentComponent.class::cast ) .filter( c -> getCodeTransformerUtils().containsCode( c.getCode(), system, code ) ) .findFirst().orElse( new ObservationComponentComponent() ); } }
Dstu3ObservationFhirToDhisTransformerUtils extends AbstractObservationFhirToDhisTransformerUtils { @Override @Nullable public IBaseBackboneElement getBackboneElement( @Nullable List<? extends IBaseBackboneElement> backboneElements, @Nonnull String system, @Nonnull String code ) { if ( backboneElements == null ) { return null; } return backboneElements.stream().map( ObservationComponentComponent.class::cast ) .filter( c -> getCodeTransformerUtils().containsCode( c.getCode(), system, code ) ) .findFirst().orElse( new ObservationComponentComponent() ); } Dstu3ObservationFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull Dstu3FhirClientFhirToDhisTransformerUtils clientTransformUtils,
        @Nonnull Dstu3CodeFhirToDhisTransformerUtils codeTransformerUtils ); }
Dstu3ObservationFhirToDhisTransformerUtils extends AbstractObservationFhirToDhisTransformerUtils { @Override @Nullable public IBaseBackboneElement getBackboneElement( @Nullable List<? extends IBaseBackboneElement> backboneElements, @Nonnull String system, @Nonnull String code ) { if ( backboneElements == null ) { return null; } return backboneElements.stream().map( ObservationComponentComponent.class::cast ) .filter( c -> getCodeTransformerUtils().containsCode( c.getCode(), system, code ) ) .findFirst().orElse( new ObservationComponentComponent() ); } Dstu3ObservationFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull Dstu3FhirClientFhirToDhisTransformerUtils clientTransformUtils,
        @Nonnull Dstu3CodeFhirToDhisTransformerUtils codeTransformerUtils ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Nonnull @Override String getResourceName(); @Nullable @Override ICompositeType getCodes( @Nullable IBaseResource resource ); @Nullable @Override String getComponentText( @Nullable IBaseResource resource ); @Override @Nullable IBaseBackboneElement getBackboneElement( @Nullable List<? extends IBaseBackboneElement> backboneElements, @Nonnull String system, @Nonnull String code ); }
Dstu3ObservationFhirToDhisTransformerUtils extends AbstractObservationFhirToDhisTransformerUtils { @Override @Nullable public IBaseBackboneElement getBackboneElement( @Nullable List<? extends IBaseBackboneElement> backboneElements, @Nonnull String system, @Nonnull String code ) { if ( backboneElements == null ) { return null; } return backboneElements.stream().map( ObservationComponentComponent.class::cast ) .filter( c -> getCodeTransformerUtils().containsCode( c.getCode(), system, code ) ) .findFirst().orElse( new ObservationComponentComponent() ); } Dstu3ObservationFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull Dstu3FhirClientFhirToDhisTransformerUtils clientTransformUtils,
        @Nonnull Dstu3CodeFhirToDhisTransformerUtils codeTransformerUtils ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Nonnull @Override String getResourceName(); @Nullable @Override ICompositeType getCodes( @Nullable IBaseResource resource ); @Nullable @Override String getComponentText( @Nullable IBaseResource resource ); @Override @Nullable IBaseBackboneElement getBackboneElement( @Nullable List<? extends IBaseBackboneElement> backboneElements, @Nonnull String system, @Nonnull String code );  }