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

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


  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

TOP

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

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.