@Test public void updateAddressLocationAddress() { final Address address = new Address(); final Location location = new Location( 47.1, -23.2 ); utils.updateAddressLocation( address, location ); Assert.assertEquals( 1, address.getExtensionsByUrl( "http: Assert.assertEquals( 1, address.getExtensionsByUrl( "http: .getExtensionsByUrl( "longitude" ).size() ); Assert.assertEquals( BigDecimal.valueOf( 47.1 ), ( (DecimalType) address.getExtensionsByUrl( "http: .getExtensionsByUrl( "longitude" ).get( 0 ).getValue() ).getValueAsNumber() ); Assert.assertEquals( 1, address.getExtensionsByUrl( "http: .getExtensionsByUrl( "latitude" ).size() ); Assert.assertEquals( BigDecimal.valueOf( -23.2 ), ( (DecimalType) address.getExtensionsByUrl( "http: .getExtensionsByUrl( "latitude" ).get( 0 ).getValue() ).getValueAsNumber() ); }
@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() ) ) ); } }
R4GeoDhisToFhirTransformerUtils 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() ) ) ); } } }
R4GeoDhisToFhirTransformerUtils 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() ) ) ); } } R4GeoDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); }
R4GeoDhisToFhirTransformerUtils 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() ) ) ); } } R4GeoDhisToFhirTransformerUtils( @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 ); }
R4GeoDhisToFhirTransformerUtils 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() ) ) ); } } R4GeoDhisToFhirTransformerUtils( @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 );  }