National Connector Implementation

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

  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:

  • Patient Summary Documents
    • You have to create DocumentAssociation<PSDocumentMetaData>, which will provide the document metadata for the pair of patient summary documents
    • You have to implement the getDocument method, in which according to the unique documentId you will fetch data from your system, transform it to cda and finally create and EPSOSDocument object 
  • ePrescriptiion Documents
    • You have to create  List<DocumentAssociation<EPDocumentMetaData>>, which will provide the list of documents related to ePrescription

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

Integration of Protocol Terminators with National Connector