Tabnine Logo
Bundle.setId
Code IndexAdd Tabnine to your IDE (free)

How to use
setId
method
in
org.hl7.fhir.dstu3.model.Bundle

Best Java code snippets using org.hl7.fhir.dstu3.model.Bundle.setId (Showing top 7 results out of 315)

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());
org.hl7.fhir.dstu3.modelBundlesetId

Popular methods of Bundle

  • getEntry
  • <init>
    Constructor
  • addEntry
  • getMeta
  • getType
  • setType
  • getTotal
  • getLink
    Returns the #getLink() which matches a given BundleLinkComponent#getRelation(). If no link is found
  • addLink
  • getEntryFirstRep
  • getResourceType
  • getSignature
  • getResourceType,
  • getSignature,
  • getTypeElement,
  • hasEntry,
  • setTotal,
  • castToCode,
  • castToIdentifier,
  • castToSignature,
  • castToUnsignedInt

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now