-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from jembi/TB-180-add-mapping-for-cr-find
Tb 180 add mappings for cr find
- Loading branch information
Showing
4 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
client-registry-jempi/importer/mapping-mediator/searchAll.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "Search Endpoint", | ||
"endpoint": { | ||
"pattern": "/fhir/Patients", | ||
"method": "POST" | ||
}, | ||
"transformation": { | ||
"input": "JSON", | ||
"output": "JSON" | ||
}, | ||
"constants": { | ||
"resourceType": "Bundle", | ||
"type": "searchset" | ||
}, | ||
"inputTransforms": { | ||
"total": "$count(lookupRequests.jempiSearchAll.data.goldenRecords)", | ||
"entry": "$map(lookupRequests.jempiSearchAll.data.goldenRecords, function($v) {{'fullUrl': 'Patient/' & $v.goldenId, 'resource': {'resourceType': 'Patient','id': $v.goldenId,'name': {'given': [$v.demographicData.givenName],'family': $v.demographicData.familyName},'address': [{'city': $v.demographicData.city}],'birthDate': $v.demographicData.dob,'telecom': [{'value': $v.demographicData.phoneNumber,'system': 'phone'}],'identifier': [{'system': $v.sourceId.facility,'value': $v.sourceId.patient},{'system': 'NationalID','value': $v.demographicData.nationalId}],'gender': $v.demographicData.gender}}})" | ||
}, | ||
"inputMapping": { | ||
"constants.resourceType": "resourceType", | ||
"constants.type": "type", | ||
"transforms.total": "total", | ||
"transforms.entry": "entry" | ||
}, | ||
"requests": { | ||
"lookup": [ | ||
{ | ||
"id": "jempiSearchAll", | ||
"forwardExistingRequestBody": true, | ||
"config": { | ||
"method": "post", | ||
"headers": { | ||
"contentType": "application/json" | ||
}, | ||
"url": "http://openhim-mapping-mediator:3003/search-response" | ||
}, | ||
"extract": { | ||
"JeMPIResponse": "$.body" | ||
} | ||
} | ||
] | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
client-registry-jempi/importer/mapping-mediator/searchAllResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"name": "Search Response Endpoint", | ||
"endpoint": { | ||
"pattern": "/search-response", | ||
"method": "POST" | ||
}, | ||
"transformation": { | ||
"input": "JSON", | ||
"output": "JSON" | ||
}, | ||
"inputValidation": { | ||
"type": "object", | ||
"properties": { | ||
"requestBody": { | ||
"type": "object", | ||
"properties": { | ||
"parameters": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"valueCode": { | ||
"type": "string" | ||
}, | ||
"valueString": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["name", "valueCode", "valueString"] | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"required": [ | ||
"parameters" | ||
] | ||
} | ||
} | ||
}, | ||
"inputTransforms": { | ||
"operands": "$append([], $map(requestBody.parameters, function($v) {{'operator': $v.name, 'operand': {'fn': 'eq', 'name': $v.valueCode, 'value': $v.valueString}}}))" | ||
}, | ||
"constants": { | ||
"operator": "or", | ||
"function": "match", | ||
"operandFunction": "eq" | ||
}, | ||
"inputMapping": { | ||
"transforms.operands": "operands", | ||
"transforms.operands[0].operand": "operand" | ||
}, | ||
"requests": { | ||
"response": [ | ||
{ | ||
"id": "jempiSearchAllResponse", | ||
"config": { | ||
"method": "post", | ||
"url": "http://jempi-api:50000/JeMPI/cr-find" | ||
}, | ||
"extract": { | ||
"JeMPIResponse": "$.body" | ||
} | ||
} | ||
] | ||
} | ||
} |