-
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 #368 from onc-healthit/add_chpl_list_jan24
Add new endpoint list and fixes
- Loading branch information
Showing
67 changed files
with
138,207 additions
and
117,114 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
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
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
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
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
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
44 changes: 44 additions & 0 deletions
44
endpointmanager/pkg/chplendpointquerier/broadstreetwebscraper.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,44 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"github.com/PuerkitoBio/goquery" | ||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
"strings" | ||
) | ||
|
||
func BroadStreetURLWebscraper(CHPLURL string, fileToWriteTo string) { | ||
|
||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, "article") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
doc.Find("article").Each(func(index int, articleElems *goquery.Selection) { | ||
articleElems.Find("table").Each(func(index int, tableElems *goquery.Selection) { | ||
tableElems.Find("tbody").Each(func(index int, bodyElems *goquery.Selection) { | ||
bodyElems.Find("tr").Each(func(index int, trElems *goquery.Selection) { | ||
tdEntry := trElems.Find("td").First() | ||
if strings.Contains(tdEntry.Text(), "FHIR Production") { | ||
tdEntryNext := trElems.Find("td").Next() | ||
if tdEntryNext.Length() > 0 { | ||
var entry LanternEntry | ||
entry.URL = strings.TrimSpace(tdEntryNext.Text()) | ||
lanternEntryList = append(lanternEntryList, entry) | ||
} | ||
} | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
endpointEntryList.Endpoints = lanternEntryList | ||
|
||
err = WriteCHPLFile(endpointEntryList, fileToWriteTo) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
} |
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
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
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
38 changes: 38 additions & 0 deletions
38
endpointmanager/pkg/chplendpointquerier/officepracticumwebscraper.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,38 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"github.com/PuerkitoBio/goquery" | ||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
"strings" | ||
) | ||
|
||
func OfficePracticumURLWebscraper(CHPLURL string, fileToWriteTo string) { | ||
|
||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".MuiTableCell-root.MuiTableCell-body.MuiTableCell-sizeMedium.css-q34dxg") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
doc.Find("tbody.MuiTableBody-root.css-1xnox0e").Each(func(i int, bodyEle *goquery.Selection) { | ||
bodyEle.Find("tr").Each(func(index int, trEle *goquery.Selection) { | ||
organizationName := trEle.Find("td").First().Text() | ||
URL := trEle.Find("td").Next().Text() | ||
var entry LanternEntry | ||
entry.OrganizationName = strings.TrimSpace(organizationName) | ||
entry.URL = strings.TrimSpace(URL) | ||
lanternEntryList = append(lanternEntryList, entry) | ||
}) | ||
}) | ||
|
||
endpointEntryList.Endpoints = lanternEntryList | ||
|
||
err = WriteCHPLFile(endpointEntryList, fileToWriteTo) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
} |
Oops, something went wrong.