class SourcePatientIdentifierPIDTransformer implements PIDTransformer {

    @Override
    public List<String> toHL7(PatientInfo patientInfo) {
        notNull(patientInfo, "patientInfo cannot be null");

        List<String> result = new ArrayList<String>();
        for (Identifiable id : patientInfo.getIds()) {
            String part = Hl7v2Based.render(id);
            if (part != null) {
                result.add(part);
            }
        }

        return result.isEmpty() ? null : result;
    }

}