Package ca.uhn.fhir.model.dstu.resource

Examples of ca.uhn.fhir.model.dstu.resource.Profile$Query


  public synchronized Profile toProfile() {
    if (myProfileDef != null) {
      return myProfileDef;
    }

    Profile retVal = new Profile();
   
    RuntimeResourceDefinition def = this;

    if (StringUtils.isNotBlank(myId)) {
      retVal.setId(new IdDt(myId));
    }else {
      throw new ConfigurationException("Resource class " + getImplementingClass().getCanonicalName() + " has no ID specified");
    }
   
    // Scan for extensions
    scanForExtensions(retVal, def);
    Collections.sort(retVal.getExtensionDefn(), new Comparator<ExtensionDefn>() {
      @Override
      public int compare(ExtensionDefn theO1, ExtensionDefn theO2) {
        return theO1.getCode().compareTo(theO2.getCode());
      }
    });

    // Scan for children
    retVal.setName(getName());
    Structure struct = retVal.addStructure();
    LinkedList<String> path = new LinkedList<String>();

    StructureElement element = struct.addElement();
    element.getDefinition().setMin(1);
    element.getDefinition().setMax("1");

    fillProfile(struct, element, def, path, null);

    retVal.getStructure().get(0).getElement().get(0).getDefinition().addType().getCode().setValue("Resource");

    myProfileDef = retVal;

    return retVal;
  }
View Full Code Here


  public synchronized Profile toProfile() {
    if (myProfileDef != null) {
      return myProfileDef;
    }

    Profile retVal = new Profile();
   
    RuntimeResourceDefinition def = this;

    if (StringUtils.isBlank(myId)) {
      myId = getName().toLowerCase();
    }
   
    retVal.setId(new IdDt(myId));
   
    // Scan for extensions
    scanForExtensions(retVal, def);
    Collections.sort(retVal.getExtensionDefn(), new Comparator<ExtensionDefn>() {
      @Override
      public int compare(ExtensionDefn theO1, ExtensionDefn theO2) {
        return theO1.getCode().compareTo(theO2.getCode());
      }
    });

    // Scan for children
    retVal.setName(getName());
    Structure struct = retVal.addStructure();
    LinkedList<String> path = new LinkedList<String>();

    StructureElement element = struct.addElement();
    element.getDefinition().setMin(1);
    element.getDefinition().setMax("1");

    fillProfile(struct, element, def, path, null);

    retVal.getStructure().get(0).getElement().get(0).getDefinition().addType().getCode().setValue("Resource");

    myProfileDef = retVal;

    return retVal;
  }
View Full Code Here

  public synchronized Profile toProfile() {
    if (myProfileDef != null) {
      return myProfileDef;
    }

    Profile retVal = new Profile();
    RuntimeResourceDefinition def = this;

    // Scan for extensions
    scanForExtensions(retVal, def);
    Collections.sort(retVal.getExtensionDefn(), new Comparator<ExtensionDefn>() {
      @Override
      public int compare(ExtensionDefn theO1, ExtensionDefn theO2) {
        return theO1.getCode().compareTo(theO2.getCode());
      }
    });

    // Scan for children
    retVal.setName(getName());
    Structure struct = retVal.addStructure();
    LinkedList<String> path = new LinkedList<String>();

    StructureElement element = struct.addElement();
    element.getDefinition().setMin(1);
    element.getDefinition().setMax("1");

    fillProfile(struct, element, def, path, null);

    retVal.getStructure().get(0).getElement().get(0).getDefinition().addType().getCode().setValue("Resource");

    myProfileDef = retVal;

    return retVal;
  }
