study date field and format string?

LabKey Support Forum (Inactive)
study date field and format string? Ben Bimber  2010-07-07 06:05
Status: Closed
 
each dataset in a study has a date field (denoted by this in datasets_metadata.xml: <propertyURI>http://cpas.labkey.com/Study#VisitDate</propertyURI>).

there is a study-wide date format string; however, we'd like to set this differently on a per dataset basis. I originally tried to add a <formatString> param to the tables in datasets_metadata.xml. This will change the date format for any date field, except those with the propertURI above. I believe I was told that when you add a propertyURI, all other metadata you supply in datasets_metadata.xml is ignored? Is that what's happening here? I figured out that I can override the format string table-by-table by adding query metadata.

I already had to create one XML file per dataset anyway since I needed to add a <tableURL> to each dataset, so adding date format wasnt too big a deal. I actually think moving a lot of the metadata from datasets_metadata into each dataset's metadata XML file would make sense. Is there any reason why this is not a good idea?
 
 
Ben Bimber responded:  2010-07-07 10:56
one follow up:

We can add metadata in the dataset definition or add metadata through the schema browser. After discussions with Josh, we are adding a lookup for all instances of the EHR project field in query metadata, not the dataset definition. I have also tried adding several other lookups using query metadata instead of doing it in the dataset definition (for testing purposes).

When adding lookups using query metadata, they don't seem to appear correctly in the normal dataset insert / update pages. If I define the lookup in the dataset definition then the corresponding field is a select. If I define it using query metadata, it is not. In either case, the field appears correctly in the schema browser, so the lookup does seem to get recognized here. I assume that means I can write sql using it, but have not tried.

Is that the expected behavior?
 
adam responded:  2010-07-07 15:39
As you've found, the dataset_metadata.xml file only affects user-defined properties of the dataset, not the standard columns like visit date and participant id. We should make this as an option. In the mean time, using query metadata seems like a fine way to go. You won't have the ability to import/export this metadata, but I believe you're doing this all in a module anyway.

As for the lookup discrepancy you found, that sounds like a bug. I'll open an issue to investigate this during 10.3.

Adam
 
adam responded:  2010-07-07 15:49