Class HuskyService

java.lang.Object
org.projecthusky.communication.services.HuskyService

@Component public class HuskyService extends Object
The main service class to use when working with the EPD web services. As it is marked as a @Component, it will be immediately available in your application to reference.
It provides query building capabilities and executing those queries against a targeted service.
Functionality built so far: Use it as follows:
 @Autowired
 private HuskyService service; //get an instance of the service class
 private String senderApp; //e.g. like the test-app: "1.2.3.4"
 private String searchWebServiceUri; //The address where the webservice resides.

 public void doMyBusinessStuff() {
   Destination dest = Destination.builder().uri(URI.create(searchWebServiceUri)).senderApplicationOid(senderApp).build();
   Name patientName = new Name(Name.builder().withFamily("Anders").build()); //This was not refactored yet, so creation is a bit weird.

   //Build the query, starting from the central service. Set all parameters you wish to send.
   PdqSearchQuery query = this.service.startBuildingSearchQuery(dest)
     .patientName(patientName).build();

   //Send your search parameters (name) to the service and receive the results.
   PdqSearchResults result = this.service.send(query);

   //see your results for the name given as search parameter:
   for (FhirPatient patient: result.getPatients()) {
        //do business
   }
 }
 
Author:
szalai
See Also: