@Override public String getBundleType(Bundle theRequest) { if (theRequest.getType() == null) { return null; } return theRequest.getTypeElement().getValue().toCode(); }
@Override public String getBundleType(Bundle theRequest) { if (theRequest.getType() == null) { return null; } return theRequest.getTypeElement().getValue().toCode(); }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return getIdentifier(); case 3575610: return getTypeElement(); case 110549828: return getTotalElement(); case 3321850: return addLink(); case 96667762: return addEntry(); case 1073584312: return getSignature(); default: return super.makeProperty(hash, name); } }
@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); } }
myBundle.getTypeElement().setValueAsString(theBundleType.getCode());