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

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

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

Bundle.setId介绍

暂无

代码示例

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

protected void makeDocument() throws Exception {
  composition = (Composition) ResourceFactory.createResource("Composition");
  addReference(composition, "Composition", makeUUIDReference());
  Element title = cda.getChild(doc, "title");
  composition.setTitle(title.getTextContent());
  if (cda.getChild(doc, "setId") != null) {
    feed.setId(convert.makeURIfromII(cda.getChild(doc, "id")));
    composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "setId")));
  } else
    composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "id"))); // well, we fall back to id
  composition.setDateElement(convert.makeDateTimeFromTS(cda.getChild(doc, "effectiveTime")));
  composition.setType(convert.makeCodeableConceptFromCD(cda.getChild(doc, "code")));
  composition.setConfidentiality(convertConfidentiality(cda.getChild(doc, "confidentialityCode")));
  if (cda.getChild(doc, "confidentialityCode") != null)
    composition.setLanguage(cda.getChild(doc, "confidentialityCode").getAttribute("value")); // todo - fix streaming for this
  Element ee = cda.getChild(doc, "componentOf");
  if (ee != null)
    ee = cda.getChild(ee, "encompassingEncounter");
  if (ee != null) {
    Encounter visit = new Encounter();
    for (Element e : cda.getChildren(ee, "id"))
      visit.getIdentifier().add(convert.makeIdentifierFromII(e));
    visit.setPeriod(convert.makePeriodFromIVL(cda.getChild(ee, "effectiveTime")));
    composition.getEvent().add(new Composition.CompositionEventComponent());
    composition.getEvent().get(0).getCode().add(convert.makeCodeableConceptFromCD(cda.getChild(ee, "code")));
    composition.getEvent().get(0).setPeriod(visit.getPeriod());
    composition.getEvent().get(0).getDetail().add(Factory.makeReference(addReference(visit, "Encounter", makeUUIDReference())));
  }
  // main todo: fill out the narrative, but before we can do that, we have to convert everything else
}

代码示例来源: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: apache/ctakes

/**
* {@inheritDoc}
*/
@Override
public Bundle createResource( final JCas jCas, final TOP nullified, final FhirPractitioner practitioner,
               final FhirNoteSpecs noteSpecs ) {
 final Bundle bundle = new Bundle();
 final String noteTime = DATE_FORMAT.format( new Date() );
 bundle.setId( FhirElementFactory.createId( jCas, CTAKES_BUNDLE_ID, noteTime ) );
 // The bundle is a collection; created for ease of distribution.
 bundle.setType( Bundle.BundleType.COLLECTION );
 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

protected void makeDocument() throws Exception {
  composition = (Composition) ResourceFactory.createResource("Composition");
  addReference(composition, "Composition", makeUUIDReference());
  Element title = cda.getChild(doc, "title");
  composition.setTitle(title.getTextContent());
  if (cda.getChild(doc, "setId") != null) {
    feed.setId(convert.makeURIfromII(cda.getChild(doc, "id")));
    composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "setId")));
  } else
    composition.setIdentifier(convert.makeIdentifierFromII(cda.getChild(doc, "id"))); // well, we fall back to id
  composition.setDateElement(convert.makeDateTimeFromTS(cda.getChild(doc, "effectiveTime")));
  composition.setType(convert.makeCodeableConceptFromCD(cda.getChild(doc, "code")));
  composition.setConfidentiality(convertConfidentiality(cda.getChild(doc, "confidentialityCode")));
  if (cda.getChild(doc, "confidentialityCode") != null)
    composition.setLanguage(cda.getChild(doc, "confidentialityCode").getAttribute("value")); // todo - fix streaming for this
  Element ee = cda.getChild(doc, "componentOf");
  if (ee != null)
    ee = cda.getChild(ee, "encompassingEncounter");
  if (ee != null) {
    Encounter visit = new Encounter();
    for (Element e : cda.getChildren(ee, "id"))
      visit.getIdentifier().add(convert.makeIdentifierFromII(e));
    visit.setPeriod(convert.makePeriodFromIVL(cda.getChild(ee, "effectiveTime")));
    composition.getEvent().add(new Composition.CompositionEventComponent());
    composition.getEvent().get(0).getCode().add(convert.makeCodeableConceptFromCD(cda.getChild(ee, "code")));
    composition.getEvent().get(0).setPeriod(visit.getPeriod());
    composition.getEvent().get(0).getDetail().add(Factory.makeReference(addReference(visit, "Encounter", makeUUIDReference())));
  }
  // main todo: fill out the narrative, but before we can do that, we have to convert everything else
}

代码示例来源: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 = new Bundle();
myBundle.setId(UUID.randomUUID().toString());

相关文章