Stream: hapi
Topic: Coverage API
Shiva Kumar Konduru (Nov 06 2020 at 05:52):
Hi everyone ....we are using hapifhir to call an FHIR compliant API...........as part of this...we need to search for Coverage resource.....need guidance in preparing the request params for the same...
Code to search the Coverage Resource -
Bundle bundle2 = client
.search()
.forResource(Coverage.class)
.where(Coverage.BENEFICIARY.hasChainedProperty(Patient.FAMILY.matches().value("UONOMI"))).
and(Coverage.BENEFICIARY.hasChainedProperty(Patient.GIVEN.matches().value("TYREEK"))).
and(Coverage.BENEFICIARY.hasChainedProperty(Patient.BIRTHDATE.beforeOrEquals().day("1926-12-29"))).
where(new TokenClientParam("Coverage.period.end").exactly().code("2020-11-05"))
.where(new TokenClientParam("Coverage.period.start").exactly().code("2020-11-05")).
and(Coverage.BENEFICIARY.hasChainedProperty(
Patient.IDENTIFIER.hasSystemWithAnyCode(("http://terminology.hl7.org/CodeSystem/v2-0203|MB|101210097")))).
include(Coverage.INCLUDE_BENEFICIARY)
.returnBundle(Bundle.class)
.withAdditionalHeader("Content-Type", "application/x-www-form-urlencoded").withAdditionalHeader("x-subject-id", "1")
.execute();
Error:
2020-11-05 21:27:43.968 TRACE 13960 --- [nio-8080-exec-3] ca.uhn.fhir.rest.client.impl.BaseClient : FHIR response:
ca.uhn.fhir.rest.client.apache.ApacheHttpResponse@37fecfeb
{"issue":[{"severity":"error","diagnostics":"","code":"invalid","expression":"Bundle","details":{"text":"object instance has properties which are not allowed by the schema: ['beneficiary.identifier','beneficiary.identifier..code','beneficiary.identifier..system','beneficiary.identifier..value']"}}],"resourceType":"OperationOutcome"}
ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 Bad Request
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Vibin_chander (Nov 09 2020 at 11:42):
I do have one question on the coverage API. My app has a list of insurance plan names that it can accept. Anything that does not belong to the list should not go to HAPI server
Vibin_chander (Nov 09 2020 at 11:43):
Any idea if it is possible to restrict it in HAPI. Meaning, making HAPI to reject the coverage resource if it does not have the plan name preloaded in hapi
Last updated: Apr 12 2022 at 19:14 UTC