org.hl7.fhir.dstu3.model.Bundle.getMeta()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.hl7.fhir.dstu3.model.Bundle.getMeta()方法的一些代码示例,展示了Bundle.getMeta()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.getMeta()方法的具体详情如下:
包路径:org.hl7.fhir.dstu3.model.Bundle
类名称:Bundle
方法名:getMeta

Bundle.getMeta介绍

暂无

代码示例

代码示例来源:origin: jamesagnew/hapi-fhir

public Bundle convert(InputStream stream) throws Exception {
  cda = new CDAUtilities(stream);
  doc = cda.getElement();
  cda.checkTemplateId(doc, "2.16.840.1.113883.10.20.22.1.1");
  convert = new Convert(cda, ucumSvc, "Z");
  // check it's a CDA/CCD
  feed = new Bundle();
  feed.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
  feed.setId(makeUUIDReference());
  feed.getMeta().getTag().add(new Coding()); // todo-bundle  ("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/document", "Document"));
  // process the header
  makeDocument();
  composition.setSubject(Factory.makeReference(makeSubject()));
  for (Element e : cda.getChildren(doc, "author"))
    composition.getAuthor().add(Factory.makeReference(makeAuthor(e)));
  // todo: data enterer & informant goes in provenance
  composition.setCustodian(Factory.makeReference(makeOrganization(
      cda.getDescendent(doc, "custodian/assignedCustodian/representedCustodianOrganization"), "Custodian")));
  // todo: informationRecipient
  for (Element e : cda.getChildren(doc, "legalAuthenticator"))
    composition.getAttester().add(makeAttester(e, CompositionAttestationMode.LEGAL, "Legal Authenticator"));
  for (Element e : cda.getChildren(doc, "authenticator"))
    composition.getAttester().add(makeAttester(e, CompositionAttestationMode.PROFESSIONAL, "Authenticator"));
  // process the contents
  // we do this by section - keep the original section order
  Element body =  cda.getDescendent(doc, "component/structuredBody");
  processComponentSections(composition.getSection(), body);
  return feed;
}

代码示例来源:origin: org.openehealth.ipf.commons/ipf-commons-ihe-fhir-stu3-core

/**
   * @param object bundle
   * @return true if one of the {@link #profileUris} are present in the Bundle's meta.profile
   */
  @Override
  public boolean test(Object object) {
    Bundle bundle = (Bundle) object;
    boolean result = bundle.getMeta().getProfile().stream()
        .map(UriType::getValueAsString)
        .anyMatch(profileUris::contains);
    return result;
  }
}

代码示例来源:origin: org.openehealth.ipf.commons/ipf-commons-ihe-fhir-stu3-mhd

/**
 * Validates bundle type, meta data and consistency of contained resources
 *
 * @param bundle transaction bundle
 */
protected void validateTransactionBundle(Bundle bundle) {
  if (!Bundle.BundleType.TRANSACTION.equals(bundle.getType())) {
    throw FhirUtils.unprocessableEntity(
        OperationOutcome.IssueSeverity.ERROR,
        OperationOutcome.IssueType.INVALID,
        null, null,
        "Bundle type must be %s, but was %s",
        Bundle.BundleType.TRANSACTION.toCode(), bundle.getType().toCode());
  }
  List<UriType> profiles = bundle.getMeta().getProfile();
  if (profiles.isEmpty() || !Iti65Constants.ITI65_PROFILE.equals(profiles.get(0).getValue())) {
    throw FhirUtils.unprocessableEntity(
        OperationOutcome.IssueSeverity.ERROR,
        OperationOutcome.IssueType.INVALID,
        null, null,
        "Request bundle must have profile",
        Iti65Constants.ITI65_PROFILE);
  }
}

代码示例来源:origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

protected Bundle thisSucks() {
  Bundle bundle = new Bundle().setType(Bundle.BundleType.TRANSACTION);
  bundle.getMeta().addProfile("http://thissucks.com");
  return bundle;
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

@Override
public void addRootPropertiesToBundle(String theId, String theServerBase, String theLinkSelf, String theLinkPrev, String theLinkNext, Integer theTotalResults, BundleTypeEnum theBundleType,
                   IPrimitiveType<Date> theLastUpdated) {
 ensureBundle();
 myBase = theServerBase;
 if (myBundle.getIdElement().isEmpty()) {
  myBundle.setId(theId);
 }
 if (myBundle.getIdElement().isEmpty()) {
  myBundle.setId(UUID.randomUUID().toString());
 }
 if (myBundle.getMeta().getLastUpdated() == null && theLastUpdated != null) {
  myBundle.getMeta().getLastUpdatedElement().setValueAsString(theLastUpdated.getValueAsString());
 }
 if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkSelf)) {
  myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theLinkSelf);
 }
 if (!hasLink(Constants.LINK_NEXT, myBundle) && isNotBlank(theLinkNext)) {
  myBundle.addLink().setRelation(Constants.LINK_NEXT).setUrl(theLinkNext);
 }
 if (!hasLink(Constants.LINK_PREVIOUS, myBundle) && isNotBlank(theLinkPrev)) {
  myBundle.addLink().setRelation(Constants.LINK_PREVIOUS).setUrl(theLinkPrev);
 }
 if (myBundle.getTypeElement().isEmpty() && theBundleType != null) {
  myBundle.getTypeElement().setValueAsString(theBundleType.getCode());
 }
 if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) {
  myBundle.getTotalElement().setValue(theTotalResults);
 }
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-converter

public Bundle convert(InputStream stream) throws Exception {
  cda = new CDAUtilities(stream);
  doc = cda.getElement();
  cda.checkTemplateId(doc, "2.16.840.1.113883.10.20.22.1.1");
  convert = new Convert(cda, ucumSvc, "Z");
  // check it's a CDA/CCD
  feed = new Bundle();
  feed.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
  feed.setId(makeUUIDReference());
  feed.getMeta().getTag().add(new Coding()); // todo-bundle  ("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/document", "Document"));
  // process the header
  makeDocument();
  composition.setSubject(Factory.makeReference(makeSubject()));
  for (Element e : cda.getChildren(doc, "author"))
    composition.getAuthor().add(Factory.makeReference(makeAuthor(e)));
  // todo: data enterer & informant goes in provenance
  composition.setCustodian(Factory.makeReference(makeOrganization(
      cda.getDescendent(doc, "custodian/assignedCustodian/representedCustodianOrganization"), "Custodian")));
  // todo: informationRecipient
  for (Element e : cda.getChildren(doc, "legalAuthenticator"))
    composition.getAttester().add(makeAttester(e, CompositionAttestationMode.LEGAL, "Legal Authenticator"));
  for (Element e : cda.getChildren(doc, "authenticator"))
    composition.getAttester().add(makeAttester(e, CompositionAttestationMode.PROFESSIONAL, "Authenticator"));
  // process the contents
  // we do this by section - keep the original section order
  Element body =  cda.getDescendent(doc, "component/structuredBody");
  processComponentSections(composition.getSection(), body);
  return feed;
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

myBundle.getMeta().setLastUpdated(new Date());

代码示例来源:origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

protected Bundle provideAndRegister() throws Exception {
  Bundle bundle = new Bundle().setType(Bundle.BundleType.TRANSACTION);
  bundle.getMeta().addProfile(Iti65Constants.ITI65_PROFILE);

相关文章