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

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


  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

    Section total = new Section( totalRanges);
    Array result = Array.factory(inner.getDataType(), total.getShape());

    // must be a Structure
    Structure outer = (Structure) cer.v;
    Structure outerSubset = outer.select( cer.child.v.getShortName()); // allows IOSPs to optimize for  this case
    ArrayStructure outerData = (ArrayStructure) outerSubset.read(cer.section);
    extractSection( cer.child, outerData, result.getIndexIterator());

    result.setUnsigned(cer.v.isUnsigned());
    return result;
  }
View Full Code Here

  protected Array readData(ucar.nc2.Variable v, Section section) throws IOException, InvalidRangeException {
    if (unlocked)
      throw new IllegalStateException("File is unlocked - cannot use");

    if (v.getDataType() == DataType.SEQUENCE) {
      Structure s = (Structure) v;
      StructureDataIterator siter = getStructureIterator(s, -1);
      return new ArraySequence(s.makeStructureMembers(), siter, -1);
    }

    StringBuilder sbuff = new StringBuilder(remoteURI);
    sbuff.append("?var=");
    Formatter f = new Formatter();
View Full Code Here

    if (debug) System.out.println("  readData data len= " + dsize);
    byte[] datab = new byte[dsize];
    NcStream.readFully(is, datab);

    if (dataType == DataType.STRUCTURE) {
      Structure s = (Structure) ncfile.findVariable(dproto.getVarName());
      StructureMembers members = s.makeStructureMembers();

      if (dproto.getVersion() == 0) {
        ArrayStructureBB.setOffsets(members); // not setting heap objects for version 0
        ArrayStructureBB data = new ArrayStructureBB(members, section.getShape(), ByteBuffer.wrap(datab), 0);
        return new DataResult(dproto.getVarName(), section, data);
View Full Code Here

    byte[] dp = new byte[psize];
    NcStream.readFully(is, dp);
    NcStreamProto.Data dproto = NcStreamProto.Data.parseFrom(dp);
    // if (debug) System.out.println(" readData proto = " + dproto);

    Structure s = (Structure) ncfile.findVariable(dproto.getVarName());
    StructureMembers members = s.makeStructureMembers();
    ArrayStructureBB.setOffsets(members);

    return new StreamDataIterator(is, members);
  }
View Full Code Here

    long start = System.currentTimeMillis();

    NetcdfFile ncfile = NetcdfFile.open(filename);
    ncfile.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);

    Structure record = (Structure) ncfile.findVariable("record");
    List<Variable> members = record.getVariables();
    for (Variable v : members) {
      if (v.getDataType() != DataType.CHAR)
        new MetarField(v.getShortName());
    }

    StructureDataIterator siter = record.getStructureIterator();
    int count = 0;
    while (siter.hasNext()) {
      StructureData sdata = siter.next();
      List<StructureMembers.Member> sm = sdata.getMembers();
      for (StructureMembers.Member m : sm) {
View Full Code Here

TOP

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

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.