@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()); }
@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
@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; }
@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
String system = tokenSubject.getSystem(); String identifier = tokenSubject.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 (isNotBlank(nextParam.getValue())) { haveTags = true; } else if (isNotBlank(nextParam.getSystem())) { throw new InvalidRequestException("Invalid " + theParamName + " parameter (must supply a value/code and not just a system): " + nextParam.getValueAsQueryToken(myContext)); TokenParam nextParam = (TokenParam) nextOrParams; code = nextParam.getValue(); system = nextParam.getSystem(); if (nextParam.getModifier() == TokenParamModifier.NOT) { paramInverted = true;
if (theParameter instanceof TokenParam) { TokenParam id = (TokenParam) theParameter; system = id.getSystem(); code = (id.getValue()); modifier = id.getModifier();
@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()); }
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 (isNotBlank(nextParam.getValue())) { haveTags = true; } else if (isNotBlank(nextParam.getSystem())) { throw new InvalidRequestException("Invalid " + theParamName + " parameter (must supply a value/code and not just a system): " + nextParam.getValueAsQueryToken(myContext)); TokenParam nextParam = (TokenParam) nextOrParams; code = nextParam.getValue(); system = nextParam.getSystem(); if (nextParam.getModifier() == TokenParamModifier.NOT) { paramInverted = true;
if (theParameter instanceof TokenParam) { TokenParam id = (TokenParam) theParameter; system = id.getSystem(); code = (id.getValue()); modifier = id.getModifier();
/** * 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); }
sourceIdentifier.setSystem(sourceIdentifierParam.getSystem()) .setValue(sourceIdentifierParam.getValue()); } else {