class PatientInfoTransformer {

    public PatientInfo fromHL7(List<String> hl7PID) {
        if (hl7PID == null || hl7PID.isEmpty()) {
            return null;
        }
        
        PatientInfo patientInfo = new PatientInfo();
        
        for (String hl7PIDLine : hl7PID) {
            String[] fields = PipeParser.split(hl7PIDLine.trim(), "|");
            if (fields.length == 2) {
                Integer pidNo = getPidNumber(fields[0]);
                PIDTransformer transformer = pidTransformers.get(pidNo);
                if (transformer != null) {            
                    transformer.fromHL7(fields[1], patientInfo);
                }
            }
        }
        
        return patientInfo;
    }

}