In order to implement the national connector to connect the country local infrastructure with OpenNCP you have to follow the stps below:

Step-by-step guide

Add the steps involved:

  1. Clone the epsos-nc-mock from bitbucket, git clone git@bitbucket.org:openncp/epsos-nc-mock.git
  2. Focus on the following three classes
    1. PatientSearchImpl, it is called during XCPD queries
    2. DocumentSearchImpl, it is called during XCA List and XCA Retrieve queries (both patient summary and eprescription documents)
    3. DocumentSubmitImpl, it is called in XDR submissions (consent, dispensations)
  3. Implement these classes, according to comments exist in the class body. The general guide is described below
  4. Build the project using the command mvn clean package. The produced jar has to be copied inside epsos-ws-server/WEB-INF/lib folder and delete accordingly the existing (if any) epeos-nc-mock* file

Classes to be implemented

PatientSearchImpl

In this class you have access to the list of patient identifiers passed by epsos-client-connector to epsos-ws-server

You have to firstly get the patient data from your internal system and then just populate the PatientDemographics object e.g. 

// Setting up the demographic data, you have to replace the new String with the data come from your system
PatientDemographics demographics = new PatientDemographics();
demographics.setIdList(Arrays.asList(idList.get(0)));
demographics.setFamilyName(new String());
demographics.setGivenName(new String());
demographics.setEmail(new String());
demographics.setStreetAddress(new String());
demographics.setPostalCode(new String());
demographics.setTelephone(new String());
demographics.setCity(new String());
demographics.setCountry(new String());
// Adding data into demographics list
patientDemographicslist.add(demographics);

DocumentSearchImpl

In this class you have access to the patient id string which is like this: 1167^^^&1.12.15.18.9.4.1.895&ISO. The XCPD response contains this unique identifier for the patient with which you can proceed to the next queries (XCA List and XCA Retrieve). The flow here is the following:

DocumentSubmitImpl

In this class you handle all the submissions made by the others country NCP-B. You have access the EPSOSDocument object from which you can extract the appropriate data and proceed with the local business logic

Related articles

Integration of Protocol Terminators with National Connector

Related issues