-
Notifications
You must be signed in to change notification settings - Fork 37
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
Return a FHIR Bundle with Auto and Potential matches as entries #137
base: master
Are you sure you want to change the base?
Conversation
cc: @reagan-meant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good already. I feel we should include the payload that was sent aswell to the payload
server/lib/routes/match.js
Outdated
const system = {system: 'phone'}; | ||
const url = {url: 'http://hl7.org/fhir/StructureDefinition/match-grade'}; | ||
|
||
function createPatientEntry(patient, matchGrade, score) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mherman22 instead of adding individual fields that we have. Could you query the fhir server using the uuid per patient and just add the returned patient (just modify and add the score to this)
generateScoreMatrix({ patient: patientJson, level: 'childMatches', type: 'parent' }, async () => { | ||
try { | ||
const combinedBundle = await transformToFhirObject(); | ||
return res.status(200).json(combinedBundle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the response returned when the endpoint is hit:
{
"resourceType": "Bundle",
"id": "4c22a89a-b348-44be-ab64-89d251cdbf83",
"meta": {
"lastUpdated": "2024-06-02T07:55:03.315Z"
},
"type": "searchset",
"total": 1,
"entry": [
{
"resourceType": "Patient",
"id": "d80d5917-2b6a-4bc8-ac6f-7d385598386d",
"meta": {
"versionId": "2",
"lastUpdated": "2024-06-02T07:54:14.635+00:00",
"source": "#7Y7HDptxTWazjafL",
"profile": [
"http://b-techbw.github.io/bw-lab-ig/StructureDefinition/bw-patient"
],
"tag": [
{
"system": "http://openclientregistry.org/fhir/clientid",
"code": "postman",
"display": "Postman Testing"
},
{
"system": "http://openclientregistry.org/fhir/matchIssues",
"code": "potentialMatches",
"display": "Potential Matches"
}
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Aviva Wakelam <b>MATEI </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td>201-01-1235</td></tr><tr><td>Date of birth</td><td><span>15 October 1977</span></td></tr></tbody></table></div>"
},
"extension": [
{
"url": "patient_status",
"valueString": "Décédé"
},
{
"url": "patient_status_date",
"valueDate": "2024-01-01"
},
{
"url": "patient_date_enrollement",
"valueDate": "2023-12-01"
},
{
"url": "patient_date_Initiation_ARV",
"valueDate": "2023-12-01"
}
],
"identifier": [
{
"use": "official",
"system": "https://openmrs.org/UPI",
"value": "201-01-1235"
},
{
"use": "official",
"system": "http://openelis-global.org/pat_nationalId"
},
{
"extension": [
{
"url": "http://fhir.openmrs.org/ext/patient/identifier#location",
"valueReference": {
"reference": "Location/0a2c0967-2a56-41c9-9ad5-0bd959861b42",
"type": "Location",
"display": "openmrs-location"
}
}
],
"use": "usual",
"type": {
"text": "OpenMRS UUID"
},
"system": "http://clientregistry.org/openmrs",
"value": "aeafdcda-d157-44ca-9ac6-e890e0fa3cde"
}
],
"name": [
{
"use": "official",
"family": "Matei",
"given": [
"Aviva",
"Wakelam"
]
}
],
"telecom": [
{
"system": "phone",
"use": "mobile"
},
{
"system": "phone",
"use": "home"
}
],
"gender": "male",
"birthDate": "1977-10-15",
"deceasedBoolean": false,
"link": [
{
"other": {
"reference": "Patient/3c4a97cc-63cd-49e4-ad0d-dc4a29438dc5"
},
"type": "refer"
}
],
"search": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/match-grade",
"valueCode": "potential"
}
],
"score": 0.2
}
}
]
}
The following fhir bundle is the target where the first entry is an auto match and the subsequent entries are potential matches: