Skip to content

Commit

Permalink
feat: Add anc observation flat view implemenatation
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzalsif committed Jan 17, 2025
1 parent eb9375c commit 81ed8da
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions views/anc_observation_flat_view.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"resourceType": "http://41.59.228.177/datapipes/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition",
"text": "Flat view definition for ANC Observation resource using component matching with list handling.",
"fhirVersion": ["4.0"],
"select": [
{
"column": [
{
"path": "getResourceKey()",
"name": "id",
"type": "string"
},
{
"path": "subject.getReferenceKey(Patient)",
"name": "patient_id",
"type": "string"
},
{
"path": "encounter.getReferenceKey(Encounter)",
"name": "encounter_id",
"type": "string"
},
{
"path": "effective.ofType(dateTime)",
"name": "obs_date",
"type": "dateTime"
},
{
"path": "component.where(code.coding[0].code = '11884-4').value.ofType(Quantity).value",
"name": "pregnancy_age_weeks",
"type": "decimal"
},
{
"path": "component.where(code.coding[0].code = '11449-6').value.ofType(boolean)",
"name": "positive_hiv_status_before_service",
"type": "boolean"
},
{
"path": "component.where(code.coding[0].code = '409073007').value.ofType(boolean)",
"name": "provided_family_planning_counseling",
"type": "boolean"
},
{
"path": "component.where(code.coding[0].code = '384469009').value.ofType(boolean)",
"name": "provided_infant_feeding_counseling",
"type": "boolean"
},
{
"path": "component.where(code.coding[0].code = '306206005').value.ofType(boolean)",
"name": "refered_to_ctc",
"type": "boolean"
},
{
"path": "component.where(code.coding[0].code = '11998-7').value.ofType(integer)",
"name": "gravidity",
"type": "integer"
},
{
"path": "component.where(code.coding[0].code = 'LA6577-6' and code.coding[0].display = 'HIV status of spouse' ).value.ofType(CodeableConcept).coding[0].code",
"name": "hiv_spouse_status_code",
"type": "string"
},
{
"path": "component.where(code.coding[0].code = 'LA6577-6' and code.coding[0].display = 'HIV status of spouse').value.ofType(CodeableConcept).coding[0].display",
"name": "hiv_spouse_status_display",
"type": "string"
},
{
"path": "component.where(code.coding[0].code = 'LA6577-6' and code.coding[0].display = 'Syphilis status of spouse').value.ofType(CodeableConcept).coding[0].code",
"name": "syphilis_spouse_status_code",
"type": "string"
},
{
"path": "component.where(code.coding[0].code = 'LA6577-6' and code.coding[0].display = 'Syphilis status of spouse').value.ofType(CodeableConcept).coding[0].display",
"name": "syphilis_spouse_status_display",
"type": "string"
},
{
"path": "component.where(code.coding[0].code = '47399-5').value.ofType(CodeableConcept).coding[0].code",
"name": "syphilis_status_code",
"type": "string"
},
{
"path": "component.where(code.coding[0].code = '47399-5').value.ofType(CodeableConcept).coding[0].display",
"name": "syphilis_status_display",
"type": "string"
},
{
"path": "component.where(code.coding[0].code = '55277-8').value.ofType(CodeableConcept).coding[0].code",
"name": "hiv_status_code",
"type": "string"
},
{
"path": "component.where(code.coding[0].code = '55277-8').value.ofType(CodeableConcept).coding[0].display",
"name": "hiv_status_display",
"type": "string"
}
]
}
],
"name": "anc_observation_flat",
"status": "active",
"resource": "Observation"
}

0 comments on commit 81ed8da

Please sign in to comment.