Hi,
Currently I have a method with below signature which returns list of resources (document references) when a GET request (http://localhost:8090/fhir/DocumentReference?subject.identifier=DEFAULT|1000) is made.
@Search
public List<BaseResource> findDocumentReferencesById(@RequiredParam(
name = DocumentReference.SP_SUBJECT,
chainWhitelist = {Patient.SP_IDENTIFIER, Practitioner.SP_IDENTIFIER}
)) {
...
List<BaseResource> response = new ArrayList<>();
response.add(documentReference);
...
return response;
}
This returns all the document references but I want to add a fake search object with random score like below for each of document references (for testing purposes, since this does not include all the search match code) :
"search":{
"mode":"match",
"score":1
}
Current output:
{
"resourceType": "Bundle",
...
"entry": [
{
"fullUrl": "some generated url",
"resource": {
"resourceType": "DocumentReference",
"id": "1",
"subject": {
"reference": "Patient/1"
}
}
}
]
}
Desired output:
{
"resourceType": "Bundle",
...
"entry": [
{
"fullUrl": "some generated url",
"resource": {
"resourceType": "DocumentReference",
"id": "1",
"subject": {
"reference": "Patient/1"
},
"search":{
"mode":"match",
"score":1
}
}
}
]}
I cannot add a bundle to the response since it will just create another bundle and would not add the search object at the resource level.
Any ideas?
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/8a24d5fd-3dc5-46d2-89d3-68cacc0b566e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/39d62451-2d40-4310-9ca4-cfc5cfc77f3d%40googlegroups.com.