I would like to do the following via inbuilt cohort definitions or data definitions without having to revert to SQL. I already have my cohort of patients
-
What types of encounters they have
-
How many visits grouped by encounter type
I would like to do the following via inbuilt cohort definitions or data definitions without having to revert to SQL. I already have my cohort of patients
What types of encounters they have
How many visits grouped by encounter type
Hi @ssmusoke ,
It has been few months since I looked into the Reporting module so I am not 100% confident, but here is what I would do:
I would create a report with a PatientDataSetDefinition filtered with your cohort definition to display one line per patient.
- What types of encounters they have
In order to list the encounter types per patient I think you have to create a EncounterTypeForPatientDataDefinition to retrieve the Encounter Types of a Patient. There is the EncounterTypeDataDefinition but it is not a “per patient” definition, so I am not sure that can be used on your PatientDataSetDefinition.
@mseaton is this above correct?
- How many visits grouped by encounter type
Do you want this to be ‘per patient’, ie, in the same report as in point 1? Or is this another report such as one line per encounter type?
Hope the above makes sense.
Romain
@ssmusoke, if you need high performance, then I would likely advise writing a custom PatientDataDefinition or using a SqlPatientDataDefinition.
You can achieve the “What encounter types a patient has” by:
For achieving the “How many encounters grouped by encounter type”, you could reuse query #1 above, and run it through a different CollectionConverter (which you would need to write), which returned a Map from Encounter Type name -> Integer.
Mike