/** * This is translated into a URL similar to the following: * http://fhir.healthintersections.com.au/open/Patient?identifier=urn:oid:1.2.36.146.595.217.0.1%7C12345 */ @Search List<Patient> findPatientsForMrn(@RequiredParam(name = Patient.SP_IDENTIFIER) IdentifierDt theIdentifier);
parameter.setName(((RequiredParam) nextAnnotation).name()); parameter.setRequired(true); parameter.setDeclaredTypes(((RequiredParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((RequiredParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((RequiredParam) nextAnnotation).chainWhitelist(), ((RequiredParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
parameter.setName(((RequiredParam) nextAnnotation).name()); parameter.setRequired(true); parameter.setDeclaredTypes(((RequiredParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((RequiredParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((RequiredParam) nextAnnotation).chainWhitelist(), ((RequiredParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
@Search(queryName="namedQuery1") public List<Patient> searchByNamedQuery(@RequiredParam(name="someparam") StringParam theSomeParam) { List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: searchNamedQuery
parameter.setName(((RequiredParam) nextAnnotation).name()); parameter.setRequired(true); parameter.setDeclaredTypes(((RequiredParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((RequiredParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((RequiredParam) nextAnnotation).chainWhitelist(), ((RequiredParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
@Search public List<Patient> findPatients( @RequiredParam(name="foo") StringParam theParameter, HttpServletRequest theRequest, HttpServletResponse theResponse) { List<Patient> retVal=new ArrayList<Patient>(); // populate this return retVal; } //END SNIPPET: underlyingReq
parameter.setName(((RequiredParam) nextAnnotation).name()); parameter.setRequired(true); parameter.setDeclaredTypes(((RequiredParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((RequiredParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((RequiredParam) nextAnnotation).chainWhitelist(), ((RequiredParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
@Search() public List<Practitioner> findPractitionersByName( @RequiredParam(name = Practitioner.SP_NAME) final StringDt theName) { // throw new UnprocessableEntityException( // "Please provide more than 4 characters for the name"); return Lists.newArrayList(); }
/** A FHIR search */ @Search public List<Patient> findPatientsByIdentifier(@RequiredParam(name="identifier") IdentifierDt theIdentifier);
@Search List<Patient> getPatientByDob(@RequiredParam(name=Patient.SP_BIRTHDATE) DateParam theParam);
/** * The "@Search" annotation indicates that this method supports the * search operation. You may have many different method annotated with * this annotation, to support many different search criteria. This * example searches by family name. * * @param theIdentifier * This operation takes one parameter which is the search criteria. It is * annotated with the "@Required" annotation. This annotation takes one argument, * a string containing the name of the search criteria. The datatype here * is StringDt, but there are other possible parameter types depending on the * specific search criteria. * @return * This method returns a list of Patients. This list may contain multiple * matching resources, or it may also be empty. */ @Search() public List<Patient> getPatient(@RequiredParam(name = Patient.SP_FAMILY) StringDt theFamilyName);
@Search() public List<Observation> searchByObservationNames( @RequiredParam(name=Observation.SP_CODE) TokenOrListParam theCodings ) { // The list here will contain 0..* codings, and any observations which match any of the // given codings should be returned List<TokenParam> wantedCodings = theCodings.getValuesAsQueryTokens(); List<Observation> retVal = new ArrayList<Observation>(); // ...populate... return retVal; } //END SNIPPET: searchMultiple
/** * This method is a Patient search, but HAPI can not automatically * determine the resource type so it must be explicitly stated. */ @Search(type=Patient.class) public Bundle searchForPatients(@RequiredParam(name=Patient.SP_NAME) StringDt theName) { Bundle retVal = new Bundle(); // perform search return retVal; }
@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
@Search() public List<Observation> searchByDateRange( @RequiredParam(name=Observation.SP_DATE) DateRangeParam theRange ) { Date from = theRange.getLowerBoundAsInstant(); Date to = theRange.getUpperBoundAsInstant(); List<Observation> retVal = new ArrayList<Observation>(); // ...populate... return retVal; } //END SNIPPET: dateRange
@Search() public List<Observation> searchByComposite( @RequiredParam(name=Observation.SP_CODE_VALUE_DATE, compositeTypes= {TokenParam.class, DateParam.class}) CompositeParam<TokenParam, DateParam> theParam) { // Each of the two values in the composite param are accessible separately. // In the case of Observation's name-value-date, the left is a string and // the right is a date. TokenParam observationName = theParam.getLeftValue(); DateParam observationValue = theParam.getRightValue(); List<Observation> retVal = new ArrayList<Observation>(); // ...populate... return retVal; } //END SNIPPET: searchComposite
@Search public List<DiagnosticReport> findReportsWithChain( @RequiredParam(name=DiagnosticReport.SP_SUBJECT, chainWhitelist= {Patient.SP_FAMILY, Patient.SP_GENDER}) ReferenceParam theSubject ) { List<DiagnosticReport> retVal=new ArrayList<DiagnosticReport>(); String chain = theSubject.getChain(); if (Patient.SP_FAMILY.equals(chain)) { String familyName = theSubject.getValue(); // .. populate with reports matching subject family name .. } if (Patient.SP_GENDER.equals(chain)) { String gender = theSubject.getValue(); // .. populate with reports matching subject gender .. } return retVal; } //END SNIPPET: referenceWithChain
@Search public List<DiagnosticReport> findReportsWithChainCombo ( @RequiredParam(name=DiagnosticReport.SP_SUBJECT, chainWhitelist= {"", Patient.SP_FAMILY}) ReferenceParam theSubject ) { List<DiagnosticReport> retVal=new ArrayList<DiagnosticReport>(); String chain = theSubject.getChain(); if (Patient.SP_FAMILY.equals(chain)) { String familyName = theSubject.getValue(); // .. populate with reports matching subject family name .. } if ("".equals(chain)) { String resourceId = theSubject.getValue(); // .. populate with reports matching subject with resource ID .. } return retVal; } //END SNIPPET: referenceWithChainCombo
@Search() public List<Observation> getObservationsByQuantity( @RequiredParam(name=Observation.SP_VALUE_QUANTITY) QuantityParam theQuantity) { List<Observation> retVal = new ArrayList<Observation>(); ParamPrefixEnum prefix = theQuantity.getPrefix(); BigDecimal value = theQuantity.getValue(); String units = theQuantity.getUnits(); // .. Apply these parameters .. // ... populate ... return retVal; } //END SNIPPET: quantity