Skip to content

Commit

Permalink
feat(#114): configurator changes
Browse files Browse the repository at this point in the history
  • Loading branch information
witash committed May 31, 2024
1 parent aba7c95 commit fda229f
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 35 deletions.
134 changes: 117 additions & 17 deletions cht-config/app_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,31 +442,41 @@
"mark_for_outbound": true
},
"outbound": {
"FHIR_patient": {
"relevant_to": "doc.type === 'person' && doc.role == 'patient'",
"patient": {
"relevant_to": "doc.type === 'person' && doc.patient_id && doc.role === 'patient'",
"destination": {
"base_url": "http://openhim-core:5001",
"path": "/mediator/patient",
"path": "/mediator/cht/patient",
"auth": {
"type": "basic",
"username": "interop-client",
"password_key": "openhim1"
}
},
"mapping": {
"resourceType": {
"expr": "'Patient'"
},
"identifier": {
"expr": "[{ \"system\": \"cht\", \"use\": \"official\", \"value\": doc._id }]",
"optional": false
},
"name": {
"expr": "[ { \"use\":\"official\", \"family\": doc.name , \"given\": [ doc.short_name ] } ]",
"optional": false
},
"gender": "doc.sex",
"birthDate": "doc.date_of_birth"
"doc._id": "doc._id",
"doc.name": "doc.name",
"doc.phone": "doc.phone",
"doc.date_of_birth": "doc.date_of_birth",
"doc.sex": "doc.sex",
"doc.patient_id": "doc.patient_id"
}
},
"patient_id": {
"relevant_to": "doc.type === 'data_record' && doc.form === 'OPENMRS_PATIENT'",
"destination": {
"base_url": "http://openhim-core:5001",
"path": "/mediator/cht/patient_ids",
"auth": {
"type": "basic",
"username": "interop-client",
"password_key": "openhim1"
}
},
"mapping": {
"doc._id": "doc._id",
"doc.patient_id": "doc.patient_id",
"doc.external_id": "doc.fields.external_id"
}
},
"FHIR_practitioner": {
Expand Down Expand Up @@ -570,6 +580,96 @@
},
"set_task": true
}
},
"OPENMRS_PATIENT": {
"meta": {
"code": "openmrs_patient",
"translation_key": "forms.n.title",
"icon": "medic-person"
},
"fields": {
"age_in_days": {
"labels": {
"tiny": {
"en": "Age in Days"
},
"short": {
"en": "Age in Days"
}
},
"position": 0,
"type": "integer",
"required": true
},
"patient_name": {
"labels": {
"tiny": {
"en": "patient_name"
},
"short": {
"en": "Patient Name"
}
},
"position": 1,
"type": "string",
"length": [
1,
40
],
"required": true
},
"phone_number": {
"labels": {
"tiny": {
"en": "patient phone"
},
"short": {
"en": "patient Phone"
}
},
"position": 2,
"flags":{
"allow_duplicate": false
},
"type": "phone_number",
"required": true
},
"location_id": {
"labels": {
"tiny": {
"en": "location_id"
},
"short": {
"en": "location_id"
}
},
"position": 3,
"type": "string",
"length": [
1,
60
],
"required": true
},
"external_id": {
"labels": {
"tiny": {
"en": "OpenMRS ID"
},
"short": {
"en": "OpenMRS ID"
}
},
"position": 4,
"type": "string",
"length": [
1,
60
],
"required": true
}
},
"public_form": true
}
}
}
}
2 changes: 1 addition & 1 deletion configurator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /scripts/cht-config

COPY ../cht-config ./

RUN npm install && npm install -g cht-conf
RUN npm install && npm install -g cht-conf && python -m pip install git+https://github.com/medic/[email protected]#egg=pyxform-medic

WORKDIR /scripts/configurator

Expand Down
2 changes: 1 addition & 1 deletion configurator/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const OPENHIM_CLIENT_PASSWORD = process.env.OPENHIM_CLIENT_PASSWORD || 'interop-
const OPENHIM_USER_PASSWORD = process.env.OPENHIM_USER_PASSWORD || 'interop-password';

const OPENMRS_HOST = process.env.OPENMRS || 'openmrs';
const OPENMRS_PORT = process.env.OPENMRS_PORT || 8090;
const OPENMRS_PORT = process.env.OPENMRS_PORT || 8080;
const OPENMRS_USERNAME =
process.env.OPENMRS_USERNAME || 'admin';
const OPENMRS_PASSWORD =
Expand Down
2 changes: 1 addition & 1 deletion configurator/libs/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async function generateOpenMRSChannel (host, port, username, password, type) {
host: host,
port: port,
path: '',
pathTransform: 's/openmrs/openmrs\/ws\/fhir2\/R4/g',
pathTransform: 's/openmrs/openmrs\\/ws\\/fhir2\\/R4/g',
primary: true,
username: username,
password: password
Expand Down
15 changes: 0 additions & 15 deletions docker/docker-compose.openmrs-poller.yml

This file was deleted.

0 comments on commit fda229f

Please sign in to comment.