I have a problem with custom resources. I'm doing a restful server to access to clinical information form a external database, and I have a custom resource: MyAppointment, with a custom attribute. My question is, when a client uses my web service, need the client to have a class in his code identical that my MyAppointment.class for do this:
// Create a client (only needed once)
FhirContext ctx = new FhirContext();
IGenericClient client = ctx.newRestfulGenericClient("http://localhost:8080/restful-server-example/fhir");
// Invoke the client
Bundle bundle = client.search().forResource(Appointment.class)
.where(new StringClientParam("patient").matches().value("1232"))
.where(new StringClientParam("fechaDesde").matches().value("2"))
.where(new StringClientParam("fechaHasta").matches().value("2"))
.execute();
**MyAppointment** appo= (**MyAppointment**) bundle.getEntry().get(0).getResource();
If not, how can the client get de Custom Resource?
Thanks