Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Dataframe of Metadata from {xportr} attributes #2

Open
4 tasks
mstackhouse opened this issue Sep 27, 2022 · 0 comments
Open
4 tasks

Build Dataframe of Metadata from {xportr} attributes #2

mstackhouse opened this issue Sep 27, 2022 · 0 comments
Assignees

Comments

@mstackhouse
Copy link
Contributor

  • Read a dataframe (we can do this using read_dataset_json()
  • Add a new variable to it
  • Apply the attributes using the xportr functions xportr_length() and xportr_label(). Type should be inferred from the variable (for now assume integer and string for simplicity of POC).
  • With the attributes applied, construct the following dataframe:
                OID             name                                label    type length
1  ITEMGROUPDATASEQ ITEMGROUPDATASEQ                    Record Identifier integer     NA
2     IT.DM.STUDYID          STUDYID                     Study Identifier  string     12
3      IT.DM.DOMAIN           DOMAIN                  Domain Abbreviation  string      2
4     IT.DM.USUBJID          USUBJID            Unique Subject Identifier  string      8
5      IT.DM.SUBJID           SUBJID     Subject Identifier for the Study  string      4
6     IT.DM.RFSTDTC          RFSTDTC    Subject Reference Start Date/Time  string     NA
7     IT.DM.RFENDTC          RFENDTC      Subject Reference End Date/Time  string     NA
8    IT.DM.RFXSTDTC         RFXSTDTC   Date/Time of First Study Treatment  string     NA
9    IT.DM.RFXENDTC         RFXENDTC    Date/Time of Last Study Treatment  string     NA
10    IT.DM.RFICDTC          RFICDTC        Date/Time of Informed Consent  string     NA
11   IT.DM.RFPENDTC         RFPENDTC    Date/Time of End of Participation  string     NA
12     IT.DM.DTHDTC           DTHDTC                   Date/Time of Death  string     NA
13      IT.DM.DTHFL            DTHFL                   Subject Death Flag  string      1
14     IT.DM.SITEID           SITEID                Study Site Identifier  string      3
15    IT.DM.BRTHDTC          BRTHDTC                   Date/Time of Birth  string     NA
16        IT.DM.AGE              AGE                                  Age integer      8
17       IT.DM.AGEU             AGEU                            Age Units  string      5
18        IT.DM.SEX              SEX                                  Sex  string      1
19       IT.DM.RACE             RACE                                 Race  string     41
20     IT.DM.ETHNIC           ETHNIC                            Ethnicity  string     22
21      IT.DM.ARMCD            ARMCD                     Planned Arm Code  string      8
22        IT.DM.ARM              ARM           Description of Planned Arm  string     28
23   IT.DM.ACTARMCD         ACTARMCD                      Actual Arm Code  string      8
24     IT.DM.ACTARM           ACTARM            Description of Actual Arm  string     28
25     IT.DM.ARMNRS           ARMNRS Reason Arm and/or Actual Arm is Null  string     14
26   IT.DM.ACTARMUD         ACTARMUD  Description of Unplanned Actual Arm  string    200
27    IT.DM.COUNTRY          COUNTRY                              Country  string      3

In the OID column, the DM portion should be inferred from the object name of the variable passed into the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants