insightsengineering / teal.osprey

Community efforts to collect teal modules for TLGs defined in the osprey package
https://insightsengineering.github.io/teal.osprey/
Other
5 stars 2 forks source link

tm_g_patient_profile update validation of ADLB variables #5

Open cicdguy opened 3 years ago

cicdguy commented 3 years ago

Patient profile module tests that ADLB is unique by: "USUBJID", "STUDYID", "ANRIND", "LBSEQ", "PARAMCD", "BASETYPE", "ADT", "AVISITN", "LBSTRESN", "LBCAT", "LBTESTCD" So in case any of these variables are missing, the LB plot is not created.

Provenance:

Creator: bahatsky
cicdguy commented 3 years ago

Hmm I looked very quickly but it looks like at least LBSTRESN and ANRIND are required to be non-missing. I'm not sure about the other vars mentioned above.

NEST/teal.osprey/blob/77b09f95ebd8f9f6df4bea6724deb4680996c88e/R/tm_g_patient_profile.R#L878 Two options could be: - use validate to catch missing values in these variables and provide a note to the user about what's missing. This is pretty common in lab data but users can use the filters panel to filter out the NAs or select records with ANL01FL. - drop rows from ADLB --> this one is not great since the user may not know this is happening. But I guess the module is already doing this. What do you think? Provenance: ``` Creator: anajens ```
cicdguy commented 3 years ago

I looked further and I think it's a bit wrong what is done there. For example, ANRIND normally is not even based on LBSTRESN, it's based on AVAL, I think we should replace the references to SDTM variables to ADaM variables and then it will be fine. Suppose we have some derived tests in ADLB for which LBTESTCD and LBCAT are missing. Then this code will return an error although nothing is really wrong.

Provenance:

Creator: bahatsky