Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and publish docker image #8

Open
wants to merge 19 commits into
base: 7-build-and-publish-a-docker-image-for-xds-mediator-running-as-a-jar
Choose a base branch
from
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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
83 changes: 83 additions & 0 deletions mediator.properties
Original file line number Diff line number Diff line change
@@ -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
[email protected]
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
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<Subscription> subscriptions = subscriptionRepository.findActiveSubscriptions(facilityQuery);
for (Subscription subscription: subscriptions) {
Expand Down Expand Up @@ -78,9 +81,23 @@ public void newDocumentForPullPoint(String docId, String locationId) {
pullPoint.registerDocument(docId);
}

@Override

public List<String> getDocumentsForPullPoint(String locationId) {
PullPoint pullPoint = pullPointFactory.get(locationId);
return pullPoint.getDocumentIds();
}


@Override
public void newDocumentForPullPoint(CreatePullPoint createPullPointRequest) {
Copy link
Author

@HerbertYiga HerbertYiga Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced these changes for this file ie (DsubServiceImpl.java) so as to atleast have mvn clean install -DskipTests passing for the mean time cc @pmanko

// TODO Auto-generated method stub

}


@Override
public List<NotificationMessageHolderType> getDocumentsForPullPoint(String locationId, Integer max) {
// TODO Auto-generated method stub
return null;
}
}