Git Product home page Git Product logo

dsccphos's People

Contributors

bastianreiter avatar threated avatar

Stargazers

Niklas Woltering avatar

Watchers

 avatar

Forkers

threated

dsccphos's Issues

Impute Missing Features in CurateDataDS

Analogously to missing tables where empty tables are created, create missing features in tables that are already there.
Use GetRDSTablesCheck but for features (Return is list Messages$Site$RDS_Table$TableExists ...$MissingFeatures)

ADS consistency function

Please implement as a function in dsCCPhos. The following function trys to make the ADS tables consistent on the basis of patient_ids. This needs a trigger function in dsCCPhosClient or it can be implemented directly in AugmentDataDS

AdsCongruencyTransformation <- function (data = ADS){
  
  # rename data object components
  P <- ADS$Patients
  E <- ADS$Events
  D <- ADS$Diagnoses
  
  # patient uniqueness check for data frame P
  if (length(P$PatientID) == length(unique(P$PatientID))){
    print("No duplicate PatientIDs in Table Patient.")
  }
    
  # intersect of patient ids in patient and diagnosis
  Inter1 <- dplyr::intersect(P$PatientID, D$PatientID)
  
  # intersect of inter1 and events
  vec_PatientIDsIntersect <- dplyr::intersect(Inter1, E$PatientID)
  
  # discard patient_ids not in intersect (either no entries in patient, events or diagnosis)
  # count patient ids
  n_PatDiscard <- length(which(P$PatientID %notin% vec_PatientIDsIntersect))
  
  # filter patient ids from P
  P <- P %>%
    filter(PatientID %in% vec_PatientIDsIntersect)
  
  # message
  print(paste0("Removing: ", n_PatDiscard," records from ADS Patients table."))
  
  # filter patient ids from D
  n_DiagDiscard <- length(which(D$PatientID %notin% vec_PatientIDsIntersect))
  D <- D %>%
    filter(PatientID %in% vec_PatientIDsIntersect)
  
  # message
  print(paste0("Removing: ", n_DiagDiscard, " records from ADS Diagnosis table."))
  
  # filter patient ids from E
  n_EventsDiscard <- length(which(E$PatientID %notin% vec_PatientIDsIntersect))
  E <- E %>%
    filter(PatientID %in% vec_PatientIDsIntersect)
  
  # message
  print(paste0("Removing: ", n_EventsDiscard," records from ADS Events table."))
  
  # if all patient ids from P in D and E
  if (all(P$PatientID %in% unique(D$PatientID)) &
      all(P$PatientID %in% unique(E$PatientID)) &
      all(unique(D$PatientID) %in% unique(E$PatientID))){
    
	# if TRUE message
    print("Congruency check passed: ADS tables contain data about the same set of patients.")
    
  }
  else {
    
	# else Warning message
    print("Warning in congruency check. Please re-investiage processing.")
  }
  
  # re-allocate
  ADS$Patients <- P
  ADS$Diagnoses <- D
  ADS$Events <- E
  
  # return
  return(ADS)
}

Problem in application of CurateDataDS

Fehlermeldung Mannheim

[1] "Command 'CurateDataDS(RawDataSetName.S = "RawDataSet", RuleProfile_RawDataHarmonization.S = "Default", \n RuleProfile_DiagnosisRedundancy.S = "Default", RuleProfile_DiagnosisAssociation.S = "Default")' failed on 'Mannheim': Error while evaluating 'is.null(base::assign('CurationOutput', value={dsCCPhos::CurateDataDS(RawDataSetName.S = "RawDataSet", RuleProfile_RawDataHarmonization.S = "Default", RuleProfile_DiagnosisRedundancy.S = "Default", RuleProfile_DiagnosisAssociation.S = "Default")}))' -> Error in purrr::map(.x = names(ls_DataSet), .f = function(TableName) { : \n โ„น In index: 10.\nCaused by error in UseMethod():\n! no applicable method for 'rename' applied to an object of class "NULL"\n"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.