Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase 6: Improve documentation #492

Open
josephjclark opened this issue Mar 20, 2024 · 1 comment
Open

Phase 6: Improve documentation #492

josephjclark opened this issue Mar 20, 2024 · 1 comment

Comments

@josephjclark
Copy link
Collaborator

josephjclark commented Mar 20, 2024

OpenMRS docs don't currently give you a lot of help with query APIs:

image

A couple of comments on this:

  • "Sarah" in the example should be in a string. The example is invalid Javascript.
  • No query arguments are documented. What shape is thequery object? What do you want from me?
  • What does the q query string actually mean? According to the openMRS docs it means "display name of patient" - so we should probably reflect that somewhere.

The wider issue is that each endpoint has a bunch of different query parameters, where q seems pretty common (although maybe with different semantics), and limit is usually accepted I think but even OpenMRS don't document it properly.

The query object provided by our adaptor maps 1:1 with the query parameters in the OpenMRS rest API.

So: I think each operation should have a better, more correct high level explanation, and include a link to the query parameters documented on openMRS. I do not think we should document each parameter on our own docs.

Maybe something like this mock up?

image

API improvement

I wonder if an improvement on the API would be something like:

searchPatient(name, options, callback)

Where name is the query string (maps toq, and we document that` and, options is an optional list of other parameters. I wonder if that scales nicely across the adaptor

@github-project-automation github-project-automation bot moved this to New Issues in v2 Mar 20, 2024
@josephjclark josephjclark changed the title OpenMRS: Improve docmentation OpenMRS: Improve documentation Mar 21, 2024
@christad92 christad92 moved this from New Issues to Icebox in v2 Mar 25, 2024
@josephjclark josephjclark changed the title OpenMRS: Improve documentation Phase 6: Improve documentation Jan 27, 2025
@josephjclark
Copy link
Collaborator Author

Counter point: maybe search needs to be a generic seach, so search(resourceType, query, options), where query changes for each endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

1 participant