#157 - removed published from dstu1 bundle, as it should only be present for bundleEntry
This commit is contained in:
parent
41c215efe2
commit
de1effbf52
|
@ -293,6 +293,7 @@ public class Bundle extends BaseBundle /* implements IElement */{
|
||||||
return myLinkSelf;
|
return myLinkSelf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public InstantDt getPublished() {
|
public InstantDt getPublished() {
|
||||||
InstantDt retVal = (InstantDt) getResourceMetadata().get(ResourceMetadataKeyEnum.PUBLISHED);
|
InstantDt retVal = (InstantDt) getResourceMetadata().get(ResourceMetadataKeyEnum.PUBLISHED);
|
||||||
if (retVal == null) {
|
if (retVal == null) {
|
||||||
|
@ -301,6 +302,7 @@ public class Bundle extends BaseBundle /* implements IElement */{
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a resource from a bundle given its logical ID.
|
* Retrieves a resource from a bundle given its logical ID.
|
||||||
|
@ -394,9 +396,11 @@ public class Bundle extends BaseBundle /* implements IElement */{
|
||||||
myCategories = theCategories;
|
myCategories = theCategories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public void setPublished(InstantDt thePublished) {
|
public void setPublished(InstantDt thePublished) {
|
||||||
getResourceMetadata().put(ResourceMetadataKeyEnum.PUBLISHED, thePublished);
|
getResourceMetadata().put(ResourceMetadataKeyEnum.PUBLISHED, thePublished);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
|
||||||
public void setType(BoundCodeDt<BundleTypeEnum> theType) {
|
public void setType(BoundCodeDt<BundleTypeEnum> theType) {
|
||||||
myType = theType;
|
myType = theType;
|
||||||
|
|
|
@ -192,7 +192,6 @@ public class JsonParser extends BaseParser implements IParser {
|
||||||
writeTagWithTextNode(eventWriter, "title", theBundle.getTitle());
|
writeTagWithTextNode(eventWriter, "title", theBundle.getTitle());
|
||||||
writeTagWithTextNode(eventWriter, "id", theBundle.getBundleId());
|
writeTagWithTextNode(eventWriter, "id", theBundle.getBundleId());
|
||||||
writeOptionalTagWithTextNode(eventWriter, "updated", theBundle.getUpdated());
|
writeOptionalTagWithTextNode(eventWriter, "updated", theBundle.getUpdated());
|
||||||
writeOptionalTagWithTextNode(eventWriter, "published", theBundle.getPublished());
|
|
||||||
|
|
||||||
boolean linkStarted = false;
|
boolean linkStarted = false;
|
||||||
linkStarted = writeAtomLinkInDstu1Format(eventWriter, "self", theBundle.getLinkSelf(), linkStarted);
|
linkStarted = writeAtomLinkInDstu1Format(eventWriter, "self", theBundle.getLinkSelf(), linkStarted);
|
||||||
|
|
|
@ -680,8 +680,6 @@ class ParserState<T> {
|
||||||
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
|
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
|
||||||
if ("entry".equals(theLocalPart) && verifyNamespace(XmlParser.ATOM_NS, theNamespaceURI)) {
|
if ("entry".equals(theLocalPart) && verifyNamespace(XmlParser.ATOM_NS, theNamespaceURI)) {
|
||||||
push(new AtomEntryState(myInstance, myResourceType));
|
push(new AtomEntryState(myInstance, myResourceType));
|
||||||
} else if (theLocalPart.equals("published")) {
|
|
||||||
push(new AtomPrimitiveState(myInstance.getPublished()));
|
|
||||||
} else if (theLocalPart.equals("title")) {
|
} else if (theLocalPart.equals("title")) {
|
||||||
push(new AtomPrimitiveState(myInstance.getTitle()));
|
push(new AtomPrimitiveState(myInstance.getTitle()));
|
||||||
} else if ("id".equals(theLocalPart)) {
|
} else if ("id".equals(theLocalPart)) {
|
||||||
|
|
|
@ -266,7 +266,6 @@ public class XmlParser extends BaseParser implements IParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
writeOptionalTagWithTextNode(eventWriter, "updated", theBundle.getUpdated());
|
writeOptionalTagWithTextNode(eventWriter, "updated", theBundle.getUpdated());
|
||||||
writeOptionalTagWithTextNode(eventWriter, "published", theBundle.getPublished());
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(theBundle.getAuthorName().getValue())) {
|
if (StringUtils.isNotBlank(theBundle.getAuthorName().getValue())) {
|
||||||
eventWriter.writeStartElement("author");
|
eventWriter.writeStartElement("author");
|
||||||
|
|
|
@ -200,8 +200,6 @@ public class Dstu1BundleFactory implements IVersionSpecificBundleFactory {
|
||||||
addResourcesToBundle(resourceList, theBundleType, theServerBase, theServer.getBundleInclusionRule(), theIncludes);
|
addResourcesToBundle(resourceList, theBundleType, theServerBase, theServer.getBundleInclusionRule(), theIncludes);
|
||||||
addRootPropertiesToBundle(null, theServerBase, theCompleteUrl, theResult.size(), theBundleType);
|
addRootPropertiesToBundle(null, theServerBase, theCompleteUrl, theResult.size(), theBundleType);
|
||||||
|
|
||||||
myBundle.setPublished(theResult.getPublished());
|
|
||||||
|
|
||||||
if (theServer.getPagingProvider() != null) {
|
if (theServer.getPagingProvider() != null) {
|
||||||
int limit;
|
int limit;
|
||||||
limit = theLimit != null ? theLimit : theServer.getPagingProvider().getDefaultPageSize();
|
limit = theLimit != null ? theLimit : theServer.getPagingProvider().getDefaultPageSize();
|
||||||
|
@ -229,10 +227,6 @@ public class Dstu1BundleFactory implements IVersionSpecificBundleFactory {
|
||||||
myBundle.getBundleId().setValue(UUID.randomUUID().toString());
|
myBundle.getBundleId().setValue(UUID.randomUUID().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myBundle.getPublished().isEmpty()) {
|
|
||||||
myBundle.getPublished().setToCurrentTimeInLocalTimeZone();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (myBundle.getLinkBase().isEmpty()) {
|
if (myBundle.getLinkBase().isEmpty()) {
|
||||||
myBundle.getLinkBase().setValue(theServerBase);
|
myBundle.getLinkBase().setValue(theServerBase);
|
||||||
}
|
}
|
||||||
|
@ -266,7 +260,6 @@ public class Dstu1BundleFactory implements IVersionSpecificBundleFactory {
|
||||||
|
|
||||||
myBundle.getAuthorName().setValue(theAuthor);
|
myBundle.getAuthorName().setValue(theAuthor);
|
||||||
myBundle.getBundleId().setValue(UUID.randomUUID().toString());
|
myBundle.getBundleId().setValue(UUID.randomUUID().toString());
|
||||||
myBundle.getPublished().setToCurrentTimeInLocalTimeZone();
|
|
||||||
myBundle.getLinkBase().setValue(theServerBase);
|
myBundle.getLinkBase().setValue(theServerBase);
|
||||||
myBundle.getLinkSelf().setValue(theCompleteUrl);
|
myBundle.getLinkSelf().setValue(theCompleteUrl);
|
||||||
myBundle.getType().setValueAsEnum(theBundleType);
|
myBundle.getType().setValueAsEnum(theBundleType);
|
||||||
|
|
|
@ -1219,7 +1219,6 @@ public class JsonParserTest {
|
||||||
Bundle b = new Bundle();
|
Bundle b = new Bundle();
|
||||||
|
|
||||||
InstantDt pub = InstantDt.withCurrentTime();
|
InstantDt pub = InstantDt.withCurrentTime();
|
||||||
b.setPublished(pub);
|
|
||||||
Thread.sleep(2);
|
Thread.sleep(2);
|
||||||
|
|
||||||
Patient p1 = new Patient();
|
Patient p1 = new Patient();
|
||||||
|
@ -1245,7 +1244,6 @@ public class JsonParserTest {
|
||||||
ourLog.info(bundleString);
|
ourLog.info(bundleString);
|
||||||
|
|
||||||
List<String> strings = new ArrayList<String>();
|
List<String> strings = new ArrayList<String>();
|
||||||
strings.addAll(Arrays.asList("\"published\":\"" + pub.getValueAsString() + "\""));
|
|
||||||
strings.addAll(Arrays.asList("\"id\":\"1\""));
|
strings.addAll(Arrays.asList("\"id\":\"1\""));
|
||||||
strings.addAll(Arrays.asList("this is the summary"));
|
strings.addAll(Arrays.asList("this is the summary"));
|
||||||
strings.addAll(Arrays.asList("\"id\":\"2\"", "\"rel\":\"alternate\"", "\"href\":\"http://foo/bar\""));
|
strings.addAll(Arrays.asList("\"id\":\"2\"", "\"rel\":\"alternate\"", "\"href\":\"http://foo/bar\""));
|
||||||
|
|
|
@ -314,7 +314,6 @@ public class XmlParserTest {
|
||||||
b.getCategories().addTag("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/message", "Message");
|
b.getCategories().addTag("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/message", "Message");
|
||||||
|
|
||||||
InstantDt pub = InstantDt.withCurrentTime();
|
InstantDt pub = InstantDt.withCurrentTime();
|
||||||
b.setPublished(pub);
|
|
||||||
Thread.sleep(2);
|
Thread.sleep(2);
|
||||||
|
|
||||||
Patient p1 = new Patient();
|
Patient p1 = new Patient();
|
||||||
|
@ -340,7 +339,6 @@ public class XmlParserTest {
|
||||||
ourLog.info(bundleString);
|
ourLog.info(bundleString);
|
||||||
|
|
||||||
List<String> strings = new ArrayList<String>();
|
List<String> strings = new ArrayList<String>();
|
||||||
strings.addAll(Arrays.asList("<published>", pub.getValueAsString(), "</published>"));
|
|
||||||
strings.add("<category term=\"http://hl7.org/fhir/tag/message\" label=\"Message\" scheme=\"http://hl7.org/fhir/tag\"/>");
|
strings.add("<category term=\"http://hl7.org/fhir/tag/message\" label=\"Message\" scheme=\"http://hl7.org/fhir/tag\"/>");
|
||||||
strings.addAll(Arrays.asList("<entry>", "<id>1</id>", "</Patient>", "<summary type=\"xhtml\">", "<div", "</entry>"));
|
strings.addAll(Arrays.asList("<entry>", "<id>1</id>", "</Patient>", "<summary type=\"xhtml\">", "<div", "</entry>"));
|
||||||
strings.addAll(Arrays.asList("<entry>", "<id>2</id>", "<link rel=\"alternate\" href=\"http://foo/bar\"/>", "<link rel=\"search\" href=\"http://foo/bar/search\"/>", "</entry>"));
|
strings.addAll(Arrays.asList("<entry>", "<id>2</id>", "<link rel=\"alternate\" href=\"http://foo/bar\"/>", "<link rel=\"search\" href=\"http://foo/bar/search\"/>", "</entry>"));
|
||||||
|
@ -380,7 +378,6 @@ public class XmlParserTest {
|
||||||
b.getCategories().addTag("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/message", "Message");
|
b.getCategories().addTag("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/message", "Message");
|
||||||
|
|
||||||
InstantDt pub = InstantDt.withCurrentTime();
|
InstantDt pub = InstantDt.withCurrentTime();
|
||||||
b.setPublished(pub);
|
|
||||||
Thread.sleep(2);
|
Thread.sleep(2);
|
||||||
|
|
||||||
Patient p1 = new Patient();
|
Patient p1 = new Patient();
|
||||||
|
@ -406,7 +403,6 @@ public class XmlParserTest {
|
||||||
ourLog.info(bundleString);
|
ourLog.info(bundleString);
|
||||||
|
|
||||||
List<String> strings = new ArrayList<String>();
|
List<String> strings = new ArrayList<String>();
|
||||||
strings.addAll(Arrays.asList("<published>", pub.getValueAsString(), "</published>"));
|
|
||||||
strings.add("<category term=\"http://hl7.org/fhir/tag/message\" label=\"Message\" scheme=\"http://hl7.org/fhir/tag\"/>");
|
strings.add("<category term=\"http://hl7.org/fhir/tag/message\" label=\"Message\" scheme=\"http://hl7.org/fhir/tag\"/>");
|
||||||
strings.addAll(Arrays.asList("<entry>", "<id>1</id>", "</Patient>", "<summary type=\"xhtml\">", "<div", "</entry>"));
|
strings.addAll(Arrays.asList("<entry>", "<id>1</id>", "</Patient>", "<summary type=\"xhtml\">", "<div", "</entry>"));
|
||||||
strings.addAll(Arrays.asList("<entry>", "<id>2</id>", "<link rel=\"alternate\" href=\"http://foo/bar\"/>", "<link rel=\"search\" href=\"http://foo/bar/search\"/>", "</entry>"));
|
strings.addAll(Arrays.asList("<entry>", "<id>2</id>", "<link rel=\"alternate\" href=\"http://foo/bar\"/>", "<link rel=\"search\" href=\"http://foo/bar/search\"/>", "</entry>"));
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
<link rel="self" href="http://localhost:8888/fhir/context/Patient?_pretty=true&_include=Patient.managingOrganization&_pretty=true"/>
|
<link rel="self" href="http://localhost:8888/fhir/context/Patient?_pretty=true&_include=Patient.managingOrganization&_pretty=true"/>
|
||||||
<link rel="fhir-base" href="http://localhost:8888/fhir/context"/>
|
<link rel="fhir-base" href="http://localhost:8888/fhir/context"/>
|
||||||
<os:totalResults xmlns:os="http://a9.com/-/spec/opensearch/1.1/">2</os:totalResults>
|
<os:totalResults xmlns:os="http://a9.com/-/spec/opensearch/1.1/">2</os:totalResults>
|
||||||
<published>2014-06-22T21:37:05-04:00</published>
|
|
||||||
<author>
|
<author>
|
||||||
<name>HAPI FHIR Server</name>
|
<name>HAPI FHIR Server</name>
|
||||||
</author>
|
</author>
|
||||||
|
|
Loading…
Reference in New Issue