class DateOfBirthPIDTransformer implements PIDTransformer {

    @Override
    public void fromHL7(String hl7Data, PatientInfo patientInfo) {
        notNull(patientInfo, "patientInfo cannot be null");

        if (StringUtils.isEmpty(hl7Data)) {
            return;
        }
        int pos = hl7Data.indexOf('^');
        patientInfo.setDateOfBirth((pos > 0) ? hl7Data.substring(0, pos) : hl7Data);
    }

}