@Test public void updateAddressLocationRemoved() { final Address address = new Address(); address.addExtension().setUrl( "http: utils.updateAddressLocation( address, null ); Assert.assertEquals( 0, address.getExtensionsByUrl( "http: }
@Override public void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ) throws TransformerException { final Element e = (Element) element; e.getExtension().removeIf( i -> GEO_LOCATION_URI.equals( i.getUrl() ) ); if ( location != null ) { e.addExtension().setUrl( GEO_LOCATION_URI ) .addExtension( new Extension().setUrl( LATITUDE_URL ) .setValue( new DecimalType( location.getLatitude() ) ) ) .addExtension( new Extension().setUrl( LONGITUDE_URL ) .setValue( new DecimalType( location.getLongitude() ) ) ); } }
Dstu3GeoDhisToFhirTransformerUtils extends AbstractGeoDhisToFhirTransformerUtils { @Override public void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ) throws TransformerException { final Element e = (Element) element; e.getExtension().removeIf( i -> GEO_LOCATION_URI.equals( i.getUrl() ) ); if ( location != null ) { e.addExtension().setUrl( GEO_LOCATION_URI ) .addExtension( new Extension().setUrl( LATITUDE_URL ) .setValue( new DecimalType( location.getLatitude() ) ) ) .addExtension( new Extension().setUrl( LONGITUDE_URL ) .setValue( new DecimalType( location.getLongitude() ) ) ); } } }
Dstu3GeoDhisToFhirTransformerUtils extends AbstractGeoDhisToFhirTransformerUtils { @Override public void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ) throws TransformerException { final Element e = (Element) element; e.getExtension().removeIf( i -> GEO_LOCATION_URI.equals( i.getUrl() ) ); if ( location != null ) { e.addExtension().setUrl( GEO_LOCATION_URI ) .addExtension( new Extension().setUrl( LATITUDE_URL ) .setValue( new DecimalType( location.getLatitude() ) ) ) .addExtension( new Extension().setUrl( LONGITUDE_URL ) .setValue( new DecimalType( location.getLongitude() ) ) ); } } Dstu3GeoDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); }
Dstu3GeoDhisToFhirTransformerUtils extends AbstractGeoDhisToFhirTransformerUtils { @Override public void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ) throws TransformerException { final Element e = (Element) element; e.getExtension().removeIf( i -> GEO_LOCATION_URI.equals( i.getUrl() ) ); if ( location != null ) { e.addExtension().setUrl( GEO_LOCATION_URI ) .addExtension( new Extension().setUrl( LATITUDE_URL ) .setValue( new DecimalType( location.getLatitude() ) ) ) .addExtension( new Extension().setUrl( LONGITUDE_URL ) .setValue( new DecimalType( location.getLongitude() ) ) ); } } Dstu3GeoDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ); @Nullable @Override IBaseBackboneElement createPosition( @Nullable Location location ); }
Dstu3GeoDhisToFhirTransformerUtils extends AbstractGeoDhisToFhirTransformerUtils { @Override public void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ) throws TransformerException { final Element e = (Element) element; e.getExtension().removeIf( i -> GEO_LOCATION_URI.equals( i.getUrl() ) ); if ( location != null ) { e.addExtension().setUrl( GEO_LOCATION_URI ) .addExtension( new Extension().setUrl( LATITUDE_URL ) .setValue( new DecimalType( location.getLatitude() ) ) ) .addExtension( new Extension().setUrl( LONGITUDE_URL ) .setValue( new DecimalType( location.getLongitude() ) ) ); } } Dstu3GeoDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override void updateAddressLocation( @Nonnull IElement element, @Nullable Location location ); @Nullable @Override IBaseBackboneElement createPosition( @Nullable Location location );  }