lib/sdp/importers/phin_vads_importer.rb
# Sync all of the valuesets and all of the versions into the system
Sync all of the valuesets and all of the versions into the system
Sync all of the valuesets and all of the versions into the system
def import_valuesets
        logger.debug 'Sync valuesets '
        valuesets = vads_client.getAllValueSets.getValueSets
        versions = vads_client.getAllValueSetVersions.getValueSetVersions
        temp = {}
        logger.debug
        valuesets.each do |vs|
          temp[vs.oid] = { valueset: vs, versions: [] }
        end
        versions.each do |ver|
          temp[ver.valueSetOid][:versions] << ver
        end
        @valuesets = temp.values
        @valuesets.each do |vs|
          logger.debug "working valueset #{vs[:valueset].name}"
          import_versions(vs)
        end
      end
def import_valuesets logger . debug 'Sync valuesets ' valuesets = vads_client . getAllValueSets . getValueSets versions = vads_client . getAllValueSetVersions . getValueSetVersions temp = { } logger . debug valuesets . each do | vs | temp [ vs . oid ] = { valueset : vs , versions : [ ] } end versions . each do | ver | temp [ ver . valueSetOid ] [ :versions ] << ver end @valuesets = temp . values @valuesets . each do | vs | logger . debug "working valueset #{vs[:valueset].name}" import_versions ( vs ) end end
Sync all of the valuesets and all of the versions into the system
Sync all of the valuesets and all of the versions into the system
# get all of the versions and valuesets and map them together # this is cleaner and easier than getting the vs and the getting all of it's versions # separately