Identifier identifier = factory.createIdentifier();
identifier.setAuthority("WHO");
identifier.setUid("id-to-be-added-later");
claml.getIdentifier().add(identifier);
Meta meta = factory.createMeta();
meta.setName("lang");
meta.setValue("en");
claml.getMeta().add(meta);
Meta metaTop = factory.createMeta();
metaTop.setName("TopLevelSort");
metaTop.setValue("I II III IV V VI VII VIII IX X XI XII XIII XIV XV XVI XVII XVIII XIX XX XXI XXII");
claml.getMeta().add(metaTop);
ClassKinds clsKinds = factory.createClassKinds();
ClassKind cKind1 = factory.createClassKind();
cKind1.setName("chapter");
clsKinds.getClassKind().add(cKind1);
ClassKind cKind2 = factory.createClassKind();
cKind2.setName("block");
clsKinds.getClassKind().add(cKind2);
ClassKind cKind3 = factory.createClassKind();
cKind3.setName("category");
clsKinds.getClassKind().add(cKind3);
//ClassKind cKind4 = factory.createClassKind();
//cKind4.setName("modifiedcategory");
//clsKinds.getClassKind().add(cKind4);
claml.setClassKinds(clsKinds);
/*
UsageKinds useKinds = factory.createUsageKinds();
UsageKind useKind = factory.createUsageKind();
useKind.setMark("!");
useKind.setName("optional");
useKinds.getUsageKind().add(useKind);
claml.setUsageKinds(useKinds);
*/
RubricKinds rubKinds = factory.createRubricKinds();
//preferred
RubricKind rKind1 = factory.createRubricKind();
rKind1.setInherited("false");
rKind1.setName(icdContentModel.getPreferredProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind1);
//synonym property
/*
RubricKind rKind1_1 = factory.createRubricKind();
rKind1_1.setInherited("false");
rKind1_1.setName(icdContentModel.getSynonymProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind1_1);
*/
//definition property
RubricKind rKind1_2 = factory.createRubricKind();
rKind1_2.setInherited("false");
rKind1_2.setName(icdContentModel.getDefinitionProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind1_2);
//prefilled definition property
/*
RubricKind rKind1_3 = factory.createRubricKind();
rKind1_3.setInherited("false");
rKind1_3.setName(icdContentModel.getPrefilledDefinitionProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind1_3);
*/
//inclusion
RubricKind rKind2 = factory.createRubricKind();
rKind2.setInherited("false");
rKind2.setName(icdContentModel.getInclusionProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind2);
//exclusion
RubricKind rKind3 = factory.createRubricKind();
rKind3.setInherited("false");
rKind3.setName(icdContentModel.getExclusionProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind3);
//note property
RubricKind rKind5 = factory.createRubricKind();
rKind5.setInherited("false");
rKind5.setName(icdContentModel.getNoteProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind5);
//MorbidityParent property
/*
RubricKind rKind6 = factory.createRubricKind();
rKind6.setInherited("false");
rKind6.setName(icdContentModel.getMorbidityParentProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind6);
*/
//coding hint property
RubricKind rKind7 = factory.createRubricKind();
rKind7.setInherited("false");
rKind7.setName(icdContentModel.getCodingHintProperty().getBrowserText());
rubKinds.getRubricKind().add(rKind7);
//icd Reference property
//RubricKind rKind9 = factory.createRubricKind();
//rKind9.setInherited("false");
//rKind9.setName(icdContentModel.getIcdRefProperty().getBrowserText());
//rubKinds.getRubricKind().add(rKind9);
//set rubric kinds
claml.setRubricKinds(rubKinds);
//iterating icd categories
int index = 1;
for(Iterator it = icdCategories.iterator(); it.hasNext();){
RDFSNamedClass icdCategory = (RDFSNamedClass) it.next();
if(this.mapGeneratedCodes.containsKey(icdCategory)){ //only those categories with codes
//is included?
//if(this.isIncludedInLinearizationForType(icdCategory, linearizationType)){
//RDFSNamedClass icdCategory = icdContentModel.getICDCategory("http://who.int/icd#I82.0");
//System.out.println("Displayed as in the tree: " + icdCategory.getBrowserText());
//System.out.println(index++ + "|" + icdCategory.getBrowserText());
edu.mayo.bmi.guoqian.claml.Class cls = factory.createClass();
/*
//get original code, if not availabel it is "TBD"
String classCode = getClassCode(icdCategory);
//if the code is "TBD", then find it from generated codes
if(classCode.equals("TBD")){
String generatedCode = (String)this.mapGeneratedCodes.get(icdCategory);
if(generatedCode != null){
classCode = generatedCode;
}else{// in case, no code generated
System.out.println("Code not generated for:" + icdCategory.getBrowserText());
}
}
*/
String classCode = (String) this.mapGeneratedCodes.get(icdCategory);
cls.setCode(classCode);
String cKindName = getClassKind(icdCategory);
ClassKind cKind = factory.createClassKind();
cKind.setName(cKindName);
cls.setKind(cKind);
//meta icat id
Meta metaICatId = factory.createMeta();
metaICatId.setName("iCatID");
metaICatId.setValue(icdCategory.getName());
cls.getMeta().add(metaICatId);
/*
//superclass codes