View Full Code Here

  public synchronized Profile toProfile() {
    if (myProfileDef != null) {
      return myProfileDef;
    }

    Profile retVal = new Profile();
    RuntimeResourceDefinition def = this;

    // Scan for extensions
    scanForExtensions(retVal, def);
    Collections.sort(retVal.getExtensionDefn(), new Comparator<ExtensionDefn>() {
      @Override
      public int compare(ExtensionDefn theO1, ExtensionDefn theO2) {
        return theO1.getCode().compareTo(theO2.getCode());
      }
    });

    // Scan for children
    retVal.setName(getName());
    Structure struct = retVal.addStructure();
    LinkedList<String> path = new LinkedList<String>();

    StructureElement element = struct.addElement();
    element.getDefinition().setMin(1);
    element.getDefinition().setMax("1");

    fillProfile(struct, element, def, path, null);

    retVal.getStructure().get(0).getElement().get(0).getDefinition().addType().getCode().setValue("Resource");

    myProfileDef = retVal;

    return retVal;
  }
View Full Code Here

  public synchronized Profile toProfile() {
    if (myProfileDef != null) {
      return myProfileDef;
    }

    Profile retVal = new Profile();
   
    RuntimeResourceDefinition def = this;

    if (StringUtils.isBlank(myId)) {
      myId = getName().toLowerCase();
    }
   
    retVal.setId(new IdDt(myId));
   
    // Scan for extensions
    scanForExtensions(retVal, def);
    Collections.sort(retVal.getExtensionDefn(), new Comparator<ExtensionDefn>() {
      @Override
      public int compare(ExtensionDefn theO1, ExtensionDefn theO2) {
        return theO1.getCode().compareTo(theO2.getCode());
      }
    });

    // Scan for children
    retVal.setName(getName());
    Structure struct = retVal.addStructure();
    LinkedList<String> path = new LinkedList<String>();

    StructureElement element = struct.addElement();
    element.getDefinition().setMin(1);
    element.getDefinition().setMax("1");

    fillProfile(struct, element, def, path, null);

    retVal.getStructure().get(0).getElement().get(0).getDefinition().addType().getCode().setValue("Resource");

    myProfileDef = retVal;

    return retVal;
  }
View Full Code Here

  private List<Tuple2<Query, Float>> prepareValidation(List<TrainingData.Rating> testRatings) {
    List<Tuple2<Query, Float>> validationList = new ArrayList<Tuple2<Query, Float>>();

    for (TrainingData.Rating r : testRatings) {
      validationList.add(new Tuple2<Query, Float>(
        new Query(r.uid, r.iid),
        r.rating));
    }

    return validationList;
  }
View Full Code Here

        ParameterizedType returnType = (ParameterizedType) t;
        final Type[] h = returnType.getActualTypeArguments();
        assert(h.length == 1);
        assert(h[0] instanceof Class);
        Class c = (Class) h[0];
        Query q = handle.createQuery(s.value()).map(c);
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, q, args);
        return f.doit(q);
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private Object handleInstance(Select s, Method method, Object[] args)
    {
        Query q = handle.createQuery(s.value()).map(method.getReturnType());
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, q, args);
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, q, args);
        q.setMaxRows(1);
        return q.first();
    }
View Full Code Here

            return new SqlStatementCustomizer()
            {
                @Override
                public void apply(SQLStatement s) throws SQLException
                {
                   Query q = (Query) s;
                   NamingStrategy dbNamingStrategy = ((MapResultForSnakeCaseAsBean) annotation).dbNamingStrategy();
                   NamingStrategy fieldNamingStrategy = ((MapResultForSnakeCaseAsBean) annotation).fieldNamingStrategy();
                   q.registerMapper(new FormatterAwareBeanMapperFactory(dbNamingStrategy,fieldNamingStrategy));
                }
            };
        }
View Full Code Here

        @Override
        public SqlStatementCustomizer createForMethod(final Annotation annotation, Class sqlObjectType, Method method) {
            return new SqlStatementCustomizer() {
                @Override
                public void apply(SQLStatement s) throws SQLException {
                    Query q = (Query) s;
                    q.registerMapper(new TranslationAwareBeanMapperFactory());
                }
            };
        }
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.dstu.resource.Profile$Query

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.