Hi Fred
Was looking for a way of of getting analytics on how many cases have been registered, tested, positive and negative from the forms filled per day and exploring the following:
Did the suggested method work for you? What analytics does telemetry provide?
How do you activate analytics tab on the Medic Dashboard (Target and target aggregates)?
Hope to configure our instance tomorrow to receive analytics data, will appreciate any feedback, thank you
Derick
I had gone through the tutorial and just done the steps again now, configuration is done correctly but the analytics tab doesnāt show anything as shown below. Iām using a test VM for this exercise
Want to review further the target widget settings, and re-run
Derick
Normal user is which role? Tried with Program Officer role and same message, āTargets are disabled for admin usersā
Trying to review this code and relate to our instance before re-running:
module.exports = [
{
id: āassessments-all-timeā,
type: ācountā,
icon: āicon-healthcare-assessmentā,
goal: -1,
translation_key: ātargets.assessments.titleā,
subtitle_translation_key: ātargets.all_time.subtitleā,
Normal would mean a non-admin user that is restricted to their place.
For your situation, you would need to make the Program Officer role offline.
In app_settings.json (assuming your local app_settings is in sync with what is uploaded on your instance, you can modify the role as shown below: (modify to match your local naming)
Derick
Is it possible to get a sample form and analytics target file for the same?
Figuring out how to link the id property of targets to the actual form fields, then I should be good to go
},
Which section picks data from our forms? There is something I am not getting, the link between the target values and data collected through the forms, any help?
Here, it will return true for all D and delivery reports which have the field pregnancy_outcome equal to healthy. So only those reports will be counted towards the target. You can change it to match your requirements.
date: 'reported'
This means that the target will count reports with a reported_date within the current month.
Dear Binod
I understand the fields from the online documentation, what I missed is the link between targets and actual fields on the different forms. I see the function definition, and I see it picks both the form and field
For example we have been screening some target population for TB, Covid and PCR in different regions, thus our hierarchy is two level, one root with four children.
We only have three (3) forms (Contact creating and editing, case investigation with the screening algorithm), thus I want to create targets and visualize percentage tested and percentage screened so far both from the root (National Office) and the four branches (County1, County2,County3, County4 )
Let me figure it out, will create a function percTested() and percScreened(), will revert once I test
I also saw errors with indentation while testing targets yesterday, does one tab space work or normally spacing?
Binod
I have tried the following code for only Covid targets:
module.exports = [
{
id: āpercentage-covid-testā,
type: āpercentā,
icon: āicon-healthcare-assessmentā,
goal: -1,
translation_key: ātargets.covid_test.titleā,
subtitle_translation_key: ātargets.this_month.subtitleā,
And the following for nools-extra
module.exports = {
covidPercTested(c,r) {
return r.form === ācovā && r.fields.screening_cov === ātrueā);
},
I get the error below:
@oyierphil, you are getting a reference error. It means that the function covidPercTested is not accessible from your targets.js. In order to get the reference correctly, you need to export the function from nools-extras.js and import it in targets.js.
Please see this example from the default config where the function isAlive is defined here, exported here and then imported here.
Also, since your target now applies to the contacts, you might want to check the contacts instead of reports that match your criteria. For targets applying to contacts, the report will always be undefined in the appliesIf(contact, report) function.
Something like this might work, but you might want to use it in passesIf instead:
@oyierphil I have not taken a close look at your logic here, but I think the source of your SyntaxError is that I think you mean to use function instead of covidPercTested in this section:
jkuester,
I made the correction and got the same error, ā SyntaxError: Unexpected token )ā
Seem not to be able to point where the error is
Trying to review if I picked the correct details from my form for the following: contact.reports.X and
report => report.form
I have the following field from the forms, screening.cov from which I want to set the targets for Covid
Regards
That may fix the SyntaxErrors, but is still seems like there is something wrong with the logic in that covidPercTested function (since you are not actually loading anything off the contact). Maybe you intended that function to look similar to the one Binod suggested above:
jkuester
Trying to figure out what ācontact.reports.someā mean
What value does report.form === X take and report.fields.Y
Going back to basics now, appreciate the support
Array.some(ā¦) basically just checks to see if any of the elements in the array match the given test. So in this case covidPercTested would return true for any contact that had at least one report matching report.form === 'sampling' && report.fields.screening_cov === 'true'. (That check gets run for each report entry in the contact.reports array.)