public QuantityParam setValue(IPrimitiveType<BigDecimal> theValue) { myValue = null; if (theValue != null) { myValue = theValue.getValue(); } return this; }
/** * Convert a list of FHIR String objects to a set of native java Strings */ public static Set<String> toStringSet(List<? extends IPrimitiveType<?>> theStringList) { HashSet<String> retVal = new HashSet<>(); if (theStringList != null) { for (IPrimitiveType<?> string : theStringList) { if (string != null && string.getValue() != null) { retVal.add(string.getValueAsString()); } } } return retVal; }
private DateTimeType conformanceDate() { IPrimitiveType<Date> buildDate = getServerConfiguration().getConformanceDate(); if (buildDate != null && buildDate.getValue() != null) { try { return new DateTimeType(buildDate.getValueAsString()); } catch (DataFormatException e) { // fall through } } return DateTimeType.now(); }
public QuantityParam setSystem(IPrimitiveType<String> theSystem) { mySystem = null; if (theSystem != null) { mySystem = theSystem.getValue(); } return this; }
private DateTimeType conformanceDate() { IPrimitiveType<Date> buildDate = getServerConfiguration().getConformanceDate(); if (buildDate != null && buildDate.getValue() != null) { try { return new DateTimeType(buildDate.getValueAsString()); } catch (DataFormatException e) { // fall through } } return DateTimeType.now(); }
private String toStringOrNull(IPrimitiveType<String> thePrimitive) { return thePrimitive != null ? thePrimitive.getValue() : null; }
private DateTimeType conformanceDate() { IPrimitiveType<Date> buildDate = getServerConfiguration().getConformanceDate(); if (buildDate != null && buildDate.getValue() != null) { try { return new DateTimeType(buildDate.getValueAsString()); } catch (DataFormatException e) { // fall through } } return DateTimeType.now(); }
private String toStringOrNull(IPrimitiveType<String> thePrimitive) { return thePrimitive != null ? thePrimitive.getValue() : null; }
private String toStringOrNull(IPrimitiveType<String> thePrimitive) { return thePrimitive != null ? thePrimitive.getValue() : null; }
protected ExpungeOptions createExpungeOptions(IPrimitiveType<? extends Integer> theLimit, IPrimitiveType<? extends Boolean> theExpungeDeletedResources, IPrimitiveType<? extends Boolean> theExpungeOldVersions, IPrimitiveType<? extends Boolean> theExpungeEverything) { ExpungeOptions options = new ExpungeOptions(); if (theLimit != null && theLimit.getValue() != null) { options.setLimit(theLimit.getValue()); } if (theExpungeOldVersions != null && theExpungeOldVersions.getValue() != null) { options.setExpungeOldVersions(theExpungeOldVersions.getValue()); } if (theExpungeDeletedResources != null && theExpungeDeletedResources.getValue() != null) { options.setExpungeDeletedResources(theExpungeDeletedResources.getValue()); } if (theExpungeEverything != null && theExpungeEverything.getValue() != null) { options.setExpungeEverything(theExpungeEverything.getValue()); } return options; }
/** * Joins a list of strings with a single space (' ') between each string */ public static String joinStringsSpaceSeparated(List<? extends IPrimitiveType<String>> theStrings) { StringBuilder b = new StringBuilder(); for (IPrimitiveType<String> next : theStrings) { if (next.isEmpty()) { continue; } if (b.length() > 0) { b.append(' '); } b.append(next.getValue()); } return b.toString(); }
public static Integer getTotal(FhirContext theContext, IBaseBundle theBundle) { RuntimeResourceDefinition def = theContext.getResourceDefinition(theBundle); BaseRuntimeChildDefinition entryChild = def.getChildByName("total"); List<IBase> entries = entryChild.getAccessor().getValues(theBundle); if (entries.size() > 0) { IPrimitiveType<Number> typeElement = (IPrimitiveType<Number>) entries.get(0); if (typeElement != null && typeElement.getValue() != null) { return typeElement.getValue().intValue(); } } return null; }
@Override public ICriterion<StringClientParam> value(IPrimitiveType<String> theValue) { return new StringCriterion<>(getParamName(), theValue.getValue()); }
@Override public ICriterion<StringClientParam> value(IPrimitiveType<String> theValue) { return new StringCriterion<>(getParamName() + Constants.PARAMQUALIFIER_STRING_CONTAINS, theValue.getValue()); }
@Override public ICriterion<StringClientParam> value(IPrimitiveType<String> theValue) { return new StringCriterion<>(getParamName() + Constants.PARAMQUALIFIER_STRING_EXACT, theValue.getValue()); }
private void returnRawResponse(RequestDetails theRequestDetails, HttpServletResponse theServletResponse, String theContentType, IPrimitiveType<byte[]> theData) { theServletResponse.setStatus(200); if (theRequestDetails.getServer() instanceof RestfulServer) { RestfulServer rs = (RestfulServer) theRequestDetails.getServer(); rs.addHeadersToResponse(theServletResponse); } theServletResponse.addHeader(Constants.HEADER_CONTENT_TYPE, theContentType); // Write the response try { theServletResponse.getOutputStream().write(theData.getValue()); theServletResponse.getOutputStream().close(); } catch (IOException e) { throw new InternalErrorException(e); } } }
private ArrayList<TagDefinition> toTagList(IBaseMetaType theMeta) { ArrayList<TagDefinition> retVal = new ArrayList<TagDefinition>(); for (IBaseCoding next : theMeta.getTag()) { retVal.add(new TagDefinition(TagTypeEnum.TAG, next.getSystem(), next.getCode(), next.getDisplay())); } for (IBaseCoding next : theMeta.getSecurity()) { retVal.add(new TagDefinition(TagTypeEnum.SECURITY_LABEL, next.getSystem(), next.getCode(), next.getDisplay())); } for (IPrimitiveType<String> next : theMeta.getProfile()) { retVal.add(new TagDefinition(TagTypeEnum.PROFILE, BaseHapiFhirDao.NS_JPA_PROFILE, next.getValue(), null)); } return retVal; }
@Override public IBundleProvider getDocumentForComposition(HttpServletRequest theServletRequest, IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdate, SortSpec theSort, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdate); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } IBundleProvider bundleProvider = search(paramMap); return bundleProvider; } }
@Override public IBundleProvider getDocumentForComposition(HttpServletRequest theServletRequest, IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdate, SortSpec theSort, RequestDetails theRequestDetails) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdate); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } IBundleProvider bundleProvider = search(paramMap); return bundleProvider; } }
@Override public IBundleProvider encounterInstanceEverything(HttpServletRequest theServletRequest, IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdated, SortSpec theSort) { SearchParameterMap paramMap = new SearchParameterMap(); if (theCount != null) { paramMap.setCount(theCount.getValue()); } // paramMap.setRevIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive())); paramMap.setEverythingMode(theId != null ? EverythingModeEnum.ENCOUNTER_INSTANCE : EverythingModeEnum.ENCOUNTER_TYPE); paramMap.setSort(theSort); paramMap.setLastUpdated(theLastUpdated); if (theId != null) { paramMap.add("_id", new StringParam(theId.getIdPart())); } IBundleProvider retVal = search(paramMap); return retVal; }