@Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append("system", defaultString(getSystem())); if (myModifier != null) { builder.append(":" + myModifier.getValue()); } builder.append("value", getValue()); if (getMissing() != null) { builder.append(":missing", getMissing()); } return builder.toString(); }
TokenParam param = (TokenParam) nextOrParams; if (param.getModifier() == TokenParamModifier.NOT) { if (isNotBlank(param.getSystem()) || isNotBlank(param.getValue())) { notTags.add(Pair.of(param.getSystem(), param.getValue())); if (nextParamUncasted instanceof TokenParam) { TokenParam nextParam = (TokenParam) nextParamUncasted; if (isNotBlank(nextParam.getValue())) { haveTags = true; } else if (isNotBlank(nextParam.getSystem())) { if (nextOrParams instanceof TokenParam) { TokenParam nextParam = (TokenParam) nextOrParams; code = nextParam.getValue(); system = nextParam.getSystem(); if (nextParam.getModifier() == TokenParamModifier.NOT) {
/** * {@inheritDoc} */ @Override String doGetValueAsQueryToken(FhirContext theContext) { if (getSystem() != null) { if (getValue() != null) { return ParameterUtil.escape(StringUtils.defaultString(getSystem())) + '|' + ParameterUtil.escape(getValue()); } else { return ParameterUtil.escape(StringUtils.defaultString(getSystem())) + '|'; } } return ParameterUtil.escape(getValue()); }
TokenParam param = (TokenParam) nextOrParams; if (param.getModifier() == TokenParamModifier.NOT) { if (isNotBlank(param.getSystem()) || isNotBlank(param.getValue())) { notTags.add(Pair.of(param.getSystem(), param.getValue())); if (nextParamUncasted instanceof TokenParam) { TokenParam nextParam = (TokenParam) nextParamUncasted; if (isNotBlank(nextParam.getValue())) { haveTags = true; } else if (isNotBlank(nextParam.getSystem())) { if (nextOrParams instanceof TokenParam) { TokenParam nextParam = (TokenParam) nextOrParams; code = nextParam.getValue(); system = nextParam.getSystem(); if (nextParam.getModifier() == TokenParamModifier.NOT) {
@Search() public List<Patient> searchByIdentifier(@RequiredParam(name=Patient.SP_IDENTIFIER) TokenParam theId) { String identifierSystem = theId.getSystem(); String identifier = theId.getValue(); List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: searchIdentifierParam
@Search public List<Patient> findObservations( @RequiredParam(name=Observation.SP_SUBJECT+'.'+Patient.SP_IDENTIFIER) TokenParam theProvider ) { String system = theProvider.getSystem(); String identifier = theProvider.getValue(); // ...Do a search for all observations for the given subject... List<Patient> retVal=new ArrayList<Patient>(); // populate this return retVal; } //END SNIPPET: referenceWithStaticChain
@Override public boolean matches(IQueryParameterType theParam) { if (!(theParam instanceof TokenParam)) { return false; } TokenParam token = (TokenParam) theParam; boolean retval = false; // Only match on system if it wasn't specified if (token.getSystem() == null || token.getSystem().isEmpty()) { if (getValue().equalsIgnoreCase(token.getValue())) { retval = true; } } else if (token.getValue() == null || token.getValue().isEmpty()) { if (token.getSystem().equalsIgnoreCase(getSystem())) { retval = true; } } else { if (token.getSystem().equalsIgnoreCase(getSystem()) && getValue().equalsIgnoreCase(token.getValue())) { retval = true; } } return retval; }
@Override public List<Long> everything(String theResourceName, SearchParameterMap theParams) { Long pid = null; if (theParams.get(IAnyResource.SP_RES_ID) != null) { String idParamValue; IQueryParameterType idParam = theParams.get(IAnyResource.SP_RES_ID).get(0).get(0); if (idParam instanceof TokenParam) { TokenParam idParm = (TokenParam) idParam; idParamValue = idParm.getValue(); } else { StringParam idParm = (StringParam) idParam; idParamValue = idParm.getValue(); } pid = myIdHelperService.translateForcedIdToPid(theResourceName, idParamValue); } Long referencingPid = pid; List<Long> retVal = doSearch(null, theParams, referencingPid); if (referencingPid != null) { retVal.add(referencingPid); } return retVal; }
@Search public List<IBaseResource> searchById( @RequiredParam(name = "_id") TokenAndListParam theIds) { List<IBaseResource> retVal = new ArrayList<>(); for (TreeMap<Long, T> next : myIdToVersionToResourceMap.values()) { if (next.isEmpty() == false) { T nextResource = next.lastEntry().getValue(); boolean matches = true; if (theIds != null && theIds.getValuesAsQueryTokens().size() > 0) { for (TokenOrListParam nextIdAnd : theIds.getValuesAsQueryTokens()) { matches = false; for (TokenParam nextOr : nextIdAnd.getValuesAsQueryTokens()) { if (nextOr.getValue().equals(nextResource.getIdElement().getIdPart())) { matches = true; } } if (!matches) { break; } } } if (!matches) { continue; } retVal.add(nextResource); } } mySearchCount.incrementAndGet(); return retVal; }
String identifier = tokenSubject.getValue();
TokenParam id = (TokenParam) theParameter; system = id.getSystem(); code = (id.getValue()); modifier = id.getModifier(); } else if (theParameter instanceof BaseIdentifierDt) {
throw new IllegalStateException("Trying to process a text search on a non-text token parameter"); rawSearchTerm = id.getValue(); } else if (theParameter instanceof StringParam) { StringParam id = (StringParam) theParameter;
@Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append("system", defaultString(getSystem())); if (myModifier != null) { builder.append(":" + myModifier.getValue()); } builder.append("value", getValue()); if (getMissing() != null) { builder.append(":missing", getMissing()); } return builder.toString(); }
/** * {@inheritDoc} */ @Override String doGetValueAsQueryToken(FhirContext theContext) { if (getSystem() != null) { if (getValue() != null) { return ParameterUtil.escape(StringUtils.defaultString(getSystem())) + '|' + ParameterUtil.escape(getValue()); } else { return ParameterUtil.escape(StringUtils.defaultString(getSystem())) + '|'; } } return ParameterUtil.escape(getValue()); }
@Override public List<Long> everything(String theResourceName, SearchParameterMap theParams) { Long pid = null; if (theParams.get(IAnyResource.SP_RES_ID) != null) { String idParamValue; IQueryParameterType idParam = theParams.get(IAnyResource.SP_RES_ID).get(0).get(0); if (idParam instanceof TokenParam) { TokenParam idParm = (TokenParam) idParam; idParamValue = idParm.getValue(); } else { StringParam idParm = (StringParam) idParam; idParamValue = idParm.getValue(); } pid = myIdHelperService.translateForcedIdToPid(theResourceName, idParamValue); } Long referencingPid = pid; List<Long> retVal = doSearch(null, theParams, referencingPid); if (referencingPid != null) { retVal.add(referencingPid); } return retVal; }
@Search public List<IBaseResource> searchById( @RequiredParam(name = "_id") TokenAndListParam theIds) { List<IBaseResource> retVal = new ArrayList<>(); for (TreeMap<Long, T> next : myIdToVersionToResourceMap.values()) { if (next.isEmpty() == false) { T nextResource = next.lastEntry().getValue(); boolean matches = true; if (theIds != null && theIds.getValuesAsQueryTokens().size() > 0) { for (TokenOrListParam nextIdAnd : theIds.getValuesAsQueryTokens()) { matches = false; for (TokenParam nextOr : nextIdAnd.getValuesAsQueryTokens()) { if (nextOr.getValue().equals(nextResource.getIdElement().getIdPart())) { matches = true; } } if (!matches) { break; } } } if (!matches) { continue; } retVal.add(nextResource); } } mySearchCount.incrementAndGet(); return retVal; }
TokenParam id = (TokenParam) theParameter; system = id.getSystem(); code = (id.getValue()); modifier = id.getModifier(); } else if (theParameter instanceof BaseIdentifierDt) {
throw new IllegalStateException("Trying to process a text search on a non-text token parameter"); rawSearchTerm = id.getValue(); } else if (theParameter instanceof StringParam) { StringParam id = (StringParam) theParameter;
/** * Handles the PIXm Query * * @param sourceIdentifierParam Identifier to search for. Should be an {@link Identifier}, but obviously * non-primitive types are forbidden in GET operations * @param targetSystemParam target system URI * @return {@link Parameters} containing found identifiers */ @SuppressWarnings("unused") @Operation(name = Iti83Constants.PIXM_OPERATION_NAME, type = Patient.class, idempotent = true, returnParameters = {@OperationParam(name = "return", type = Identifier.class, max = 100)}) public Parameters pixmQuery( @OperationParam(name = SOURCE_IDENTIFIER_NAME) TokenParam sourceIdentifierParam, @OperationParam(name = TARGET_SYSTEM_NAME) UriParam targetSystemParam, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { Identifier sourceIdentifier = new Identifier() .setSystem(sourceIdentifierParam.getSystem()) .setValue(sourceIdentifierParam.getValue()); UriType targetUri = targetSystemParam == null ? null : new UriType(targetSystemParam.getValue()); Parameters inParams = new Parameters(); inParams.addParameter().setName(SOURCE_IDENTIFIER_NAME).setValue(sourceIdentifier); inParams.addParameter().setName(TARGET_SYSTEM_NAME).setValue(targetUri); // Run down the route return requestResource(inParams, Parameters.class, httpServletRequest, httpServletResponse); }
.setValue(sourceIdentifierParam.getValue()); } else { sourceIdentifier.setValue(resourceId.getIdPart());