public Collection<String> getTypes() { TreeSet<String> results = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); try { Bundle bundle = ClientUtil.getFhirClient().search().forResource(ValueSet.class) .where(ValueSet.NAME.matchesExactly().value("DocumentType")).execute(); for (ValueSet vs : FhirUtil.getEntries(bundle, ValueSet.class)) { for (ValueSet.DefineConcept concept : vs.getDefine().getConcept()) { results.add(concept.getDisplay().toString()); } } } catch (Exception e) {} return results; } }
private static synchronized void loadServiceCategories() { if (serviceCategories == null) { Map<String, CodeableConcept> map = new LinkedHashMap<>(); Bundle bundle = ClientUtil.getFhirClient().search().forResource(ValueSet.class) .where(CodeSystem.NAME.matchesExactly().value("EncounterType")).returnBundle(Bundle.class).execute(); for (CodeSystem cs : FhirUtil.getEntries(bundle, CodeSystem.class)) { UriType system = cs.getUrlElement(); for (ConceptDefinitionComponent concept : cs.getConcept()) { CodeableConcept cc = new CodeableConcept(); Coding coding = cc.addCoding(); coding.setCode(concept.getCode()); coding.setDisplay(concept.getDisplay()); coding.setSystemElement(system); cc.setText(concept.getDefinition()); map.put(coding.getCode(), cc); } } serviceCategories = map; } return; }
private static synchronized void loadServiceCategories() { if (serviceCategories == null) { Map<String, CodeableConceptDt> map = new LinkedHashMap<String, CodeableConceptDt>(); Bundle bundle = ClientUtil.getFhirClient().search().forResource(ValueSet.class) .where(ValueSet.NAME.matchesExactly().value("EncounterType")).execute(); for (ValueSet vs : FhirUtil.getEntries(bundle, ValueSet.class)) { UriDt system = vs.getDefine().getSystemElement(); for (ValueSet.DefineConcept concept : vs.getDefine().getConcept()) { CodeableConceptDt cc = new CodeableConceptDt(); CodingDt coding = cc.addCoding(); coding.setCode(concept.getCode()); coding.setDisplay(concept.getDisplay()); coding.setSystem(system); cc.setText(concept.getDefinition()); map.put(coding.getCode(), cc); } } serviceCategories = map; } return; }