Hi Jonathan,

Are you intentionally using the person resource rather than the patient
one? Because for 95% of use cases, the patient resource is the right one.
(Also, you can't search on the person resource for patient ids.)

I peeked quickly at the code, and I think the person resource delegates its
searching
to org.openmrs.api.db.hibernate.HibernatePersonDAO.getPeople(String,
Boolean). This method *does* look at the given, middle, family, and family2
name components. If you're actually intending to search via the person
resource, and you're really seeing this bug, I'll research further.

Assuming you actually want the patient resource, as far as I know whatever
you pass as its q parameter is treated identically to the patient search
box in OpenMRS. (I.e. you can find partial names, or exact identifiers)

-Darius

On Mon, Apr 16, 2012 at 11:29 AM, Jonathan Galingan <[email protected]>wrote:

> When I tried:
> http://localhost:8080/openmrs/ws/rest/v1/person?q=john
>
> it only searched through patients that have a given name "john" . I wanted
> to also get people with the middle name or last name of "Johnson"
> Would anybody know how to make the webservices do that?
>
> I then tried:
> http://localhost:8080/openmrs/ws/rest/v1/person?q=john_smith
>
> it now searched through patients that have a given name "john" while the
> middle name or last name is "smith." Is it possible to make this to return
> a patient named "smith Johnson"?
>
> For the identifier I tried:
> http://localhost:8080/openmrs/ws/rest/v1/person?q=123
>
> I have a patient with an id of "123" but it did not search for it. Would I
> need to change the q to something else?
>
> On Mon, Apr 16, 2012 at 9:39 PM, Friedman, Roger (CDC/CGH/DGHA) (CTR) <
> [email protected]> wrote:
>
>>  the q parameter will search both name and ID.  i would search on id and
>> then verify that the name returned is the one expected.****
>>
>> ** **
>>
>> *From:* [email protected] [mailto:[email protected]] *On
>> Behalf Of *Jonathan Galingan
>> *Sent:* Sunday, April 15, 2012 8:46 PM
>> *To:* [email protected]
>> *Subject:* [OPENMRS-IMPLEMENTERS] Help with webservices****
>>
>> ** **
>>
>> Hi, I'm trying to replicate the patient search box of OpenMRS in OpenERP
>> to integrate the two. ****
>>
>> ** **
>>
>> Would anybody know how a complete name with identifier could be searched
>> through the webservices?****
>>
>>
>>
>> --
>> Jonathan D. Galingan, MD****
>>
>> Project Manager for Computerization****
>>
>> Philippine General Hospital****
>>
>> ** **
>>  ------------------------------
>>
>> Click here to 
>> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from
>>  OpenMRS Implementers' mailing list
>> ****
>>  ------------------------------
>> Click here to 
>> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from
>>  OpenMRS Implementers' mailing list
>>
>
>
>
> --
> Jonathan D. Galingan, MD
> Project Manager for Computerization
> Philippine General Hospital
>
>  ------------------------------
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from
>  OpenMRS Implementers' mailing list
>

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-implement-l" in the  body 
(not the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l]

Reply via email to