Exemplo n.º 1
0
 /** Gets or creates a Concept with a given UUID and name. */
 public static Concept getConcept(String name, String uuid, String typeUuid) {
   ConceptService conceptService = Context.getConceptService();
   Concept concept = conceptService.getConceptByUuid(uuid);
   if (concept == null) {
     concept = new Concept();
     concept.setUuid(uuid);
     concept.setShortName(new ConceptName(name, new Locale("en")));
     concept.setDatatype(conceptService.getConceptDatatypeByUuid(typeUuid));
     concept.setConceptClass(conceptService.getConceptClassByUuid(ConceptClass.MISC_UUID));
     conceptService.saveConcept(concept);
   }
   return concept;
 }