...
Fetch a location with the given source and code:
Code Block | ||||
---|---|---|---|---|
| ||||
Location location = metadataService.getItem(Location.class, "SOME-SOURCE", "CODE"); |
...
// should be implemented as: generic <T> getItem(T type, String source, String code); |
Fetch all visit types from the given source:
Code Block | ||||
---|---|---|---|---|
| ||||
List<VisitType> visitTypes = metadataService.getItems(VisitType.class, "SOME-SOURCE"); |
...
// should be implemented as: generic <T> getItems(T type, String source); |
Fetch all visit types for the given set:
Code Block | ||||
---|---|---|---|---|
| ||||
List<VisitType> visitTypes = metadataSerivce .getItems(VisitType.class, "SOME-SOURCE", "CODE"); |
...
// should be implemented as: generic <T> getItems(T type, String source, String code); |
...
// source = metadataSet.source.name, code = metadataSet.code |
Retire term:
Code Block | ||||
---|---|---|---|---|
| ||||
List<MetadataTerm> terms = metadataService.getMetadataTerms(location); |
...
metadataService.retireMapping(terms.get(0), "some reason"); |
Create term:
Code Block | ||||
---|---|---|---|---|
| ||||
MetadataSource source = metadataService.getSourceByName("SOME-SOURCE"); |
...
MetadataTerm term = new MetadataTerm(source, "CODE", location); |
...
metadataService.saveMetadataTerm(term); |
Create terms in bulk:
Code Block | ||||
---|---|---|---|---|
| ||||
List<MetadataTerm> terms = Arrays.asList(mapping1, mapping2, mapping3); |
...
metadataService.saveMetadataTerms(terms); |
Get term by source and code:
...
Code Block | ||||
---|---|---|---|---|
| ||||
MetadataTerm term = metadataService.getMetdataTerm(mappingSource, "CODE"); |
Get terms by source:
Code Block | ||||
---|---|---|---|---|
| ||||
List<MetadataTerm> terms = metadataService.getMetadataTerms(source); |
Get term by uuid:
...
Code Block | ||||
---|---|---|---|---|
| ||||
MetadataTerm mapping = metadataService.getMetadataTermByUuid(String uuid); |
Get source by uuid:
...
Code Block | ||||
---|---|---|---|---|
| ||||
MetadataSource source = metadataService.getMetadataSourceByUuid(String uuid); |
MetadataTerm, MetadataSource, MetadataSet should support all CRUD operations.
...