@Test public void firstGiven() { final HumanName humanName = new HumanName().addGiven( "Peter" ).addGiven( "Francis" ).addGiven( "Alice" ).setFamily( "Lobster" ); Assert.assertEquals( "Peter", utils.getFirstGiven( humanName ) ); }
@Override @Nullable public String getFirstGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().findFirst().map( PrimitiveType::getValue ).orElse( null ); }
R4HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Override @Nullable public String getFirstGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().findFirst().map( PrimitiveType::getValue ).orElse( null ); } }
R4HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Override @Nullable public String getFirstGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().findFirst().map( PrimitiveType::getValue ).orElse( null ); } R4HumanNameFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull R4DateTimeFhirToDhisTransformerUtils dateTimeTransformerUtils ); }
R4HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Override @Nullable public String getFirstGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().findFirst().map( PrimitiveType::getValue ).orElse( null ); } R4HumanNameFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull R4DateTimeFhirToDhisTransformerUtils dateTimeTransformerUtils ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override @Nullable String getSingleGiven( @Nullable ICompositeType humanName ); @Override @Nullable String getFirstGiven( @Nullable ICompositeType humanName ); @Nullable @Override String getSecondGiven( @Nullable ICompositeType humanName ); @Override @Nullable HumanName getPrimaryName( @Nonnull List<? extends ICompositeType> names ); }
R4HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Override @Nullable public String getFirstGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().findFirst().map( PrimitiveType::getValue ).orElse( null ); } R4HumanNameFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull R4DateTimeFhirToDhisTransformerUtils dateTimeTransformerUtils ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override @Nullable String getSingleGiven( @Nullable ICompositeType humanName ); @Override @Nullable String getFirstGiven( @Nullable ICompositeType humanName ); @Nullable @Override String getSecondGiven( @Nullable ICompositeType humanName ); @Override @Nullable HumanName getPrimaryName( @Nonnull List<? extends ICompositeType> names );  }