-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclean_mdac_call_logs.Rmd
1054 lines (862 loc) · 38.1 KB
/
clean_mdac_call_logs.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Prepping MDAC call logs for upload to FM Pro"
date: "2021-12-03 <br> Updated: `r Sys.Date()`"
---
# ⭐️Overview
In this file we prep the call logs that MDAC sends us to be uploaded into FM Pro.
**From Sunil, 2021-10-22:**
Hi Brad,
It was great meeting with you today! As we discussed, please see the attached Excel file which includes sample data from FileMaker, indicating the fields I would need from the M Davis call file. I’ve indicated in __red__ the related field names that M Davis is using. I’ll program the database to expect three separate files during the import process.
If there are any new fields you would like me to create in FileMaker (for example the duration of the call, M Davis field: CallDurationInSeconds) please provide these fields with a prefix (such as mdac_CallDurationSeconds). Let me know if you have any questions or if I can be of assistance. Feel to reach out over the weekend if something comes up when you are working on it.
Thanks and have a great weekend,
Sunil
Attached files are in the codebooks folder.
**From Sunil, 2021-10-27**
Hi Brad and Kristen,
The database is expecting three separate CSV files from the M Davis file. The first row should have field names. I can code it so that the database automatically matches the variable names up during import. The data will be imported into FileMaker tables PhoneRecruitment, CallLog, and ParticipantScheduler. Attached is an example of the data that the database is expecting to import in from the M Davis file. The first row contains the FileMaker field names and those in red are their corresponding fields from the M Davis file.
Please let me know if you have any questions or if I can be of any assistance.
Thanks,
Sunil
Attached files are in the codebooks folder.
# 📦Load packages
```{r message = FALSE}
library(dplyr, warn.conflicts = FALSE)
library(readr)
library(stringr)
library(lubridate, warn.conflicts = FALSE)
```
# 📥Import data
Data is uploaded to KiteWorks by MDAC. https://securestor.uth.tmc.edu/w/edzP5fV5xV6WMykr
Download from Kiteworks, add to OneDrive, and import into R.
```{r}
call_history <- read_csv("/Users/bradcannell/Library/CloudStorage/OneDrive-TheUniversityofTexasHealthScienceCenteratHouston/Data/DETECT/MDAC Call Logs/1833_DETECT_CallHistory_20210823.CSV")
```
```{r}
dim(call_history) # 3536 62
```
# 🚧Data management
## Recoding variables
### resCodeResult
MDAC codebook = Call result.
This variable contains similar information to AnsweredBy in FM Pro, but includes additional response options. For this reason, it will be labeled as mdac_resCodeResult upon export to FM Pro.
```{r}
call_history <- call_history %>%
mutate(mdac_resCodeResult = recode(
resCodeResult,
"01" = "Continue",
"49" = "Connection Lost",
"51" = "Disconnected - No longer in service",
"40" = "Answering Machine/Left Message",
"46" = "No Answer",
"60" = "Wrong Number",
"47" = "Busy",
"43" = "Call Back",
"48" = "Partial Call Back",
"52" = "Computer/Fax",
"42" = "Answering Machine - No Msg Left",
"71" = "Hard Refusal",
"CO" = "Complete",
"W0" = "Time out",
"W1" = "More than one session attempted on the same case",
"W2" = "Project inactiviated while session in progress",
"W3" = "Disconnected by supervisor",
"70" = "Do Not Call",
"72" = "Soft Refusal",
"74" = "Refusal - Did not receive incentive from prev. survey",
"12" = "Screened Out (Wrong phone)",
"11" = "Screened Out (Wrong ZIP)",
"13" = "Screened out (Age Range)",
"35" = "Hang up",
"26" = "Language Barrier",
"44" = "Indefinite callback",
"W4" = "Screened out",
"W5" = "Out of quota",
"W6" = "Interrupted",
"90" = "Telephony issue",
"P1" = "No answer",
"P2" = "Busy",
"P3" = "Operator Intercept: Tri-Tone and ISDN codes received from provider.",
"P4" = "Answered and dropped: Possible if using predictive dialing when no interviewer is available to take the connected call.",
"P5" = "Answering Machine: Possible if Answering Machine detection is activated.",
"P6" = "Fax, Modem: Detected (using Call Progress Analysis) after the call is connected.",
"P7" = "No Ring, No Dial Tone, Cancelled: Errors on the internal loop.",
"P8" = "Default Value",
"P9" = "In Do Not Call List",
"25" = "Language Barrier - SPANISH",
"30" = "Patient deceased or impaired",
"31" = "Hearing impaired",
"98" = "Not elligible",
"32" = "Patient impaired or disabled",
"97" = "Refused follow-up",
"02" = "Phone given to patient",
"03" = "Patient deceased",
"04" = "Patient permanently impaired or disabled",
"05" = "Patient currently unavailable",
"41" = "Wrong number",
"50" = "Terminate partial (indefinite callback)"
)
)
```
### CaseResult
MDAC codebook = System variable case result.
This variable doesn't have a direct equivalent in FM Pro.
```{r}
call_history <- call_history %>%
mutate(CaseResult = recode(
CaseResult,
"01" = "Continue",
"49" = "Connection Lost",
"51" = "Disconnected - No longer in service",
"40" = "Answering Machine/Left Message",
"46" = "No Answer",
"60" = "Wrong Number",
"47" = "Busy",
"43" = "Call Back",
"48" = "Partial Call Back",
"52" = "Computer/Fax",
"42" = "Answering Machine - No Msg Left",
"71" = "Hard Refusal",
"CO" = "Complete",
"W0" = "Time out",
"W1" = "More than one session attempted on the same case",
"W2" = "Project inactiviated while session in progress",
"W3" = "Disconnected by supervisor",
"70" = "Do Not Call",
"72" = "Soft Refusal",
"74" = "Refusal - Did not receive incentive from prev. survey",
"12" = "Screened Out (Wrong phone)",
"11" = "Screened Out (Wrong ZIP)",
"13" = "Screened out (Age Range)",
"35" = "Hang up",
"26" = "Language Barrier",
"44" = "Indefinite callback",
"W4" = "Screened out",
"W5" = "Out of quota",
"W6" = "Interrupted",
"90" = "Telephony issue",
"P1" = "No answer",
"P2" = "Busy",
"P3" = "Operator Intercept: Tri-Tone and ISDN codes received from provider.",
"P4" = "Answered and dropped: Possible if using predictive dialing when no interviewer is available to take the connected call.",
"P5" = "Answering Machine: Possible if Answering Machine detection is activated.",
"P6" = "Fax, Modem: Detected (using Call Progress Analysis) after the call is connected.",
"P7" = "No Ring, No Dial Tone, Cancelled: Errors on the internal loop.",
"P8" = "Default Value",
"P9" = "In Do Not Call List",
"25" = "Language Barrier - SPANISH",
"30" = "Patient deceased or impaired",
"31" = "Hearing impaired",
"98" = "Not elligible",
"32" = "Patient impaired or disabled",
"97" = "Refused follow-up",
"02" = "Phone given to patient",
"03" = "Patient deceased",
"04" = "Patient permanently impaired or disabled",
"05" = "Patient currently unavailable",
"41" = "Wrong number",
"50" = "Terminate partial (indefinite callback)"
)
)
```
### S_RES
MDAC codebook = Case result.
This variable contains similar information to xRecordStatus in FM Pro, but includes additional response options. For this reason, it will be labeled as mdac_S_RES upon export to FM Pro.
```{r}
call_history <- call_history %>%
mutate(mdac_S_RES = recode(
S_RES,
"01" = "Continue",
"49" = "Connection Lost",
"51" = "Disconnected - No longer in service",
"40" = "Answering Machine/Left Message",
"46" = "No Answer",
"60" = "Wrong Number",
"47" = "Busy",
"43" = "Call Back",
"48" = "Partial Call Back",
"52" = "Computer/Fax",
"42" = "Answering Machine - No Msg Left",
"71" = "Hard Refusal",
"CO" = "Complete",
"W0" = "Time out",
"W1" = "More than one session attempted on the same case",
"W2" = "Project inactiviated while session in progress",
"W3" = "Disconnected by supervisor",
"70" = "Do Not Call",
"72" = "Soft Refusal",
"74" = "Refusal - Did not receive incentive from prev. survey",
"12" = "Screened Out (Wrong phone)",
"11" = "Screened Out (Wrong ZIP)",
"13" = "Screened out (Age Range)",
"35" = "Hang up",
"26" = "Language Barrier",
"44" = "Indefinite callback",
"W4" = "Screened out",
"W5" = "Out of quota",
"W6" = "Interrupted",
"90" = "Telephony issue",
"P1" = "No answer",
"P2" = "Busy",
"P3" = "Operator Intercept: Tri-Tone and ISDN codes received from provider.",
"P4" = "Answered and dropped: Possible if using predictive dialing when no interviewer is available to take the connected call.",
"P5" = "Answering Machine: Possible if Answering Machine detection is activated.",
"P6" = "Fax, Modem: Detected (using Call Progress Analysis) after the call is connected.",
"P7" = "No Ring, No Dial Tone, Cancelled: Errors on the internal loop.",
"P8" = "Default Value",
"P9" = "In Do Not Call List",
"25" = "Language Barrier - SPANISH",
"30" = "Patient deceased or impaired",
"31" = "Hearing impaired",
"98" = "Not elligible",
"32" = "Patient impaired or disabled",
"97" = "Refused follow-up",
"02" = "Phone given to patient",
"03" = "Patient deceased",
"04" = "Patient permanently impaired or disabled",
"05" = "Patient currently unavailable",
"41" = "Wrong number",
"50" = "Terminate partial (indefinite callback)"
)
)
```
### INT00
MDAC codebook = "Hello, I´m calling on behalf of MedStar Mobile Healthcare. They Provide ambulance service in the D/FW area. May I please speak with [FNAME] [LNAME]?"
This variable contains similar information to PhoneInitialRequest in FM Pro, but includes additional response options. For this reason, it will be labeled as mdac_INT00 upon export to FM Pro.
```{r}
call_history <- call_history %>%
mutate(mdac_INT00 = recode(
INT00,
"01" = "Patient answered",
"02" = "Phone given to patient",
"03" = "Patient deceased",
"04" = "Patient permanently impaired or disabled",
"05" = "Patient currently unavailable",
"40" = "Answering Machine",
"35" = "Hang up",
"41" = "Wrong number",
"70" = "Add to `Do Not Call` list",
"71" = "Hard refusal",
"72" = "Soft refusal",
"25" = "Language Barrier - SPANISH",
"26" = "Language Barrier (NON-Spanish)"
)
)
```
###INT04
MDAC codebook = "I understand. When would be a good time to reach them?"
This variable contains the same information as PhoneBetterTime in FM Pro.
```{r}
call_history <- call_history %>%
mutate(INT04 = recode(
INT04,
"43" = "Schedule callback",
"44" = "Indefinite callback"
)
)
```
###PH_MORE_INFO
MDAC codebook = "Thanks for calling us back. I was actually calling to ask you if you are willing to participate in a research study we are conducting with the University of Texas Health Science Center at Houston about the health and safety of North Texans who are at least 65 years old. If eligible, we would give you a 25 gift card for your time. Can I tell you a little bit more about it?", condition = "INBOUND = 1") [NOTE: start reading here if the patient was NOT the person who initially answered the phone and then continue below] Hello Mr./Ms. [LNAME]. I´m calling on behalf of MedStar Mobile Healthcare. They provide ambulance service in the D/FW area. Just so you know, I´m not calling to collect a payment or anything like that. [NOTE: start reading here if the patient was the person who initially answered the phone] Hello Mr./Ms. [LNAME]. I´m actually calling to ask you if you are willing to participate in a research study we are conducting with the University of Texas Health Science Center at Houston about the health and safety of North Texans who are at least 65 years old. If so, we would give you a 25 gift card for your time. Can I tell you a little bit more about it?"
This variable contains the same information as PhoneMoreInfo in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PH_MORE_INFO = recode(
PH_MORE_INFO,
"1" = "Yes",
"2" = "No",
"3" = "Currently unavailable",
"9" = "Hang up"
)
)
```
###PH_ELIG_CONS
MDAC codebook = "Great. Our records show that MedStar medics treated you on [DATE_T]. Because of that, you may be eligible to receive a follow-up visit from one of the paramedics who would give you a brief medical exam and ask you some questions about your overall health and safety as part of a research study for approximately one and a half hours. At the end of the visit, they will give you a gift card and connect you with health resources and equipment, if you would like them to. There are no known risks other than possible breach of confidentiality. Are you interested in participating?"
This variable contains the same information as PhoneEligibleConsent in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PH_ELIG_CONS = recode(
PH_ELIG_CONS,
"1" = "Yes",
"2" = "No",
"9" = "Hang-up"
)
)
```
###INT02
MDAC codebook = "No problem. We thank you for taking the time to answer our call. Have a nice day!"
This variable does not have an equivalent in FM Pro.
```{r}
call_history <- call_history %>%
mutate(INT02 = recode(
INT02,
"71" = "Hard refusal",
"72" = "Soft refusal"
)
)
```
###POSTCARD
MDAC codebook = "Great, thank you. We send out postcards to our selected participants before contacting them to let them know we are going to be giving them a call soon. Do you remember receiving a postcard telling you about this study?"
This variable contains the same information as PostcardRecall in FM Pro.
```{r}
call_history <- call_history %>%
mutate(POSTCARD = recode(
POSTCARD,
"1" = "Yes",
"2" = "No",
"9" = "Hang-up"
)
)
```
###PH_HEAR_DEV
MDAC codebook = "Before we can schedule that visit, I need to ask you a few questions to quickly check your hearing and memory. So, let´s make sure you are in a quiet place that doesn´t have a lot of distractions. Will you please make sure that all papers, pencils, books, calendars, newspapers, and anything else that might distract you are removed from your sight? Also, please be sure that the room is quiet; there should be no television, radio or music playing. [NOTE: Wait for the patient to confirm that distractions are removed and they are ready to move on.] Thank you, now do you use a hearing device?"
This variable contains the same information as PhoneHearingDevice in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PH_HEAR_DEV = recode(
PH_HEAR_DEV,
"1" = "Yes",
"2" = "No",
"9" = "Refused/hang up"
)
)
```
###PH_HEAR_DEVI
MDAC codebook = "Is it [hearing device] in place right now? [NOTE: If the patient tells you their hearing device is not in place, please ask them if they are willing to put it in/on. If they are unwilling, then check ``refused´´.]"
This variable contains the same information as PhoneHearingDeviceIn in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PH_HEAR_DEVI = recode(
PH_HEAR_DEVI,
"1" = "Yes",
"9" = "Refused/hang up"
)
)
```
###PHHEARCHCK
MDAC codebook = "Will you please repeat the following silly statement back to me so that I can make sure you´re able to hear me well enough: ``I have a cat so all I need is a dog.´´ [NOTE: Repeat the statement up to one time if the patient asks. If the patient asks for you to repeat a second time, apologize and say that you aren´t allowed to.] [NOTE: If the patient is confused about the statement, just let them know it doesn´t have any meaning. We just have to say something to make sure you can hear us.]"
This variable contains the same information as PhoneHearingCheck in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PHHEARCHCK = recode(
PHHEARCHCK,
"1" = "Correct",
"2" = "Incorrect",
"9" = "Refused/hang up"
)
)
```
###MOCA_MEMORY1
MDAC codebook = "Thank you. Now I´m going to ask you 10 questions to test your thinking and memory. Some of these questions may be easier than others and some may seem strange. I don´t want you to worry about it. Just do the best you can. Are you ready? This is a memory test. I am going to read a list of words that you will have to remember now and later on. Listen carefully. When I am through, tell me as many words as you can remember. It doesn´t matter in what order you say them." [NOTE: Read the list of five words at a rate of one per second, giving the following instructions:] FACE - VELVET - CHURCH - DAISY - RED [NOTE: Mark a check in the allocated space for each word the patient produces on the first trial. You may not correct the patient if (s)he recalls a deformed word or a word that sounds like the target word. When the patient indicates that (s)he has finished (has recalled all words), or can recall no more words, read the list a second time with the following instructions:] I am going to read the same list for a second time. Try to remember and tell me as many words as you can, including words you said the first time. FACE - VELVET - CHURCH - DAISY - RED."
This variable contains the same information as MocaMemory1 in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_MEMORY1 = recode(
MOCA_MEMORY1,
"1" = "Face",
"2" = "Velvet",
"3" = "Church",
"4" = "Daisy",
"5" = "Red",
"12" = "Face,Velvet",
"13" = "Face,Church",
"14" = "Face,Daisy",
"15" = "Face,Red",
"23" = "Velvet,Church",
"24" = "Velvet,Daisy",
"25" = "Velvet,Red",
"34" = "Church,Daisy",
"35" = "Church,Red",
"45" = "Daisy,Red",
"123" = "Face,Velvet,Church",
"124" = "Face,Velvet,Daisy",
"125" = "Face,Velvet,Red",
"134" = "Face,Church,Daisy",
"135" = "Face,Church,Red",
"145" = "Face,Daisy,Red",
"234" = "Velvet,Church,Daisy",
"235" = "Velvet,Church,Red",
"245" = "Velvet,Daisy,Red",
"345" = "Church,Daisy,Red",
"1234" = "Face,Velvet,Church,Daisy",
"1235" = "Face,Velvet,Church,Red",
"1245" = "Face,Velvet,Daisy,Red",
"1345" = "Face,Church,Daisy,Red",
"12345" = "Face,Velvet,Church,Daisy,Red"
)
)
```
###MOCA_MEMORY2
MDAC codebook = Second trial of recalling words from MOCA_MEMORY1.
This variable contains the same information as MocaMemory2 in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_MEMORY2 = recode(
MOCA_MEMORY2,
"1" = "Face",
"2" = "Velvet",
"3" = "Church",
"4" = "Daisy",
"5" = "Red",
"12" = "Face,Velvet",
"13" = "Face,Church",
"14" = "Face,Daisy",
"15" = "Face,Red",
"23" = "Velvet,Church",
"24" = "Velvet,Daisy",
"25" = "Velvet,Red",
"34" = "Church,Daisy",
"35" = "Church,Red",
"45" = "Daisy,Red",
"123" = "Face,Velvet,Church",
"124" = "Face,Velvet,Daisy",
"125" = "Face,Velvet,Red",
"134" = "Face,Church,Daisy",
"135" = "Face,Church,Red",
"145" = "Face,Daisy,Red",
"234" = "Velvet,Church,Daisy",
"235" = "Velvet,Church,Red",
"245" = "Velvet,Daisy,Red",
"345" = "Church,Daisy,Red",
"1234" = "Face,Velvet,Church,Daisy",
"1235" = "Face,Velvet,Church,Red",
"1245" = "Face,Velvet,Daisy,Red",
"1345" = "Face,Church,Daisy,Red",
"12345" = "Face,Velvet,Church,Daisy,Red"
)
)
```
###MOCA_DIGFORW
MDAC codebook = "I am going to say some numbers and when I am through, repeat them to me exactly as I said them. [NOTE: Read the list of five numbers at a rate of one digit per second] 2, 1, 8, 5, 4."
This variable contains the same information as MocaDigitForward in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_DIGFORW = recode(
MOCA_DIGFORW,"0" = "Sequence not correctly repeated",
"1" = "Sequence correctly repeated (2, 1, 8, 5, 4)",
"9" = "Refused/hang up"
)
)
```
###MOCA_DIGBACK
MDAC codebook = "Now I am going to say some more numbers, but when I am through you must repeat them to me in the backward order. [NOTE: Read the three number sequence at a rate of one digit per second. If the patient repeats the sequence in the forward order, the examiner may not ask the patient to repeat the sequence in backward order at this point.] 7, 4, 2."
This variable contains the same information as MocaDigitBackward in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_DIGBACK = recode(
MOCA_DIGBACK,
"0" = "Sequence not correctly repeated",
"1" = "Sequence correctly repeated (2, 4, 7)",
"9" = "Refused/hang up"
)
)
```
###MOCA_VIGIL
MDAC codebook = "I am going to read a sequence of letters. Every time I say the letter A, SAY YES one time. If I say a different letter, do not SAY YES. [NOTE: Read the list of letters at a rate of one digit per second.] F- B - A - C - M - N - A - A - J - K - L - B - A - F - A - K - D - E - A - A - A - J - A - M - O - F - A - A - B."
This variable contains the same information as MocaVigilance in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_VIGIL = recode(
MOCA_VIGIL,
"0" = "Two or more errors (an error is a tap on a wrong letter or a failure to tap on letter A)",
"1" = "Zero or one error (an error is a tap on a wrong letter or a failure to tap on letter A)",
"9" = "Refused/hang up"
)
)
```
###SERIAL_SCORE
MDAC codebook = Score for "Moca_Serial" subtractions.
This variable contains the same information as MocaSerial7 in FM Pro.
```{r}
call_history <- call_history %>%
mutate(SERIAL_SCORE = recode(
SERIAL_SCORE,
"0" = "Zero correct subtractions",
"1" = "One correct subtraction",
"2" = "Two or three correct subtractions",
"3" = "Two or three correct subtractions",
"4" = "Four or five correct subtractions",
"5" = "Four or five correct subtractions"
)
)
```
###MOCA_SENTREP
MDAC codebook = "I am going to read you a sentence. Repeat it after me, exactly as I say it [pause]: ``I only know that John is the one to help today.´´ [NOTE: Wait for response] Now I am going to read you another sentence. Repeat it after me, exactly as I say it [pause]: ``The cat always hid under the couch when dogs were in the room.´´ [NOTE: Repetitions must be exact. Be alert for omissions (e.g., omitting "only"), substitutions/additions (e.g., substituting "only" for "always"), grammar errors/altering plurals (e.g. "hides" for "hid"), etc.]"
This variable contains the same information as MocaSentenceRep in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_SENTREP = recode(
MOCA_SENTREP,
"0" = "Neither sentences correctly repeated",
"1" = "One sentence correctly repeated",
"2" = "Both sentences correctly repeated",
"9" = "Refused/hang up"
)
)
```
###MOCA_VERBFLU
MDAC codebook = "Now, I want you to tell me as many words as you can think of that begin with the letter F. I will tell you to stop after one minute. Proper nouns, numbers, and different forms of a verb are not permitted. Are you ready? [NOTE: Wait for response. Time for 60 sec.] [NOTE: If the patient names two consecutive words that begin with another letter of the alphabet, the examiner repeats the target letter if the instructions have not yet been repeated.] Stop."
This variable contains the same information as MocaVerbFluency in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_VERBFLU = recode(
MOCA_VERBFLU,
"0" = "Fewer than 11 words generated",
"1" = "11 or more words generated",
"9" = "Refused/hang up"
)
)
```
###MOCA_ABSTRAC
MDAC codebook = "I will give you two words and I would like you to tell me to what category they belong to [pause]: ``an orange and a banana.´´ [NOTE: If the patient replies correctly] Yes, both items are part of the category Fruits. [NOTE: If the patient answers in a concrete manner (but not ``fruits´´, give one additional prompt] Tell me another category to which these items belong to. [NOTE: If the patient does not give the appropriate response (fruits), then say:] Yes, and they also both belong to the category Fruits. [NOTE: No additional instructions or clarifications are given] Now, a train and a bicycle. Now, a ruler and a watch. [NOTE: A prompt (one for the entire abstraction section) may be given if none was used during the example.] [NOTE: Only the last two pairs are scored. One point is given for each pair correctly answered.] The following responses are acceptable: - train-bicycle = means of transportation, means of travelling, you take trips in both - ruler-watch = measuring instruments, used to measure The following responses are not acceptable: - train-bicycle = they have wheels - ruler-watch = they have numbers."
This variable contains similar information to MocaAbstraction in FM Pro, but includes additional response options. For this reason, it will be labeled as mdac_MOCA_ABSTRAC upon export to FM Pro.
```{r}
call_history <- call_history %>%
mutate(mdac_MOCA_ABSTRAC = recode(
MOCA_ABSTRAC,
"0" = "No correct answer for `train and bicycle` and `ruler and watch`",
"1" = "One correct answer for either `train and bicycle` or `ruler and watch`",
"2" = "Answered correctly for both `train and bicycle` and `ruler and watch`",
"9" = "Refused/hang up"
)
)
```
###MOCA_DELREC
MDAC codebook = "I read some words to you earlier, which I asked you to remember. Tell me as many of those words as you can remember. [NOTE: Make a check mark for each of the words correctly recalled spontaneously without any cues, in the allocated space] FACE - VELVET - CHURCH - DAISY - RED."
Format = numeric string containing all choices correctly recalled. e.g. "235" means Velvet, Church, and Red were correctly recalled.
This variable contains the same information as MocaDelayRecall in FM Pro.
```{r}
call_history <- call_history %>%
mutate(MOCA_DELREC = recode(
MOCA_DELREC,
"1" = "Face",
"2" = "Velvet",
"3" = "Church",
"4" = "Daisy",
"5" = "Red",
"12" = "Face,Velvet",
"13" = "Face,Church",
"14" = "Face,Daisy",
"15" = "Face,Red",
"23" = "Velvet,Church",
"24" = "Velvet,Daisy",
"25" = "Velvet,Red",
"34" = "Church,Daisy",
"35" = "Church,Red",
"45" = "Daisy,Red",
"123" = "Face,Velvet,Church",
"124" = "Face,Velvet,Daisy",
"125" = "Face,Velvet,Red",
"134" = "Face,Church,Daisy",
"135" = "Face,Church,Red",
"145" = "Face,Daisy,Red",
"234" = "Velvet,Church,Daisy",
"235" = "Velvet,Church,Red",
"245" = "Velvet,Daisy,Red",
"345" = "Church,Daisy,Red",
"1234" = "Face,Velvet,Church,Daisy",
"1235" = "Face,Velvet,Church,Red",
"1245" = "Face,Velvet,Daisy,Red",
"1345" = "Face,Church,Daisy,Red",
"12345" = "Face,Velvet,Church,Daisy,Red"
)
)
```
###OR_PLACECITY
MDAC codebook = "Now, tell me the name of the place you are in, and which city it is in. [INTERVIEWER, check the box for each item which is correct. For the place, any reasonable answer should be deemed correct, e.g. my living room, my house, the store, etc. Answers such as "on a spaceship" or "I don't know" are incorrect. For the city, it is correct if it matches the city listed below. Again "I don't know" is incorrect.] Correct City: [CITY]."
Format = numeric string containing all choices correctly recalled. e.g. "12" means both place and city were correctly provided.
This variable contains information that will be included in MocaOrientation in FM Pro.
```{r}
call_history <- call_history %>%
mutate(OR_PLACECITY = recode(
OR_PLACECITY,
"1" = "Place",
"2" = "City",
"12" = "Place,City"
)
)
```
###PH_ALZ_FLWUP
MDAC codebook = "From the questions we just completed, it seems that you may have some changes in your thinking or memory. One of our community partners, the Alzheimer's Association works with people who may have changes with their thinking or memory. Would it be alright if I share your information with the Alzheimer's Association so they can call you?"
This variable contains the same information as PhoneAlzheimerFollowUp in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PH_ALZ_FLWUP = recode(
PH_ALZ_FLWUP,
"1" = "Yes",
"2" = "No",
"3" = "Hang up"
)
)
```
###PH_BAT_FLWUP
MDAC codebook = "Finally, one of our partners, the UTHealth Trauma and Resilience Center is doing a study about treating depression and social isolation. You may also be eligible to participate in that study. Would it be alright if I share your information with Dr. Melba Hernandez at the UTHeatlh Trauma and Resilience Center so that they can call you?"
This variable contains the same information as PhoneBatPilotFollowUp in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PH_BAT_FLWUP = recode(
PH_BAT_FLWUP,
"1" = "Yes",
"2" = "No",
"9" = "Hang up"
)
)
```
###PH_WNT_FLWUP
MDAC codebook = "Thank you for answering all those questions. I know it was a lot. Now I would like to schedule that follow-up visit with you in the next two weeks. What day and time works best for you?"
This variable contains the same information as PhoneWantFollowUp in FM Pro.
```{r}
call_history <- call_history %>%
mutate(PH_WNT_FLWUP = recode(
PH_WNT_FLWUP,
"1" = "Yes",
"2" = "Refused"
)
)
```
###INT
MDAC codebook = List of all possible call dispositions.
```{r}
call_history <- call_history %>%
mutate(INT = recode(
INT,
"CO" = "Complete",
"W0" = "Time out",
"W1" = "More than one session attempted on the same case",
"W2" = "Project inactiviated while session in progress",
"W3" = "Disconnected by supervisor",
"W4" = "Screened out",
"W5" = "Out of quota",
"W6" = "Interrupted",
"90" = "Telephony issue",
"P1" = "No answer",
"P2" = "Busy",
"P3" = "Operator Intercept: Tri-Tone and ISDN codes received from provider.",
"P4" = "Answered and dropped: Possible if using predictive dialing when no interviewer is available to take the connected call.",
"P5" = "Answering Machine: Possible if Answering Machine detection is activated.",
"P6" = "Fax, Modem: Detected (using Call Progress Analysis) after the call is connected.",
"P7" = "No Ring, No Dial Tone, Cancelled: Errors on the internal loop.",
"P8" = "Default Value",
"P9" = "In Do Not Call List",
"01" = "Patient answered",
"02" = "Phone given to patient",
"03" = "Patient deceased",
"04" = "Patient permanently impaired or disabled",
"05" = "Patient currently unavailable",
"40" = "Answering Machine",
"35" = "Hang up",
"41" = "Wrong number",
"70" = "Add to `Do Not Call` list",
"71" = "Hard refusal",
"72" = "Soft refusal",
"25" = "Language Barrier - SPANISH",
"26" = "Language Barrier (NON-Spanish)",
"43" = "Schedule callback",
"44" = "Indefinite callback",
"30" = "Patient deceased",
"32" = "Patient impaired or disabled",
"31" = "Hearing impaired",
"98" = "Not elligible",
"97" = "Refused follow-up",
"49" = "Connection lost (call dropped)",
"48" = "Partial callback (SCHEDULED)",
"50" = "Terminate partial (indefinite callback)"
)
)
```
###MocaOrientation
The "MocaOrientation" variable shown in the "M Davis Filemaker Required Fields" Microsoft Excel Sheet requires combining the results of variables "OR_DATE", "OR_DAY", and "OR_PLACECITY". "MocaOrientation" should be formatted as a character string using a combination of the words "Date", "Month", "Year", "Day", "Place", and "City", depending on the participant's success during the corresponding assessment.
To create "MocaOrientation", we can first alter the "OR_DATE" variable to display the word "Date" for participants who were successful in the assessment corresponding to "OR_DATE". We can do this by:
1. Creating a variable "datediff" that will display the numeric difference between the date the participant was called (ResLastCallDate) and the date the participant recalled (OR_DATE). Due to the format of both date variables, if the participant correctly recalled the date, "datediff" would contain a value of 0 for that observation. If the participant incorrectly recalled the date, "datediff" would contain a value greater or less than 0.
2. Substituting the word "Date" into the "OR_DATE" variable for participants whose "datediff" variable contains a value of 0.
```{r}
# For data checking
call_history %>%
select(resRespondent, ResLastCallDate, OR_DATE) %>%
filter(!is.na(OR_DATE))
```
```{r}
call_history <- call_history %>%
mutate(datediff = (ResLastCallDate-OR_DATE)) %>%
mutate(OR_DATE = case_when(datediff == 0~'Date'))
```
Next, we can alter the "OR_DAY" variable to display the word "Day" for participants who were successful in the assessment corresponding to "OR_DAY". We can do this by:
1. Putting the "ResLastCallDate" into the Year/Month/Day format.
2. Creating a variable called "weekday" and filling it with the names of the weekdays corresponding to the dates in "ResLastCallDate".
3. Recoding "weekday" to match the formatting of the variable "OR_DAY". [Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday = 6, Saturday = 7]
4. Recoding "OR_DAY" to display to display the word "Day" if the numeric value in the "OR_DAY" variable was equal to the numeric value in the "weekday" variable.
```{r}
call_history <- call_history %>%
mutate(ResLastCallDate = ymd(ResLastCallDate)) %>%
mutate(weekday = weekdays(ResLastCallDate)) %>%
mutate(weekday = recode(
weekday,
"Sunday" = "1",
"Monday" = "2",
"Tuesday" = "3",
"Wednesday" = "4",
"Thursday" = "5",
"Friday" = "6",
"Saturday" = "7")) %>%
mutate(OR_DAY = case_when(weekday == OR_DAY~"Day"
)
)
```
Now we can create the "MocaOrientation" variable by combining "OR_DATE", "OR_DAY", and "OR_PLACECITY".
```{r}
call_history$MocaOrientation = paste(
call_history$OR_DATE,
",",
call_history$OR_DAY,
",",
call_history$OR_PLACECITY
)
```
###AppointmentTime
In the "M Davis Filemaker Required Fields" Microsoft Excel Sheet, the "Participant Scheduler" sheet requires a variable "AppointmentTime" formatted as H:M:S, so we can create "AppointmentTime" to display the time in that manner.
```{r}
call_history$AppointmentTime <- format(as.POSIXct(
call_history$SCHED_FLWUP,
"%Y-%m-%d %H:%M:%S",
tz = ""),
format = "%H:%M"
)
```
###AppointmentDate
In the "M Davis Filemaker Required Fields" Microsoft Excel Sheet, the "Participant Scheduler" sheet requires a variable "AppointmentDate" formatted as month/day/year, so we can create "AppointmentDate" to display the date in that manner.
```{r}
call_history$AppointmentDate <- format(as.Date(
call_history$SCHED_FLWUP,
"%Y-%m-%d"),
format = "%m/%d/%Y"
)
```
###ResLastCallDate
MDAC codebook = Date of call "yyyyMMdd" format.
This variable contains the same information as EntryDate in FM Pro.
```{r}
call_history <- call_history %>%
mutate(ResLastCallDate_new = ymd(ResLastCallDate))
call_history <- call_history %>%
mutate(ResLastCallDate_new = format(
as.Date(ResLastCallDate_new, '%Y-%m-%d'), "%m/%d/%Y")
)
call_history$ResLastCallDate_new2<-call_history$ResLastCallDate_new
```
##Creating row count variable
For table Phone Recruitment, the database is expecting data from the most recent callattempt per participant.
```{r}
call_history <- call_history %>% group_by(PTCARERPTNUM) %>%
arrange(PTCARERPTNUM,ResLastCallDate,LastCallStartTime) %>%
mutate(call_attempt = row_number())
```
##Grouping variables
Pulling the original FileMaker variables to their respective M Davis groupings (PhoneRecruitment, CallLog, and ParticipantScheduler) based on the expected file format laid out in the "M Davis Filemaker Required Fields" Microsoft Excel Sheet.
Note: the Phone Recruitment data frame requires only the most recent call attempt to be included.
```{r}
PhoneRecruitment <- call_history %>% filter(call_attempt == max(call_attempt)) %>%
select(
MOCA_SERIAL1,
MOCA_SERIAL2,
MOCA_SERIAL3,
MOCA_SERIAL4,
MOCA_SERIAL5,
ResLastCallDate_new,
S_RES,
PTCARERPTNUM,
ResLastCallDate_new2,
INT00,
INT04,
PH_MORE_INFO,
PH_ELIG_CONS,
POSTCARD,
PH_HEAR_DEV,
PH_HEAR_DEVI,
PHHEARCHCK,
MOCA_MEMORY1,
MOCA_MEMORY2,
MOCA_DIGFORW,
MOCA_DIGBACK,
MOCA_VIGIL,
SERIAL_SCORE,
MOCA_SENTREP,
MOCA_VERBFLU,
MOCA_ABSTRAC,
MOCA_DELREC,
MocaOrientation,
PH_ALZ_FLWUP,
PH_BAT_FLWUP,
PH_WNT_FLWUP,
SCORE)
CallLog <- call_history %>% select(
PTCARERPTNUM,
ResLastCallDate_new,
LastCallStartTime,
resCodeResult)
ParticipantScheduler <- call_history %>% select(
PTCARERPTNUM,
AppointmentDate,
AppointmentTime,
ResIntervCall)
```
##Renaming variables
Renaming the FileMaker variables to their corresponding M Davis variable names as shown in the "M Davis Filemaker Required Fields" Microsoft Excel Sheet.
```{r}
PhoneRecruitment <- PhoneRecruitment %>% rename(
xMocaSerial7_1 = MOCA_SERIAL1,
xMocaSerial7_2 = MOCA_SERIAL2,
xMocaSerial7_3 = MOCA_SERIAL3,
xMocaSerial7_4 = MOCA_SERIAL4,
xMocaSerial7_5 = MOCA_SERIAL5,
xMocaOrientationDate = ResLastCallDate_new,
xRecordStatus = S_RES,
MedstarID = PTCARERPTNUM,
EntryDate = ResLastCallDate_new2,
PhoneInitialRequest = INT00,
PhoneBetterTime = INT04,
PhoneMoreInfo = PH_MORE_INFO,
PhoneEligibleConsent = PH_ELIG_CONS,
PostcardRecall = POSTCARD,
PhoneHearingDevice = PH_HEAR_DEV,
PhoneHearingDeviceIn = PH_HEAR_DEVI,
PhoneHearingCheck = PHHEARCHCK,
MocaMemory1 = MOCA_MEMORY1,
MocaMemory2 = MOCA_MEMORY2,
MocaDigitForward = MOCA_DIGFORW,