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

Departments come in from Mediaflux as a Name not a code #1210

Closed
1 of 3 tasks
carolyncole opened this issue Jan 7, 2025 · 5 comments
Closed
1 of 3 tasks

Departments come in from Mediaflux as a Name not a code #1210

carolyncole opened this issue Jan 7, 2025 · 5 comments
Assignees

Comments

@carolyncole
Copy link
Member

carolyncole commented Jan 7, 2025

Departments that are imported from Mediaflux are coming in as a name not a code

Completion Criteria:

  • Add the values in this sheet to princeton_ansible
  • Import the department data into affiliations
  • Change the import project rake task to convert the name to an affiliation code
@carolyncole
Copy link
Member Author

carolyncole commented Jan 7, 2025

We could possibly get code from ldap for the projects we already have (reqires net_ldap gem)

Project.all(&:metadata_model).map(&:departments).flatten.uniq.each do |department|
  filter = Net::LDAP::Filter.eq("ou", department.gsub("Department of","") )  
  results = ldap_connection.search(filter:)     
  codes = results.map{|r| r[:puhomedepartmentnumber]}.uniq.flatten
  code = codes.reject{|code| code.length < 5}.first
  if code
     puts "department #{department} code #{code}"  
  else
    puts "department #{department} may be a code #{code}"
  end
end  

So far from production this would handle all but PNI and Lewis-Sigler Institute

department 23100 may be a code 
department RDSS may be a code 
department Princeton Neuroscience Institute code 24400
department Civil and Environmental Engineering code 25200
department Astrophysical Sciences code 23100
department Department of Astrophysical Sciences code 23100
department Center for Digital Humanities code 26700
department English code 20600
department Physics code 23800
department PNI may be a code 
department Ecology and Evolutionary Biology code 23400
department Lewis-Sigler Institute may be a code 
department Mechanical and Aerospace Engineering code 25100
department Chemical and Biological Engineering code 25300
department Research Computing code 41235
department Department of Geosciences code 23600
department Chemistry code 23500

@kelynch
Copy link
Contributor

kelynch commented Jan 8, 2025

@carolyncole
Copy link
Member Author

There is still some manual updating needed for the departments, but the code portion is completed and deployed.

@kelynch
Copy link
Contributor

kelynch commented Jan 15, 2025

Chuck is doing this remediation starting today.

@cbentlerOIT
Copy link

The updates to the department values and the DOIs have been completed in Mediaflux. Any new configuration will use the department value from the spreadsheet.

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

4 participants