public boolean isPrimitive(String code) { return Utilities.existsInList(code, "boolean", "integer", "string", "decimal", "uri", "base64Binary", "instant", "date", "dateTime", "time", "code", "oid", "id", "markdown", "unsignedInt", "positiveInt", "xhtml", "url", "canonical"); // StructureDefinition sd = context.fetchTypeDefinition(code); // return sd != null && sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE; }
public static boolean convertsResource(String rt) { return Utilities.existsInList(rt, "Parameters", "Appointment", "AppointmentResponse", "AuditEvent", "Basic", "Binary", "Bundle", "CarePlan", "Communication", "CommunicationRequest", "Composition", "ConceptMap", "Condition", "CapabilityStatement", "DetectedIssue", "DeviceMetric", "DeviceUseStatement", "DiagnosticReport", "DocumentReference", "Encounter", "EnrollmentRequest", "EnrollmentResponse", "EpisodeOfCare", "FamilyMemberHistory", "Flag", "Group", "HealthcareService", "ImplementationGuide", "ListResource", "Location", "MedicationDispense", "MedicationStatement", "MessageHeader", "NamingSystem", "Observation", "OperationDefinition", "OperationOutcome", "Organization", "Patient", "Person", "Practitioner", "Questionnaire", "QuestionnaireResponse", "RiskAssessment", "Schedule", "SearchParameter", "Slot", "StructureDefinition", "Subscription", "Substance", "SupplyDelivery", "SupplyRequest", "TestScript", "ValueSet"); }
public static boolean isPrimitive(String code) { return Utilities.existsInList(code, "xhtml", "boolean", "integer", "string", "decimal", "uri", "base64Binary", "instant", "date", "dateTime", "time", "code", "oid", "id", "markdown", "unsignedInt", "positiveInt", "xhtml", "base64Binary"); }
private boolean isDataType(String value) { return Utilities.existsInList(value, "Identifier", "HumanName", "Address", "ContactPoint", "Timing", "SimpleQuantity", "Quantity", "Attachment", "Range", "Period", "Ratio", "CodeableConcept", "Coding", "SampledData", "Age", "Distance", "Duration", "Count", "Money"); }
private boolean isDataType(String value) { return Utilities.existsInList(value, "Identifier", "HumanName", "Address", "ContactPoint", "Timing", "SimpleQuantity", "Quantity", "Attachment", "Range", "Period", "Ratio", "CodeableConcept", "Coding", "SampledData", "Age", "Distance", "Duration", "Count", "Money"); }
public static boolean isPrimitive(String code) { return Utilities.existsInList(code, "boolean", "integer", "string", "decimal", "uri", "url", "canonical", "base64Binary", "instant", "date", "dateTime", "time", "code", "oid", "id", "markdown", "unsignedInt", "positiveInt", "xhtml"); } }
public static boolean convertsResource(String rt) { return Utilities.existsInList(rt, "Parameters", "Bundle", "CodeSystem", "CompartmentDefinition", "ConceptMap", "CapabilityStatement", "ImplementationGuide", "NamingSystem", "OperationDefinition", "OperationOutcome", "Questionnaire", "QuestionnaireResponse", "SearchParameter", "StructureDefinition", "StructureMap", "ValueSet"); }
private boolean isKeyProperty(String path) { return Utilities.existsInList(path, "Observation.code"); }
public boolean checkName() { if (!name.startsWith("$")) return true; else return Utilities.existsInList(name, "$this", "$total"); }
private String protoTypeForFhirType(String code) { if (Utilities.existsInList(code, "integer", "unsignedInt", "positiveInt")) return "int23"; else if (code.equals("boolean")) return "bool"; else return "string"; }
private String checkName(String name) { // if (name.contains(".")) //// throw new Exception("Illegal name "+name+": no '.'"); // if (name.contains(" ")) // throw new Exception("Illegal name "+name+": no spaces"); StringBuilder b = new StringBuilder(); for (char c : name.toCharArray()) { if (!Utilities.existsInList(c, '.', ' ', ':', '"', '\'', '(', ')', '&', '[', ']')) b.append(c); } return b.toString().toLowerCase(); }
private String getSystemType(String url) { if (url.startsWith("http://hl7.org/fhir/StructureDefinition/")) { String code = url.substring(40); if (Utilities.existsInList(code, "string", "boolean", "integer", "decimal", "dateTime", "time", "Quantity")) return FP_NS+Utilities.capitalize(code); } return null; }
private boolean isInlineDataType(List<TypeRefComponent> type) { return type.size() == 1 && !Utilities.existsInList(type.get(0).getCode(), "code", "string", "id", "oid", "markdown", "uri", "boolean", "decimal", "dateTime", "date", "instant", "time", "CodeableConcept", "Period", "Ratio", "HumanName", "Address", "ContactPoint", "Identifier", "integer", "positiveInt", "unsignedInt", "Coding", "Quantity", "Count", "Age", "Duration", "Distance", "Money", "Money", "Reference", "Duration", "base64Binary", "Attachment", "Age", "Range", "Timing", "Annotation", "SampledData", "Extension", "SampledData", "Narrative", "Resource", "Meta", "url", "canonical"); }
public boolean hasTarget() { return Utilities.existsInList(getCode(), "Reference", "canonical"); }
private boolean hasBindableType(ElementDefinition ed) { for (TypeRefComponent tr : ed.getType()) { if (Utilities.existsInList(tr.getCode(), "Coding", "CodeableConcept", "Quantity", "uri", "string", "code")) return true; } return false; }
private void ws() { while (Utilities.existsInList(peek(), ' ', '\t', '\r', 'n')) next(); }
private void primitiveValue(String name, Element item) throws IOException { if (name != null) json.name(name); String type = item.getType(); if (Utilities.existsInList(type, "boolean")) json.value(item.getValue().trim().equals("true") ? new Boolean(true) : new Boolean(false)); else if (Utilities.existsInList(type, "integer", "unsignedInt", "positiveInt")) json.value(new Integer(item.getValue())); else if (Utilities.existsInList(type, "decimal")) json.value(new BigDecimal(item.getValue())); else json.value(item.getValue()); }
public boolean hasType(String n) { String t = ProfiledType.ns(n); if (typesContains(t)) return true; if (Utilities.existsInList(n, "boolean", "string", "integer", "decimal", "Quantity", "dateTime", "time", "ClassInfo", "SimpleTypeInfo")) { t = FP_NS+Utilities.capitalize(n); if (typesContains(t)) return true; } return false; }
public boolean hasType(Set<String> tn) { for (String n: tn) { String t = ProfiledType.ns(n); if (typesContains(t)) return true; if (Utilities.existsInList(n, "boolean", "string", "integer", "decimal", "Quantity", "dateTime", "time", "ClassInfo", "SimpleTypeInfo")) { t = FP_NS+Utilities.capitalize(n); if (typesContains(t)) return true; } } return false; } public String describe() {
private Type readConstant(String s, FHIRLexer lexer) throws FHIRLexerException { if (Utilities.isInteger(s)) return new IntegerType(s); else if (Utilities.isDecimal(s)) return new DecimalType(s); else if (Utilities.existsInList(s, "true", "false")) return new BooleanType(s.equals("true")); else return new StringType(lexer.processConstant(s)); }