langcog / web-cdi

7 stars 5 forks source link

export scores into user-friendly printout (for clinical use) #424

Closed vmarchman closed 1 year ago

vmarchman commented 1 year ago

Add option to select a particular administration (one administration at a time) and then export the summary scores and percentiles into a parent-friendly word document that can be saved/printed out (like the Child Report Form in the manual). Fields in << >> are variables pulled from the output. Not all will be used, but this is the basic structure.

ETClinicalReport.docx EIClinicalReport.docx

HenryMehta commented 1 year ago

@vmarchman Are both documents available for all forms?

vmarchman commented 1 year ago

Sorry that the names were confusing. It goes back to an old naming convention (Infant = W&G; Toddler = W&S). Each instrument has 1 "Clinical Report".

So, for what you have EIClinicalReport.docx = English W&G ETClinicalReport.docx = English W&S

But, I'm uploading them again with better names.

And adding:

EnglishLevel1ShortFormClinicalReport.docx EnglishLevel2AShortFormClinicalReport.docx EnglishLevel2BShortFormClinicalReport.docx EnglishLevel3ShortFormClinicalReport.docx

EnglishCDI3ClinicalReport.docx EnglishLevel2BShortFormClinicalReport.docx EnglishLevel2AShortFormClinicalReport.docx EnglishLevel1ShortFormClinicalReport.docx EnglishWGClinicalReport.docx EnglishWSClinicalReport.docx

Let's start with these and then we can move to the Spanish.

HenryMehta commented 1 year ago

@vmarchman I've just started looking at this in a little more detail. It is doable but it is not super easy or transferable from one language to another. The basic difficulty is the data are coming from either benchmarking or the form, rather than database fields. This information is saved within fields within database tables telling you how to access other tables and that is passed to the system via json files. That means we need to create and load another json for each form/lanugage combination with these reports that references the background information (demographic) and items.

I don't know if I've explained that well, but what I'm saying is, this is not easy and quick. It will take some time and I am not convinced it is a good idea to try and do before Brookes. Actually, I'll be a little stronger and say, I think I would rather be cautious and do Brookes first

vmarchman commented 1 year ago

I understand @Henry @.***>. I will streamline the templates to make this a more simple process. We should be able to pull only from those variables that are directly on the outputs, and hard code everything else.

On Sat, Mar 4, 2023 at 10:50 PM Henry Mehta @.***> wrote:

@vmarchman https://github.com/vmarchman I've just started looking at this in a little more detail. It is doable but it is not super easy or transferable from one language to another. The basic difficulty is the data are coming from either benchmarking or the form, rather than database fields. This information is saved within fields within database tables telling you how to access other tables and that is passed to the system via json files. That means we need to create and load another json for each form/lanugage combination with these reports that references the background information (demographic) and items.

I don't know if I've explained that well, but what I'm saying is, this is not easy and quick. It will take some time and I am not convinced it is a good idea to try and do before Brookes. Actually, I'll be a little stronger and say, I think I would rather be cautious and do Brookes first

— Reply to this email directly, view it on GitHub https://github.com/langcog/web-cdi/issues/424#issuecomment-1455006609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TUTHRYMRVAIU4OYM7JTTW2QZTLANCNFSM6AAAAAAVCKTXMA . You are receiving this because you were mentioned.Message ID: @.***>

vmarchman commented 1 year ago

Hi @HenryMehta - Ok, I have streamlined the child report form templates for English WG and WS and Spanish WG and WS. I have hardcoded everything except what can be pulled directly from the outputs. Those fields are highlighted in green. Two issues: (1) Can we pull date of report and populate that? (2) In the output, binary variables like "Combining" are 0 vs. 1. Can we translate to YES (for 1) vs. NO (for 0) for the output?

I have also found some errors in the outputs for Spanish, but I will make a new issue for those. EnglishWSClinicalReport.docx SpanishWGClinicalReport.docx SpanishWSClinicalReport.docx EnglishWGClinicalReport.docx

HenryMehta commented 1 year ago

@vmarchman can you remind me how to calc benchmark age to compare please

HenryMehta commented 1 year ago

@vmarchman of English WG, I do not understand where the 680 comes from. There are only 492 items in the instrument

vmarchman commented 1 year ago

Hi @HenryMehta

Benchmark age is age in months rounded to the whole month - based on chronological age. Age to Compare is based on birth age, corrected for degree of prematurity. So, if a child is born 4 weeks early, then the Age to compare is 1 month younger than the Benchmark age. If the child is born 8 weeks early, then the Age to compare is 2 months younger than chronological Benchmark age.

