@Search public List<Organization> getAllOrganizations() { List<Organization> retVal=new ArrayList<Organization>(); // populate this return retVal; } //END SNIPPET: searchAll
@Search(compartmentName="Condition") public List<IBaseResource> searchCompartment(@IdParam IdType thePatientId) { List<IBaseResource> retVal=new ArrayList<IBaseResource>(); // populate this with resources of any type that are a part of the // "Condition" compartment for the Patient with ID "thePatientId" return retVal; }
@Search(queryName="namedQuery1") public List<Patient> searchByNamedQuery(@RequiredParam(name="someparam") StringParam theSomeParam) { List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: searchNamedQuery
@Search public List<Patient> search( SummaryEnum theSummary, // will receive the summary (no annotation required) @Elements Set<String> theElements // (requires the @Elements annotation) ) { return null; // todo: populate } //END SNIPPET: summaryAndElements
@Search public List<IBaseResource> searchAll() { List<IBaseResource> retVal = new ArrayList<>(); for (TreeMap<Long, T> next : myIdToVersionToResourceMap.values()) { if (next.isEmpty() == false) { T nextResource = next.lastEntry().getValue(); retVal.add(nextResource); } } mySearchCount.incrementAndGet(); return retVal; }
@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
@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(); }
/** * 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);
/** A FHIR search */ @Search public List<Patient> findPatientsByIdentifier(@RequiredParam(name="identifier") IdentifierDt theIdentifier);
@Search List<Patient> getPatientByDob(@RequiredParam(name=Patient.SP_BIRTHDATE) DateParam theParam);
@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> 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<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<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<Patient> searchByNames( @RequiredParam(name=Patient.SP_FAMILY) StringParam theFamilyName, @OptionalParam(name=Patient.SP_GIVEN) StringParam theGivenName ) { String familyName = theFamilyName.getValue(); String givenName = theGivenName != null ? theGivenName.getValue() : null; List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: searchOptionalParam
@Search() public List<Patient> searchByObservationNames( @RequiredParam(name=Patient.SP_BIRTHDATE) DateParam theDate ) { ParamPrefixEnum prefix = theDate.getPrefix(); // e.g. gt, le, etc.. Date date = theDate.getValue(); // e.g. 2011-01-02 TemporalPrecisionEnum precision = theDate.getPrecision(); // e.g. DAY List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: dates
@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
@Description(shortDefinition="This search finds all patient resources matching a given name combination") @Search() public List<Patient> searchWithDocs( @Description(shortDefinition="This is the patient's last name - Supports partial matches") @RequiredParam(name=Patient.SP_FAMILY) StringParam theFamilyName, @Description(shortDefinition="This is the patient's given names") @OptionalParam(name=Patient.SP_GIVEN) StringParam theGivenName ) { List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: searchWithDocs