...
Code Block | ||
---|---|---|
| ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <artifactId>epsos</artifactId> <groupId>se.apotekensservice</groupId> <version>1.0-SNAPSHOT</version> </parent> <groupId>se.apotekensservice</groupId> <artifactId>epsos-ncp</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>Package OpenNCP</name> <description>This project fetches the OpenNCP epsos-ws-server.war. It then unpacks it, adds the shelob.jar dependency and creates a new web archive</description> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.5.1</version> <executions> <execution> <id>unpack</id> <phase>package</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>${project.openNcpGroupId}</groupId> <artifactId>${project.openNcpArtifactId}</artifactId> <version>${project.openNcpVersion}</version> <type>war</type> <overWrite>true</overWrite> <outputDirectory>${project.build.directory}/epsos-ws-server</outputDirectory> <includes></includes> <excludes>epsos-ws-server-mock*.jar</excludes> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>${project.shelobGroupId}</groupId> <artifactId>${project.shelobArtifactId}</artifactId> <version>${project.shelobVersion}</version> </dependency> <dependency> <groupId>${project.openNcpGroupId}</groupId> <artifactId>${project.openNcpArtifactId}</artifactId> <version>${project.openNcpVersion}</version> <type>war</type> </dependency> </dependencies> <properties> <!-- OpenNCP war --> <project.openNcpGroupId>eu.europa.ec.joinup.ecc.epsos-protocol-terminators.epsos-ncp-server</project.openNcpGroupId> <project.openNcpArtifactId>epsos-ws-server</project.openNcpArtifactId> <project.openNcpVersion>0.2.1-SNAPSHOT</project.openNcpVersion> <!-- Shelob jar --> <project.shelobGroupId>se.apotekensservice</project.shelobGroupId> <project.shelobArtifactId>epsos-shelob</project.shelobArtifactId> <project.shelobVersion>0.0.1-SNAPSHOT</project.shelobVersion> </properties> </project> |
XCA DocumentSearchInterface usage
Interfaces
The current implementation of the interface is as follows:
public interface DocumentSearchInterface extends NationalConnectorInterface {
public DocumentAssociation<PSDocumentMetaData> getPSDocumentList(SearchCriteria searchCriteria);
public List<DocumentAssociation<EPDocumentMetaData>> getEPDocumentList(SearchCriteria searchCriteria);
public EPSOSDocument getDocument(SearchCriteria searchCriteria);
}
The DocumentAssociation interface
public interface DocumentAssociation<T extends EPSOSDocumentMetaData> {
public T getXMLDocumentMetaData();
public T getPDFDocumentMetaData();
public String getDocumentClassCode(String documentId);
public String getPatientId(String documentId);
}
The DocumentAssociation will store XML and PDF document metadata and has two helper methods for searching document's classCode and patientId.
The EPSOSDocumentMetaData
public interface EPSOSDocumentMetaData {
public String getId();
public String getPatientId();
public int getFormat();
public Date getEffectiveTime();
public String getClassCode();
public String getRepositoryId();
public String getTitle();
public String getAuthor();
}
This interface is a parent for EPDocumentMetaData and PSDocumentMetaData that reprecent the EPrescription and PatientSummary metaDatas.
The EPSOSDocument
public interface EPSOSDocument extends EPSOSDocumentMetaData {
public EPSOSDocumentMetaData getMetaData();
public org.w3c.dom.Document getDocument();
public boolean matchesCriteria(SearchCriteria sc);
}
The EPSOSDocument has one document metaData and the actual DOM document. The interface also has a helper method for checking that if the SearchCriteria matches the DocumentMetaData
The SearchCriteria
public interface SearchCriteria {
public enum Criteria {
PatientId,
RepositoryId,
DocumentId
}
public SearchCriteria add(Criteria c, String value);
public String getCriteriaValue(Criteria c);
public Iterator<Criteria> getSearchCriteriaKeys();
}
The SearchCriteria interface reprecents the criteria what will be used for searching the metaData and DOM documents from the national side. Currently the possible criteria values are in the Criteria enum.
Implementation
From the national component side
From the national component the usage of this interface, when returning DocumentAssociations should be something like:
EPDocumentMetaData epdXml = DocumentFactory.createEPDocumentXML(documentId, patientId, effectiveDate, repositoryId, title, author);
EPDocumentMetaData epdPdf = DocumentFactory.createEPDocumentPDF(documentId, patientId, effectiveDate, repositoryId, title, author);
DocumentFactory.createDocumentAssociation(epdXml, epdPdf);
PSDocumentMetaData psdPdf = DocumentFactory.createPSDocumentPDF(documentId, patientId, effectiveDate, repositoryId, title, author);
PSDocumentMetaData psdXml = DocumentFactory.createPSDocumentXML(documentId, patientId, effectiveDate, repositoryId, title, author);
DocumentFactory.createDocumentAssociation(psdPdf, psdXml);
And when returning the (DOM) document itself, should be implemented for example like:
DocumentFactory.createEPSOSDocument(EPDocumentMetaData/PSDocumentMetaData, DOMDocument);
From the XCAService component side
From the XCAService component side the usage of this interface is as following, when fetching PatientSummary document metadatas:
DocumentAssociation<PSDocumentMetaData> daPs = documentSearchService.getPSDocumentList(DocumentFactory.createSearchCriteria().add(Criteria.PatientId, "patientId"));
And when fetching EPrescriptions metadatas:
List<DocumentAssociation<EPDocumentMetaData>> prescriptions = documentSearchService.getEPDocumentList(DocumentFactory.createSearchCriteria().add(Criteria.PatientId, "patientId"));
And when fetching the actual DOM document with metada:
EPSOSDocument epsosDoc = documentSearchService.getDocument(DocumentFactory.createSearchCriteria().add(Criteria.DocumentId, "documentId").add(Criteria.PatientId, "patientId").add(Criteria.RepositoryId, "repositoryId"));
References
...