Collection<RDFResource> linearizationSpecs = icdContentModel.getLinearizationSpecifications(icdCategory);
for (RDFResource linearizationSpec : linearizationSpecs) {
RDFResource linearization = (RDFResource) linearizationSpec.getPropertyValue(icdContentModel.getLinearizationViewProperty());
RDFSNamedClass linearizationParent = (RDFSNamedClass) linearizationSpec.getPropertyValue(icdContentModel.getLinearizationParentProperty());
Boolean isIncludedInLinearization = (Boolean) linearizationSpec.getPropertyValue(icdContentModel.getIsIncludedInLinearizationProperty());
if(linearizationParent != null){
if(linearization.getBrowserText().equals(type)){
String code = this.getClassCode(linearizationParent);
if(code.equals("TBD")){
code = (String)this.mapGeneratedCodes.get(linearizationParent);
ret = code;
break;
}else{
ret = code;
break;
}
}
}else{ //no linear parent specified
RDFSNamedClass parent = this.getRandomSingleParent(icdCategory); // get random single parent
String code = this.getClassCode(parent);
if(code.equals("TBD")){
//if tbd, then get generated code
ret = (String) this.mapGeneratedCodes.get(parent);
}else{
ret = code;
}
}
}
}else{ //having single parent
RDFSNamedClass parent = this.getSingleParent(icdCategory);
String code = this.getClassCode(parent);
if(code.equals("TBD")){
//if tbd, then get generated code
ret = (String) this.mapGeneratedCodes.get(parent);