use of org.hl7.fhir.r4.model.SearchParameter in project org.hl7.fhir.core by hapifhir.
the class GraphQLSchemaGenerator method generateListAccess.
private void generateListAccess(BufferedWriter writer, List<SearchParameter> parameters, String name) throws IOException {
writer.write("type " + name + "ListType {\r\n");
writer.write(" " + name + "List(");
param(writer, "_filter", "String", false, false);
for (SearchParameter sp : parameters) param(writer, sp.getName().replace("-", "_"), getGqlname(sp.getType().toCode()), true, true);
param(writer, "_sort", "String", false, true);
param(writer, "_count", "Int", false, true);
param(writer, "_cursor", "String", false, true);
writer.write("): [" + name + "]\r\n");
writer.write("}\r\n");
writer.write("\r\n");
}
use of org.hl7.fhir.r4.model.SearchParameter in project org.hl7.fhir.core by hapifhir.
the class GraphQLSchemaGenerator method generateConnectionAccessQuery.
public void generateConnectionAccessQuery(Writer writer, List<SearchParameter> parameters, String name) throws IOException {
writer.write(name + "Conection(");
param(writer, "_filter", "String", false, false);
for (SearchParameter sp : parameters) param(writer, sp.getName().replace("-", "_"), getGqlname(requireNonNull(sp.getType().toCode())), true, true);
param(writer, "_sort", "String", false, true);
param(writer, "_count", "Int", false, true);
param(writer, "_cursor", "String", false, true);
writer.write("): " + name + "Connection\r\n");
}
use of org.hl7.fhir.r4.model.SearchParameter in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeSearchParameterSearchParameterContactComponent.
protected void composeSearchParameterSearchParameterContactComponent(Complex parent, String parentType, String name, SearchParameter.SearchParameterContactComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "contact", name, element, index);
if (element.hasNameElement())
composeString(t, "SearchParameter", "name", element.getNameElement(), -1);
for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "SearchParameter", "telecom", element.getTelecom().get(i), i);
}
use of org.hl7.fhir.r4.model.SearchParameter in project org.hl7.fhir.core by hapifhir.
the class OpenApiGenerator method generateSearch.
private void generateSearch(CapabilityStatementRestResourceComponent r) {
OperationWriter op = makePathResType(r).operation("get");
op.summary("Search all resources of type " + r.getType() + " based on a set of criteria");
op.operationId("search" + r.getType());
opOutcome(op.responses().defaultResponse());
ResponseObjectWriter resp = op.responses().httpResponse("200");
resp.description("the resource being returned");
if (isJson())
resp.content("application/fhir+json").schemaRef(specRef() + "/fhir.schema.json#/definitions/Bundle");
if (isXml())
resp.content("application/fhir+xml").schemaRef(specRef() + "/Bundle.xsd");
// todo: how do we know that these apply?
op.paramRef("#/components/parameters/format");
op.paramRef("#/components/parameters/pretty");
op.paramRef("#/components/parameters/summary");
op.paramRef("#/components/parameters/elements");
Set<String> set = new HashSet<>();
for (CapabilityStatementRestResourceSearchParamComponent spc : r.getSearchParam()) {
if (!set.contains(spc.getName())) {
set.add(spc.getName());
ParameterWriter p = op.parameter(spc.getName());
p.in(ParameterLocation.query).description(spc.getDocumentation());
p.schema().type(getSchemaType(spc.getType()));
if (spc.hasDefinition()) {
SearchParameter sp = context.fetchResource(SearchParameter.class, spc.getDefinition());
if (sp != null) {
p.description(sp.getDescription());
}
}
}
}
}
use of org.hl7.fhir.r4.model.SearchParameter in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeSearchParameterSearchParameterComponentComponent.
protected void composeSearchParameterSearchParameterComponentComponent(Complex parent, String parentType, String name, SearchParameter.SearchParameterComponentComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "component", name, element, index);
if (element.hasDefinitionElement())
composeCanonical(t, "SearchParameter", "definition", element.getDefinitionElement(), -1);
if (element.hasExpressionElement())
composeString(t, "SearchParameter", "expression", element.getExpressionElement(), -1);
}
Aggregations