diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0da36a6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# build stage build the jar with all our resources +FROM openjdk:8-jdk as build + +VOLUME /tmp +WORKDIR / + +ADD . . + +RUN apt-get update +RUN apt-get install -y maven +RUN mvn clean install -DskipTests + +COPY . /target/mediator-xds-1.0.3-jar-with-dependencies.jar / + +ENTRYPOINT java -jar mediator-xds-1.0.3-jar-with-dependencies.jar --conf mediator.properties \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..da495a7 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +version: '3.8' +services: + xds-mediator: + container_name: xds-mediator + hostname: xds-mediator + image: xds-mediator:latest + volumes: + #data is the directory which you want to persist the generated parquet files + - ../data:/tmp \ No newline at end of file diff --git a/mediator.properties b/mediator.properties new file mode 100644 index 0000000..d57d430 --- /dev/null +++ b/mediator.properties @@ -0,0 +1,83 @@ +# Mediator Properties +mediator.name=xds-mediator +mediator.host=localhost +mediator.port=8500 +mediator.timeout=$SERVER_TIMEOUT +mediator.mongo.host=mongodb +mediator.mongo.port=27017 + +core.host=$SERVER_NAME +core.api.port=8080 +core.api.user=root@openhim.org +core.api.password=$IL_PASSWORD + +# Assigning authorities to resolve to during transaction enrichment +client.requestedAssigningAuthority=http://openclientregistry.org/fhir/sourceid +client.requestedAssigningAuthorityId=http://openclientregistry.org/fhir/sourceid +provider.requestedAssigningAuthority=EPID +provider.requestedAssigningAuthorityId=EPID +facility.requestedAssigningAuthority=ELID +facility.requestedAssigningAuthorityId=ELID + +# == Workflow == +pnr.patients.autoRegister=false +pnr.providers.enrich=true +pnr.facilities.enrich=true + +# == PIX Manager == +pix.manager.host=ohie-cr +pix.manager.port=3600 +pix.manager.securePort=3600 +pix.sendingApplication=openhim +pix.sendingFacility=openhim-mediator-ohie-xds +pix.receivingApplication=pix +pix.receivingFacility=pix +pix.secure=false + +# == CSD Infoman (interlinked registry) == +ilr.host=ohie-ilr +ilr.port=8984 +ilr.csr.path=/CSD/csr/DHIS/careServicesRequest +ilr.query.expression.provider=//CSD/providerDirectory/provider/otherID[@code='id'] +ilr.query.expression.facility=//CSD/facilityDirectory/facility/otherID[@code='code'] + +# == Terminology Service == +ts.host=localhost +ts.port=8080 + +# == IHE XDS Registry == +xds.registry.host=openxds +xds.registry.port=8010 +xds.registry.securePort=8011 +xds.registry.path=/axis2/services/xdsregistryb +xds.registry.secure=false + +# == IHE XDS Repository == +xds.repository.host=openshr +xds.repository.port=8080 +xds.repository.securePort=8080 +xds.repository.path=/openmrs/ms/xdsrepository +xds.repository.UniqueId=1.3.6.1.4.1.21367.2010.1.2.1125 +xds.repository.secure=false + +# == ATNA == +# IHE syslog collector +atna.host=localhost +atna.useTcp=true +atna.tcpPort=5052 +atna.udpPort=5050 +atna.secure=false + +# == IHE infrastructure security == +# use absolute path +ihe.keystore=/openhim-mediator-xds/src/main/resources/tls/ihe/keystore.jks +ihe.keypassword=Jembi#123 +ihe.storepassword=Jembi#123 +# The OID that uniquely identifies this system +ihe.systemSourceID=1.3.6.1.4.1.21367.2010.1.2.2045 + +# == FHIR MPI == +# fhir.mpiUrl=http://ohie-il_demo:5001/OCR/fhir +fhir.mpiUrl=http://sedish.net:5001/OCR/fhir +fhir.mpiClientName=opencr +fhir.mpiPassword=1234 \ No newline at end of file diff --git a/src/main/java/org/openhim/mediator/dsub/service/DsubServiceImpl.java b/src/main/java/org/openhim/mediator/dsub/service/DsubServiceImpl.java index 3aa57f5..9bfa87d 100644 --- a/src/main/java/org/openhim/mediator/dsub/service/DsubServiceImpl.java +++ b/src/main/java/org/openhim/mediator/dsub/service/DsubServiceImpl.java @@ -1,6 +1,9 @@ package org.openhim.mediator.dsub.service; import akka.event.LoggingAdapter; + +import org.oasis_open.docs.wsn.b_2.CreatePullPoint; +import org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType; import org.openhim.mediator.dsub.pull.PullPoint; import org.openhim.mediator.dsub.pull.PullPointFactory; import org.openhim.mediator.dsub.subscription.Subscription; @@ -41,7 +44,7 @@ public void createSubscription(String url, String facilityQuery, Date terminateA } } - private boolean subscriptionExists(String url, String facilityQuery) { + public Boolean subscriptionExists(String url, String facilityQuery) { Boolean exists = false; List subscriptions = subscriptionRepository.findActiveSubscriptions(facilityQuery); for (Subscription subscription: subscriptions) { @@ -78,9 +81,23 @@ public void newDocumentForPullPoint(String docId, String locationId) { pullPoint.registerDocument(docId); } - @Override + public List getDocumentsForPullPoint(String locationId) { PullPoint pullPoint = pullPointFactory.get(locationId); return pullPoint.getDocumentIds(); } + + + @Override + public void newDocumentForPullPoint(CreatePullPoint createPullPointRequest) { + // TODO Auto-generated method stub + + } + + + @Override + public List getDocumentsForPullPoint(String locationId, Integer max) { + // TODO Auto-generated method stub + return null; + } }