Java Code Examples for org.hl7.fhir.dstu3.model.DomainResource#setId()

The following examples show how to use org.hl7.fhir.dstu3.model.DomainResource#setId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CCDAConverter.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
protected String addReference(DomainResource r, String title, String id) throws Exception {
	if (r.getText() == null)
		r.setText(new Narrative());
	if (r.getText().getDiv() == null) {
		r.getText().setStatus(NarrativeStatus.GENERATED);
		new NarrativeGenerator("", "", context).generate(r);
	}
	r.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
	r.setId(id);
	feed.getEntry().add(new BundleEntryComponent().setResource(r));
	return id;
}
 
Example 2
Source File: CCDAConverter.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
protected ListEntryComponent addItemToList(ListResource list, DomainResource ai)
		throws Exception {
	list.getContained().add(ai);
	String n = nextRef();
	ai.setId(n);
	ListEntryComponent item = new ListResource.ListEntryComponent();
	list.getEntry().add(item);
	item.setItem(Factory.makeReference("#"+n));
	return item;
}