Skip to content

Commit

Permalink
required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cristinamullin committed Aug 16, 2023
1 parent aa3869e commit 437596a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
38 changes: 25 additions & 13 deletions R/Utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ TADA_AutoClean <- function(.data) {
required_cols <- c(
"ActivityMediaName", "ResultMeasureValue", "ResultMeasure.MeasureUnitCode",
"CharacteristicName", "ResultSampleFractionText", "MethodSpecificationName",
"DetectionQuantitationLimitMeasure.MeasureUnitCode", "ResultDetectionConditionText"
"DetectionQuantitationLimitMeasure.MeasureUnitCode", "ResultDetectionConditionText",
"ResultIdentifier", "DetectionQuantitationLimitMeasure.MeasureValue",
"LatitudeMeasure", "LongitudeMeasure"
)

# check .data has required columns
Expand Down Expand Up @@ -528,6 +530,7 @@ TADA_OrderCols <- function(.data) {
"TADA.ResultMeasureValueDataTypes.Flag",
"TADA.ResultValueAggregation.Flag",


"TADA.MeasureQualifierCode.Flag",
"TADA.CensoredData.Flag",
"TADA.CensoredMethod",
Expand Down Expand Up @@ -1136,7 +1139,6 @@ TADA_CheckRequiredFields <- function(.data) {
#"ActivityLocation.LongitudeMeasure",
#"ResultStatusIdentifier",
#"ResultWeightBasisText",
#"ResultTimeBasisText",
#"ResultTemperatureBasisText",
#"ResultParticleSizeBasisText",
#"USGSPCode",
Expand All @@ -1163,12 +1165,6 @@ TADA_CheckRequiredFields <- function(.data) {
#"AquiferName",
#"LocalAqfrName",
#"FormationTypeText",
#"AquiferTypeName",
#"ConstructionDateText",
#"WellDepthMeasure.MeasureValue",
#"WellDepthMeasure.MeasureUnitCode",
#"WellHoleDepthMeasure.MeasureValue",
#"WellHoleDepthMeasure.MeasureUnitCode",
#"ProjectMonitoringLocationWeightingUrl",
#"DrainageAreaMeasure.MeasureValue",
#"DrainageAreaMeasure.MeasureUnitCode",
Expand All @@ -1193,9 +1189,7 @@ TADA_CheckRequiredFields <- function(.data) {
"SampleCollectionMethod.MethodIdentifierContext",
"SampleCollectionMethod.MethodName",
"SampleCollectionMethod.MethodDescriptionText",
"SampleCollectionEquipmentName",
"ActivityMediaSubdivisionName",
"StatisticalBaseCode",
"DataQuality.PrecisionValue",
"DataQuality.BiasValue",
"DataQuality.ConfidenceIntervalValue",
Expand All @@ -1209,15 +1203,29 @@ TADA_CheckRequiredFields <- function(.data) {
"ResultAnalyticalMethod.MethodUrl",
"ResultAnalyticalMethod.MethodDescriptionText",
"ResultCommentText",
"LastUpdated",
"ProviderName",
"ResultValueTypeName",
"LaboratoryName",
"ResultLaboratoryCommentText",
"MonitoringLocationDescriptionText",
"HUCEightDigitCode",
"AquiferTypeName", # can be used to remove groundwater sites
"ConstructionDateText", # can be used to remove groundwater sites
"WellDepthMeasure.MeasureValue", # can be used to remove groundwater sites
"WellDepthMeasure.MeasureUnitCode", # can be used to remove groundwater sites
"WellHoleDepthMeasure.MeasureValue", # can be used to remove groundwater sites
"WellHoleDepthMeasure.MeasureUnitCode", # can be used to remove groundwater sites
"ProviderName",
"LastUpdated",

# required
"TADA.CharacteristicName",
"TADA.ResultSampleFractionText",
"TADA.MethodSpecificationName",
"TADA.ResultMeasure.MeasureUnitCode",
"TADA.ActivityMediaName",
"TADA.DetectionQuantitationLimitMeasure.MeasureUnitCode",
"TADA.ResultMeasureValueDataTypes.Flag",
"TADA.LatitudeMeasure",
"TADA.LongitudeMeasure",
"OrganizationFormalName",
"ActivityTypeCode",
"ActivityMediaName",
Expand Down Expand Up @@ -1250,6 +1258,10 @@ TADA_CheckRequiredFields <- function(.data) {
"QAPPApprovalAgencyName",
"ProjectFileUrl",
"MeasureQualifierCode",
"SampleCollectionEquipmentName", #required for continuous flag
"StatisticalBaseCode", #required for continuous flag
"ResultTimeBasisText", #required for continuous flag
"ResultValueTypeName", #required for continuous flag
"ActivityIdentifier",
"ProjectIdentifier",
"MonitoringLocationIdentifier",
Expand Down
2 changes: 1 addition & 1 deletion vignettes/TADAModule1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ remotes::install_github("USEPA/TADA",
# when developing the package, update this chunk to the current repository, so it runs with all of the new features prior to a PR to develop
remotes::install_github("USEPA/TADA",
ref = "figures",
ref = "081023-cm",
dependencies = TRUE
)
```
Expand Down

0 comments on commit 437596a

Please sign in to comment.