Re English WG, Are you looking at the latest versions that I uploaded, with green fields highlighted? There are indeed 396 words on the English WG.

HenryMehta commented 1 year ago

@vmarchman English WS is available to test. I've not done it exactly as requested so that I can used fields already in the database rather than having to change them. For example, we call the Instrument English (American) rather than American English. I hope this is ok. Let me know if I've got anything wrong or it needs changing

vmarchman commented 1 year ago

Fantastic! Looks good!

A few things:

(1) Child ID is not subject_id, but the administration ID. In this case, the ID I'm looking for is 1111.

(2) When the scores are blank or scored as 0, it puts "SummaryData matching query does not exist." These should simply be 0.

(3) When the example sentences are left blank, we should just leave the slots blank as well - or put in "no response provided" ?

On Mon, Apr 10, 2023 at 9:10 AM Henry Mehta @.***> wrote:

@vmarchman https://github.com/vmarchman English WS is available to test. I've not done it exactly as requested so that I can used fields already in the database rather than having to change them. For example, we call the Instrument English (American) rather than American English. I hope this is ok. Let me know if I've got anything wrong or it needs changing

— Reply to this email directly, view it on GitHub https://github.com/langcog/web-cdi/issues/424#issuecomment-1502009705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TUTG23WLOCG2P5LMG6BDXAQWF7ANCNFSM6AAAAAAVCKTXMA . You are receiving this because you were mentioned.Message ID: @.***>

HenryMehta commented 1 year ago

@vmarchman deploying amendments to dev now (give it 30mins) and Spanish WS

vmarchman commented 1 year ago

Looking good!

A few things:

(1) Please add this functionality to the Download Selected Data section as well. There will be times when you want to download all of the reports available, and then there are times, when you just want particular ones.

(2) On the English WS, there are still two places where the score is not filled in: (a) How children use words and (b) Number of more complex examples

(3) On the Spanish WS, two places still need 0s filled in: (a) El nino combina palabras (combining), and (b) Complexity (number of more complex examples)

On Mon, Apr 10, 2023 at 11:13 AM Henry Mehta @.***> wrote:

@vmarchman https://github.com/vmarchman deploying amendments to dev now (give it 30mins) and Spanish WS

— Reply to this email directly, view it on GitHub https://github.com/langcog/web-cdi/issues/424#issuecomment-1502138135, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TUTG44UWDWO43I3SXUTTXARETRANCNFSM6AAAAAAVCKTXMA . You are receiving this because you were mentioned.Message ID: @.***>

HenryMehta commented 1 year ago

@vmarchman

  1. It is going to take some time to get it onto Selected Data so I am prioritising getting the complete list downloaded
  2. These are working for me - please see attachment document.pdf
  3. Also working for me - see attachment. spanish.pdf

I'm making some changes so put values in place should it be blank or cannot find record etc. That will tell us what is going on. If you could run and send to me I'll see if I can sort

HenryMehta commented 1 year ago

@vmarchman I've deployed English and Spanish WG. I'm getting records missing in Spanish so still working on it

HenryMehta commented 1 year ago

Also, as a general note, I've done this is quite a prescriptive way to reduce development time. That means these are not automatically available to other languages/forms. Ideally, I should base the form on the benchmark json file for each language which would then means we automatically have downloads for each form where this is specified, but this would be a longer development cycle

vmarchman commented 1 year ago

@Henry @.***> I understand.

On Tue, Apr 11, 2023 at 2:44 AM Henry Mehta @.***> wrote:

Also, as a general note, I've done this is quite a prescriptive way to reduce development time. That means these are not automatically available to other languages/forms. Ideally, I should base the form on the benchmark json file for each language which would then means we automatically have downloads for each form where this is specified, but this would be a longer development cycle

— Reply to this email directly, view it on GitHub https://github.com/langcog/web-cdi/issues/424#issuecomment-1503008070, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TUTG5DYC5TMQ64TYVNF3XAURYBANCNFSM6AAAAAAVCKTXMA . You are receiving this because you were mentioned.Message ID: @.***>

HenryMehta commented 1 year ago

@vmarchman I have worked out (I think) this morning why you're getting some fields not showing in the clinical forms. For the Spanish it is sometimes the accent for example Imitación v Imitacion. But for both languages sometimes we have a space between percentile and the previous word and sometimes we don't. This must mean the program was changed at one point from one to another. The solution for the second item is to rerun the scoring. You've given me the Spanish studies you're testing on. If you could provide the English ones as well, I'll get them updated

