@Test public void noSecondGiven() { final HumanName humanName = new HumanName().addGiven( "Peter" ).setFamily( "Lobster" ); Assert.assertNull( utils.getSecondGiven( humanName ) ); }
@Nullable @Override public String getSecondGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().skip( 1 ).findFirst().map( PrimitiveType::getValue ).orElse( null ); }
Dstu3HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Nullable @Override public String getSecondGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().skip( 1 ).findFirst().map( PrimitiveType::getValue ).orElse( null ); } }
Dstu3HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Nullable @Override public String getSecondGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().skip( 1 ).findFirst().map( PrimitiveType::getValue ).orElse( null ); } Dstu3HumanNameFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull Dstu3DateTimeFhirToDhisTransformerUtils dateTimeTransformerUtils ); }
Dstu3HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Nullable @Override public String getSecondGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().skip( 1 ).findFirst().map( PrimitiveType::getValue ).orElse( null ); } Dstu3HumanNameFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull Dstu3DateTimeFhirToDhisTransformerUtils 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 ); }
Dstu3HumanNameFhirToDhisTransformerUtils extends AbstractHumanNameFhirToDhisTransformerUtils { @Nullable @Override public String getSecondGiven( @Nullable ICompositeType humanName ) { if ( ( humanName == null ) || ( (HumanName) humanName ).getGiven().isEmpty() ) { return null; } return ( (HumanName) humanName ).getGiven().stream().skip( 1 ).findFirst().map( PrimitiveType::getValue ).orElse( null ); } Dstu3HumanNameFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull Dstu3DateTimeFhirToDhisTransformerUtils 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 );  }