use of org.hl7.gravity.refimpl.sdohexchange.fhir.factory.characteristic.RecordedSexGenderBundleFactory in project Gravity-SDOH-Exchange-RI by FHIR.
the class PersonalCharacteristicsService method createSexGenderBundleFactory.
private PersonalCharacteristicBundleFactory createSexGenderBundleFactory(NewPersonalCharacteristicDto dto) {
RecordedSexGenderBundleFactory genderIdentityBundleFactory = new RecordedSexGenderBundleFactory(dto.getType(), dto.getMethod(), SexGenderCode.fromCode(dto.getValue()));
genderIdentityBundleFactory.setValueDetail(dto.getValueDetail());
// The derived from file must be set but this is validated right in the bundle factory.
if (dto.getDerivedFrom() != null) {
genderIdentityBundleFactory.setDerivedFromFileName(dto.getDerivedFrom().getName());
genderIdentityBundleFactory.setDerivedFromFile(Base64.getDecoder().decode(dto.getDerivedFrom().getBase64Content()));
}
return genderIdentityBundleFactory;
}
Aggregations