HenryMehta commented 1 year ago

@vmarchman I have also worked out why the Palabras que dice Precentile-both isn't working. It is because we do not have benchmark data for this.

And just as a thought, I've been using the field names you gave me rather than the adjusted values which include (adjusted) at the end of the name. Is this correct?

vmarchman commented 1 year ago

@Henry I see - Ok, let me work on this now and I'll have some solutions for you asap.

On Wed, Apr 12, 2023 at 3:12 AM Henry Mehta @.***> wrote:

@vmarchman https://github.com/vmarchman I have also worked out why the Palabras que dice Precentile-both isn't working. It is because we do not have benchmark data for this.

And just as a thought, I've been using the field names you gave me rather than the adjusted values which include (adjusted) at the end of the name. Is this correct?

— Reply to this email directly, view it on GitHub https://github.com/langcog/web-cdi/issues/424#issuecomment-1505016540, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TUTGAKGOE6W2BKG5WKQDXAZ5Z7ANCNFSM6AAAAAAVCKTXMA . You are receiving this because you were mentioned.Message ID: @.***>

vmarchman commented 1 year ago

Hi @HenryMehta Ok, for Spanish csv and individual report outputs, here's the situation:

Spanish WG: (1) Comprehension Temprana - now is working

(2) Palabras que Dice - the lookup percentile for both sexes combined isn't populating in either the csv output or the summary report, but you do have the table in what I sent before

(3) Gestos Tempranos (sum of 1st 2 sections) seems to be ok, but Gestos Tardios (sum of last 3 sections) is not working in either the csv output or the individual report. There are two variables in the output, Tardios (no accent) and Tardios (with an accent). Neither are summing the gestures responses correctly.

Spanish WS: (1) Title on individual report should be Inventario II (rather than Inventario I)

(2) the 3 "exemplo" columns are not spitting out the sentences, but the 3 "combination example" columns are. Just use those?

(3) Formas - Not adding correctly in either the csv or the individual outputs.

vmarchman commented 1 year ago

@HenryMehta re the adjusted benchmark ages. You're right that the individual reports now use the chronological age, and not the adjusted benchmark ages. We have separate csv reports for those with only the chronological age benchmarks vs. those with BOTH the chronological and the adjusted age benchmarks. Can we do the same for the individual reports?

If so, we should remove the Age to Compare field from the Chronological age reports, and only keep it for the Adjusted age reports. That is, have BOTH "Age in Months" and "Age to Compare" in the Adjusted age reports.

So, I would give you 4 additional templates for the Adjusted age reports with all of the adjusted age variables added.

Thoughts?

btw, in dev, none of the "Adjusted age benchmark" csv outputs are working for me.

HenryMehta commented 1 year ago

@vmarchman I have deployed an amendment to dev which allows clinical reports for selected items

vmarchman commented 1 year ago

Hi @Henry @.***> Great! The download clinical reports works in both the Download data and the Selected Download dialog.

(1) For English WG and WS: I created some new participants and things worked well in the Selected Download for the clinical report, but that participant didn't show up in the Download data report.

**BUT Let's JUST have the clinical reports in the Selected Download* option. Take it out of the general Download data option. The primary use case for the clinical reports is 1 or 2 kids at a time, so if they want multiple kids, they can select them all.

(2) I created new participants with 0 responses in all sections, and in the clinical report, it said "Summary Matching data does not exist" rather than

  1. It shows up correctly as 0 in the csv output. This was true for both English WG and WS.

(3) For Spanish WG, the gestures sections are still not right. It is not reading these columns, either in the csv or in the clinical report: Jugar a Ser Adulto

Imitacion de Otros Tipos de Actividades de Adultos

(4) For both Spanish WG and WS, 0s that are in the csv are also filled in the report as "Summary Matching data does not exist".

(5) The look-up for Spanish WG Words produced (Palabras que dice) Percentile - both is still missing in both the csv and the summary report.

On Thu, Apr 13, 2023 at 9:42 AM Henry Mehta @.***> wrote:

@vmarchman https://github.com/vmarchman I have deployed an amendment to dev which allows clinical reports for selected items

