-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from onc-healthit/LANTERN-577-HealthSamuraiWe…
…bscraper LANTERN-577, LANTERN-581: Modified HealthSamurai and Healthie webscrapers
- Loading branch information
Showing
3 changed files
with
55 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
endpointmanager/pkg/chplendpointquerier/custombundlequerierparser.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
type CustomBundle struct { | ||
Entries []CustomBundleEntry `json:"entry"` | ||
} | ||
|
||
type CustomBundleEntry struct { | ||
Id string `json:"id"` | ||
Name string `json:"name"` | ||
Url string `json:"url"` | ||
} | ||
|
||
func CustomBundleQuerierParser(CHPLURL string, fileToWriteTo string) { | ||
|
||
var entry LanternEntry | ||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
respBody, err := helpers.QueryEndpointList(CHPLURL) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
var customBundle CustomBundle | ||
err = json.Unmarshal(respBody, &customBundle) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
for _, bundleEntry := range customBundle.Entries { | ||
entry.URL = bundleEntry.Url | ||
entry.OrganizationName = bundleEntry.Name | ||
|
||
lanternEntryList = append(lanternEntryList, entry) | ||
} | ||
|
||
endpointEntryList.Endpoints = lanternEntryList | ||
|
||
err = WriteCHPLFile(endpointEntryList, fileToWriteTo) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
} |
45 changes: 0 additions & 45 deletions
45
endpointmanager/pkg/chplendpointquerier/healthsamuraiparser.go
This file was deleted.
Oops, something went wrong.