public ResponseEncoding(FhirContext theCtx, EncodingEnum theEncoding, String theContentType) { super(); myEncoding = theEncoding; myContentType = theContentType; if (theContentType != null) { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (theContentType.equals(EncodingEnum.JSON_PLAIN_STRING) || theContentType.equals(EncodingEnum.XML_PLAIN_STRING)) { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1); } else { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1) && !EncodingEnum.isLegacy(theContentType); } } else { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (ctxtEnum.isOlderThan(FhirVersionEnum.DSTU3)) { myNonLegacy = null; } else { myNonLegacy = Boolean.TRUE; } } }
SortSpec ss = (SortSpec) theSourceClientArgument; if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2)) { String string = createSortStringDstu3(ss); if (string.length() > 0) {
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2) && order == null) { StringTokenizer tok = new StringTokenizer(nextValue, ","); while (tok.hasMoreTokens()) {
public static void addAcceptHeaderToRequest(EncodingEnum theEncoding, IHttpRequest theHttpRequest, FhirContext theContext) { if (theEncoding == null) { if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2_1) == false) { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_XML_OR_JSON_LEGACY); } else { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_XML_OR_JSON_NON_LEGACY); } } else if (theEncoding == EncodingEnum.JSON) { if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2_1) == false) { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.CT_FHIR_JSON); } else { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_JSON_NON_LEGACY); } } else if (theEncoding == EncodingEnum.XML) { if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2_1) == false) { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.CT_FHIR_XML); } else { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_XML_NON_LEGACY); } } }
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2)) { SortSpec rootSs = null; SortSpec lastSs = null;
public ResponseEncoding(FhirContext theCtx, EncodingEnum theEncoding, String theContentType) { super(); myEncoding = theEncoding; myContentType = theContentType; if (theContentType != null) { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (theContentType.equals(EncodingEnum.JSON_PLAIN_STRING) || theContentType.equals(EncodingEnum.XML_PLAIN_STRING)) { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1); } else { myNonLegacy = ctxtEnum.isNewerThan(FhirVersionEnum.DSTU2_1) && !EncodingEnum.isLegacy(theContentType); } } else { FhirVersionEnum ctxtEnum = theCtx.getVersion().getVersion(); if (ctxtEnum.isOlderThan(FhirVersionEnum.DSTU3)) { myNonLegacy = null; } else { myNonLegacy = Boolean.TRUE; } } }
SortSpec ss = (SortSpec) theSourceClientArgument; if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2)) { String string = createSortStringDstu3(ss); if (string.length() > 0) {
public static void addAcceptHeaderToRequest(EncodingEnum theEncoding, IHttpRequest theHttpRequest, FhirContext theContext) { if (theEncoding == null) { if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2_1) == false) { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_XML_OR_JSON_LEGACY); } else { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_XML_OR_JSON_NON_LEGACY); } } else if (theEncoding == EncodingEnum.JSON) { if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2_1) == false) { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.CT_FHIR_JSON); } else { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_JSON_NON_LEGACY); } } else if (theEncoding == EncodingEnum.XML) { if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2_1) == false) { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.CT_FHIR_XML); } else { theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_XML_NON_LEGACY); } } }
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2) && order == null) { StringTokenizer tok = new StringTokenizer(nextValue, ","); while (tok.hasMoreTokens()) {
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) { if (entry.getSearchMode().isEmpty()) { entry.getSearchMode().setValueAsEnum(BundleEntrySearchModeEnum.INCLUDE);
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) { if (entry.getSearchMode().isEmpty()) { entry.getSearchMode().setValueAsEnum(BundleEntrySearchModeEnum.INCLUDE);
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2)) { SortSpec rootSs = null; SortSpec lastSs = null;