— Reply to this email directly, view it on GitHub https://github.com/langcog/web-cdi/issues/424#issuecomment-1507273618, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TUTDE7PSNSL32CZB2MBDXBAUG7ANCNFSM6AAAAAAVCKTXMA . You are receiving this because you were mentioned.Message ID: @.***>

HenryMehta commented 1 year ago

(1) For English WG and WS: I created some new participants and things worked well in the Selected Download for the clinical report, but that participant didn't show up in the Download data report.

  1. I don't understand how this is possible. Except, Clinical reports are only printing for those administrations which are completed. But if it wasn't completed it shouldn't show in either.

**BUT Let's JUST have the clinical reports in the Selected Download* option. Take it out of the general Download data option. The primary use case for the clinical reports is 1 or 2 kids at a time, so if they want multiple kids, they can select them all.

1.b Removed

(2) I created new participants with 0 responses in all sections, and in the clinical report, it said "Summary Matching data does not exist" rather than 0. It shows up correctly as 0 in the csv output. This was true for both English WG and WS.

(4) For both Spanish WG and WS, 0s that are in the csv are also filled in the report as "Summary Matching data does not exist".

For both 2 and 4 this is because there is no record and so I'm generating something so that I can see there is no record. I will amend this to 0 when everything else is sorted.

(5) The look-up for Spanish WG Words produced (Palabras que dice) Percentile - both is still missing in both the csv and the summary report.

  1. As previously stated, this is because we do not have benchmark data for both. Given we have no data there is no record so it is telling us we do not have a record.

(3) For Spanish WG, the gestures sections are still not right. It is not reading these columns, either in the csv or in the clinical report: Jugar a Ser Adulto Imitacion de Otros Tipos de Actividades de Adultos

I'll pick this up in issue #436

vmarchman commented 1 year ago

Here is the Spanish WG norming information. See tab labeled "Palabras que dice - Unisex"

On Fri, Apr 14, 2023 at 6:48 AM Henry Mehta @.***> wrote:

(1) For English WG and WS: I created some new participants and things worked well in the Selected Download for the clinical report, but that participant didn't show up in the Download data report.

  1. I don't understand how this is possible. Except, Clinical reports are only printing for those administrations which are completed. But if it wasn't completed it shouldn't show in either.

**BUT Let's JUST have the clinical reports in the Selected Download* option. Take it out of the general Download data option. The primary use case for the clinical reports is 1 or 2 kids at a time, so if they want multiple kids, they can select them all.

1.b Removed

(2) I created new participants with 0 responses in all sections, and in the clinical report, it said "Summary Matching data does not exist" rather than 0. It shows up correctly as 0 in the csv output. This was true for both English WG and WS.

(4) For both Spanish WG and WS, 0s that are in the csv are also filled in the report as "Summary Matching data does not exist".

For both 2 and 4 this is because there is no record and so I'm generating something so that I can see there is no record. I will amend this to 0 when everything else is sorted.

(5) The look-up for Spanish WG Words produced (Palabras que dice) Percentile - both is still missing in both the csv and the summary report.

  1. As previously stated, this is because we do not have benchmark data for both. Given we have no data there is no record so it is telling us we do not have a record.

(3) For Spanish WG, the gestures sections are still not right. It is not reading these columns, either in the csv or in the clinical report: Jugar a Ser Adulto Imitacion de Otros Tipos de Actividades de Adultos

I'll pick this up in issue #436 https://github.com/langcog/web-cdi/issues/436

— Reply to this email directly, view it on GitHub https://github.com/langcog/web-cdi/issues/424#issuecomment-1508534846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2TUTFUUIZ5AFQIDQKEPWTXBFIUBANCNFSM6AAAAAAVCKTXMA . You are receiving this because you were mentioned.Message ID: @.***>

HenryMehta commented 1 year ago

@vmarchman no attachment

HenryMehta commented 1 year ago

(2) I created new participants with 0 responses in all sections, and in the clinical report, it said "Summary Matching data does not exist" rather than 0. It shows up correctly as 0 in the csv output. This was true for both English WG and WS.

@vmarchman Can you give me the names of the English WS and WG studies with which you're testing. I'm wondering if the scoring hasn't run completely for them since I'm not seeing the 'Summary Matching data does not exist' error. Thanks

HenryMehta commented 1 year ago

@vmarchman I have updated the Spanish WG Benchmarks and loaded them to dev. I'm running a score recalc on your Spanish test studies around 3 or 4pm UAT, so about 8am for you I think. They should be good to test after that - this should remove the 'Summary ...' comment from the (Palabras que dice) Percentile - both section