I have the following contents in 'endpoint.json':

`

{
"name": "FHIR-to-EHR-1",
"description": "Map a FHIR Patient resource to an EHR in openEHR",
"endpoint": {
"pattern": "/fhir-ehr-1"
},
"transformation": {
"input": "JSON",
"output": "JSON"
},
"inputMapping": {
"constants._type": "_type",
"constants.archetype_node_id": "archetype_node_id",
"constants.name.value": "name.value",
"constants.subject.external_ref.id._type": "subject.external_ref.id._type",
"constants.subject.external_ref.id.scheme": "subject.external_ref.id.scheme",
"requestBody.identifier[0].value": "subject.external_ref.id.value",
"constants.subject.external_ref.namespace": "subject.external_ref.namespace",
"constants.subject.external_ref.type": "subject.external_ref.type",
"constants.is_modifiable": "is_modifiable",
"constants.is_queryable": "is_queryable"
},
"constants" : {
"_type": "EHR_STATUS",
"archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1",
"name": {
"value": "ehr status"
},
"subject": {
"external_ref": {
"id": {
"_type": "GENERIC_ID",
"scheme": "id_scheme",
"value": "{{subjectId}}"
},
"namespace": "openIMIS_ID",
"type": "PERSON"
}
},
"is_modifiable": "true",
"is_queryable": "true"
},
"requests": {
"response": [
{
"id": "request1",
"config": {
"method": "post",
"url": "http://localhost:8081/ehrbase/rest/openehr/v1/ehr/",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"Prefer": "return=representation",
"Access-Control-Allow-Origin": "*"
//"Authorization": "Basic ZWhyYmFzZS1hZG1pbjpFdmVuTW9yZVNlY3JldFBhc3N3b3Jk"
}
}
}
]
}
}

`

and an input json with the following content:

`

{
"resourceType": "Patient",
"id": "1111101172",
"extension": [
{
"url": "https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/patient-is-head",
"valueBoolean": false
},
{
"url": "https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/patient-card-issued",
"valueBoolean": false
},
{
"url": "https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/patient-group-reference",
"valueReference": {
"reference": "Group/111111110",
"type": "Group",
"identifier": {
"type": {
"coding": [
{
"system": "https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers",
"code": "Code"
}
]
},
"value": "111111119"
}
}
}
],
"identifier": [
{
"type": {
"coding": [
{
"system": "https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers",
"code": "UUID"
}
]
},
"value": "F9DABEDA-56EC-448E-893C-91A486D3CD53"
},
{
"type": {
"coding": [
{
"system": "https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers",
"code": "Code"
}
]
},
"value": "111111117"
}
],
"name": [
{
"use": "usual",
"family": "Manth",
"given": [
"Aby"
]
}
],
"gender": "female",
"birthDate": "2001-05-17",
"address": [
{
"extension": [
{
"url": "https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/address-municipality",
"valueString": "Achi"
},
{
"url": "https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/address-location-reference",
"valueReference": {
"reference": "Location/R1D1M1V1",
"type": "Location",
"identifier": {
"type": {
"coding": [
{
"system": "https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers",
"code": "Code"
}
]
},
"value": "R1D1M1V1"
}
}
}
],
"use": "home",
"type": "physical",
"text": "Jetset zone 85",
"city": "Rachla",
"district": "Rapta",
"state": "Ultha"
}
],
"photo": [
{
"contentType": "jpg",
"url": "http://demo.openimis.org/photo/Images/Updated//111111117_E00001_20180327_0.0_0.0.jpg",
"title": "111111117_E00001_20180327_0.0_0.0.jpg",
"creation": "2018-03-27"
}
]
}

`

having created a channel in openHIM, I kept getting an error 'connect ECONNREFUSED 127.0.0.1: 8081'. 

The error message from the orchestration is as follows:


