@Test public void getNoLocation() { final Address address = new Address(); final Location location = utils.getLocation( address ); Assert.assertNull( location ); }
@Override @Nullable public Location getLocation( @Nonnull IElement element ) throws TransformerException { final Element e = (Element) element; final List<Extension> locationExtensions = e.getExtensionsByUrl( GEO_LOCATION_URI ); if ( locationExtensions.isEmpty() ) { return null; } if ( locationExtensions.size() > 1 ) { throw new TransformerMappingException( "Element " + e.fhirType() + " contains " + locationExtensions.size() + " GEO locations." ); } final Extension locationExtension = locationExtensions.get( 0 ); return new Location( getLocationComponentValue( e, locationExtension, LONGITUDE_URL ), getLocationComponentValue( e, locationExtension, LATITUDE_URL ) ); }
R4GeoFhirToDhisTransformerUtils extends AbstractGeoFhirToDhisTransformerUtils { @Override @Nullable public Location getLocation( @Nonnull IElement element ) throws TransformerException { final Element e = (Element) element; final List<Extension> locationExtensions = e.getExtensionsByUrl( GEO_LOCATION_URI ); if ( locationExtensions.isEmpty() ) { return null; } if ( locationExtensions.size() > 1 ) { throw new TransformerMappingException( "Element " + e.fhirType() + " contains " + locationExtensions.size() + " GEO locations." ); } final Extension locationExtension = locationExtensions.get( 0 ); return new Location( getLocationComponentValue( e, locationExtension, LONGITUDE_URL ), getLocationComponentValue( e, locationExtension, LATITUDE_URL ) ); } }
R4GeoFhirToDhisTransformerUtils extends AbstractGeoFhirToDhisTransformerUtils { @Override @Nullable public Location getLocation( @Nonnull IElement element ) throws TransformerException { final Element e = (Element) element; final List<Extension> locationExtensions = e.getExtensionsByUrl( GEO_LOCATION_URI ); if ( locationExtensions.isEmpty() ) { return null; } if ( locationExtensions.size() > 1 ) { throw new TransformerMappingException( "Element " + e.fhirType() + " contains " + locationExtensions.size() + " GEO locations." ); } final Extension locationExtension = locationExtensions.get( 0 ); return new Location( getLocationComponentValue( e, locationExtension, LONGITUDE_URL ), getLocationComponentValue( e, locationExtension, LATITUDE_URL ) ); } R4GeoFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); }
R4GeoFhirToDhisTransformerUtils extends AbstractGeoFhirToDhisTransformerUtils { @Override @Nullable public Location getLocation( @Nonnull IElement element ) throws TransformerException { final Element e = (Element) element; final List<Extension> locationExtensions = e.getExtensionsByUrl( GEO_LOCATION_URI ); if ( locationExtensions.isEmpty() ) { return null; } if ( locationExtensions.size() > 1 ) { throw new TransformerMappingException( "Element " + e.fhirType() + " contains " + locationExtensions.size() + " GEO locations." ); } final Extension locationExtension = locationExtensions.get( 0 ); return new Location( getLocationComponentValue( e, locationExtension, LONGITUDE_URL ), getLocationComponentValue( e, locationExtension, LATITUDE_URL ) ); } R4GeoFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override @Nullable Location getLocation( @Nonnull IElement element ); }
R4GeoFhirToDhisTransformerUtils extends AbstractGeoFhirToDhisTransformerUtils { @Override @Nullable public Location getLocation( @Nonnull IElement element ) throws TransformerException { final Element e = (Element) element; final List<Extension> locationExtensions = e.getExtensionsByUrl( GEO_LOCATION_URI ); if ( locationExtensions.isEmpty() ) { return null; } if ( locationExtensions.size() > 1 ) { throw new TransformerMappingException( "Element " + e.fhirType() + " contains " + locationExtensions.size() + " GEO locations." ); } final Extension locationExtension = locationExtensions.get( 0 ); return new Location( getLocationComponentValue( e, locationExtension, LONGITUDE_URL ), getLocationComponentValue( e, locationExtension, LATITUDE_URL ) ); } R4GeoFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override @Nullable Location getLocation( @Nonnull IElement element );  }