001package org.hl7.fhir.r5.utils;
002
003import java.lang.reflect.Field;
004import java.lang.reflect.Modifier;
005import java.util.ArrayList;
006import java.util.HashSet;
007import java.util.List;
008import java.util.Set;
009
010public class BuildExtensions extends ToolingExtensions {
011
012  public static final String EXT_DESCRIPTION = "http://hl7.org/fhir/build/StructureDefinition/description";
013  public static final String EXT_TITLE = "http://hl7.org/fhir/build/StructureDefinition/title";
014  public static final String EXT_EXAMPLE_TYPE = "http://hl7.org/fhir/build/CodeSystem/example-type";
015  public static final String EXT_NOT_REGISTERED = "http://hl7.org/fhir/build/StructureDefinition/registered";
016  public static final String EXT_IG = "http://hl7.org/fhir/build/StructureDefinition/ig";
017  public static final String EXT_EXAMPLE_FOR = "http://hl7.org/fhir/build/StructureDefinition/example-for";
018  public static final String EXT_PATH = "http://hl7.org/fhir/build/StructureDefinition/path";
019  public static final String EXT_FOOTER = "http://hl7.org/fhir/build/StructureDefinition/footer";
020  public static final String EXT_FOOTER2 = "http://hl7.org/fhir/build/StructureDefinition/footer2";
021  public static final String EXT_ENTERED_IN_ERROR_STATUS = "http://hl7.org/fhir/build/StructureDefinition/entered-in-error-status";
022  public static final String EXT_PROPOSED_ORDER = "http://hl7.org/fhir/build/StructureDefinition/proposed-order";
023  public static final String EXT_HINT = "http://hl7.org/fhir/build/StructureDefinition/hint";
024  public static final String EXT_LAYOUT = "http://hl7.org/fhir/build/StructureDefinition/layout";
025  public static final String EXT_TODO = "http://hl7.org/fhir/build/StructureDefinition/todo";
026  public static final String EXT_COMMITTEE_NOTES = "http://hl7.org/fhir/build/StructureDefinition/committee-notes";
027  public static final String EXT_UML_DIR = "http://hl7.org/fhir/build/StructureDefinition/uml-dir";
028  public static final String EXT_UML_BREAK = "http://hl7.org/fhir/build/StructureDefinition/uml-break";
029  public static final String EXT_SVG = "http://hl7.org/fhir/build/StructureDefinition/svg";
030  public static final String EXT_OCL = "http://hl7.org/fhir/build/StructureDefinition/ocl";
031  public static final String EXT_FIXED_NAME = "http://hl7.org/fhir/build/StructureDefinition/fixed-name";
032  public static final String EXT_TURTLE = "http://hl7.org/fhir/build/StructureDefinition/turtle";
033  public static final String EXT_NAME = "http://hl7.org/fhir/build/StructureDefinition/name";
034  public static final String EXT_V2_MAP = "http://hl7.org/fhir/build/StructureDefinition/v2-map";
035  public static final String EXT_V3_MAP = "http://hl7.org/fhir/build/StructureDefinition/v3-map";
036  public static final String EXT_URI = "http://hl7.org/fhir/build/StructureDefinition/uri";
037  public static final String EXT_WEBSITE = "http://hl7.org/fhir/build/StructureDefinition/website";
038  public static final String EXT_EMAIL = "http://hl7.org/fhir/build/StructureDefinition/email";
039  public static final String EXT_COPYRIGHT = "http://hl7.org/fhir/build/StructureDefinition/copyright";
040  public static final String EXT_STATUS = "http://hl7.org/fhir/build/StructureDefinition/status";
041  public static final String EXT_INTRODUCTION = "http://hl7.org/fhir/build/StructureDefinition/introduction";
042  public static final String EXT_NOTES = "http://hl7.org/fhir/build/StructureDefinition/notes";
043  public static final String EXT_CODE = "http://hl7.org/fhir/build/StructureDefinition/code";
044  public static final String EXT_TYPE = "http://hl7.org/fhir/build/StructureDefinition/type";
045//  public static final String EXT_EXPLANATION = "http://hl7.org/fhir/build/StructureDefinition/explanation";
046  public static final String EXT_NO_BINDING = "http://hl7.org/fhir/build/StructureDefinition/no-binding";
047  public static final String EXT_OP_EXAMPLE = "http://hl7.org/fhir/build/StructureDefinition/example";
048  public static final String EXT_OP_EXAMPLE_CONTENT = "content";
049  public static final String EXT_OP_EXAMPLE_COMMENT = "comment";
050  public static final String EXT_OP_EXAMPLE_RESPONSE = "response";
051  public static final String EXT_OP_EXAMPLE_LIST = "list";
052  public static final String EXT_TEMPLATE = "http://hl7.org/fhir/build/StructureDefinition/template";
053  public static final String EXT_BINDING_NAME = "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName";
054  
055
056  private static Set<String> cachedConsts;
057  
058  public static Set<String> allConsts() {
059    if (cachedConsts == null) {
060      Set<String> list = new HashSet<>();
061      for (Field field : BuildExtensions.class.getDeclaredFields()) {
062        int modifiers = field.getModifiers();
063        if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) {
064          try {
065            list.add(field.get(field.getType()).toString());
066          } catch (Exception e) {
067          }
068        }
069      }
070      list.addAll(ToolingExtensions.allConsts());
071      cachedConsts = list;
072    }
073    return cachedConsts;
074  }
075
076
077}