`{ "x-mediator-urn": "urn:mediator:generic_mapper", "status": "Failed", "response": { "headers": { "content-type": "application/json+openhim", "content-length": "35" }, "status": 500, "body": "connect ECONNREFUSED 127.0.0.1:8081", "timestamp": 1683821885375 }, "orchestrations": [ { "request": { "host": "", "port": "", "path": "", "method": "", "timestamp": "2023-05-11T16:18:05.023Z", "body": "{\"constants\":{\"_type\":\"EHR_STATUS\",\"archetype_node_id\":\"openEHR-EHR-EHR_STATUS.generic.v1\",\"name\":{\"value\":\"ehr status\"},\"subject\":{\"external_ref\":{\"id\":{\"_type\":\"GENERIC_ID\",\"scheme\":\"id_scheme\",\"value\":\"abiodun.msulaiman@gmail.com\"},\"namespace\":\"openIMIS_ID\",\"type\":\"PERSON\"}},\"is_modifiable\":\"true\",\"is_queryable\":\"true\"},\"state\":null,\"urlParams\":{},\"timestamps\":{\"endpointStart\":\"2023-05-11T16:18:04.216Z\",\"endpointEnd\":null,\"lookupRequests\":{}},\"requestHeaders\":{\"content-type\":\"application/json\",\"user-agent\":\"PostmanRuntime/7.32.2\",\"accept\":\"*/*\",\"postman-token\":\"e0f6a05b-52a6-49e2-bc65-00cf4ae8c939\",\"accept-encoding\":\"gzip, deflate, br\",\"connection\":\"keep-alive\",\"content-length\":\"3645\",\"x-forwarded-for\":\"172.21.0.1\",\"x-forwarded-host\":\"localhost:5001\",\"x-openhim-transactionid\":\"645d153af188a60013b3ebd6\",\"host\":\"mapper:3003\"},\"query\":{},\"requestBody\":{\"resourceType\":\"Patient\",\"id\":\"1111101172\",\"extension\":[{\"url\":\"https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/patient-is-head\",\"valueBoolean\":false},{\"url\":\"https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/patient-card-issued\",\"valueBoolean\":false},{\"url\":\"https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/patient-group-reference\",\"valueReference\":{\"reference\":\"Group/111111110\",\"type\":\"Group\",\"identifier\":{\"type\":{\"coding\":[{\"system\":\"https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers\",\"code\":\"Code\"}]},\"value\":\"111111119\"}}}],\"identifier\":[{\"type\":{\"coding\":[{\"system\":\"https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers\",\"code\":\"UUID\"}]},\"value\":\"F9DABEDA-56EC-448E-893C-91A486D3CD53\"},{\"type\":{\"coding\":[{\"system\":\"https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers\",\"code\":\"Code\"}]},\"value\":\"111111117\"}],\"name\":[{\"use\":\"usual\",\"family\":\"Manth\",\"given\":[\"Aby\"]}],\"gender\":\"female\",\"birthDate\":\"2001-05-17\",\"address\":[{\"extension\":[{\"url\":\"https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/address-municipality\",\"valueString\":\"Achi\"},{\"url\":\"https://openimis.github.io/openimis_fhir_r4_ig/StructureDefinition/address-location-reference\",\"valueReference\":{\"reference\":\"Location/R1D1M1V1\",\"type\":\"Location\",\"identifier\":{\"type\":{\"coding\":[{\"system\":\"https://openimis.github.io/openimis_fhir_r4_ig/CodeSystem/openimis-identifiers\",\"code\":\"Code\"}]},\"value\":\"R1D1M1V1\"}}}],\"use\":\"home\",\"type\":\"physical\",\"text\":\"Jetset zone 85\",\"city\":\"Rachla\",\"district\":\"Rapta\",\"state\":\"Ultha\"}],\"photo\":[{\"contentType\":\"jpg\",\"url\":\"http://demo.openimis.org/photo/Images/Updated//111111117_E00001_20180327_0.0_0.0.jpg\",\"title\":\"111111117_E00001_20180327_0.0_0.0.jpg\",\"creation\":\"2018-03-27\"}]},\"responseBody\":{\"_type\":\"EHR_STATUS\",\"archetype_node_id\":\"openEHR-EHR-EHR_STATUS.generic.v1\",\"name\":{\"value\":\"ehr status\"},\"subject\":{\"external_ref\":{\"id\":{\"_type\":\"GENERIC_ID\",\"scheme\":\"id_scheme\",\"value\":\"F9DABEDA-56EC-448E-893C-91A486D3CD53\"},\"namespace\":\"openIMIS_ID\",\"type\":\"PERSON\"}},\"is_modifiable\":\"true\",\"is_queryable\":\"true\"}}" }, "response": { "timestamp": "2023-05-11T16:18:05.033Z", "body": "{\"_type\":\"EHR_STATUS\",\"archetype_node_id\":\"openEHR-EHR-EHR_STATUS.generic.v1\",\"name\":{\"value\":\"ehr status\"},\"subject\":{\"external_ref\":{\"id\":{\"_type\":\"GENERIC_ID\",\"scheme\":\"id_scheme\",\"value\":\"F9DABEDA-56EC-448E-893C-91A486D3CD53\"},\"namespace\":\"openIMIS_ID\",\"type\":\"PERSON\"}},\"is_modifiable\":\"true\",\"is_queryable\":\"true\"}" }, "name": "Endpoint Mapping: FHIR-to-EHR-1" }, { "request": { "host": "localhost", "port": "8081", "path": "/ehrbase/rest/openehr/v1/ehr/", "method": "post", "timestamp": "2023-05-11T16:18:05.181Z", "queryString": "&", "headers": { "x-openhim-transactionid": "645d153af188a60013b3ebd6", "Content-Type": "application/json", "Accept": "application/json", "Prefer": "return=representation", "Access-Control-Allow-Origin": "*" }, "body": "{\"_type\":\"EHR_STATUS\",\"archetype_node_id\":\"openEHR-EHR-EHR_STATUS.generic.v1\",\"name\":{\"value\":\"ehr status\"},\"subject\":{\"external_ref\":{\"id\":{\"_type\":\"GENERIC_ID\",\"scheme\":\"id_scheme\",\"value\":\"F9DABEDA-56EC-448E-893C-91A486D3CD53\"},\"namespace\":\"openIMIS_ID\",\"type\":\"PERSON\"}},\"is_modifiable\":\"true\",\"is_queryable\":\"true\"}" }, "response": { "timestamp": "2023-05-11T16:18:05.328Z" }, "name": "Endpoint Response Request: FHIR-to-EHR-1: request1", "error": { "message": "connect ECONNREFUSED 127.0.0.1:8081" } } ] }`

I have openEHR running on port 8081. can someone help look into the request part of my endpoint and tell me what could be missing or wrong to warrant the orchestration error.