-
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.
- Loading branch information
Showing
28 changed files
with
81,738 additions
and
78,186 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
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
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) | ||
} | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
endpointmanager/pkg/chplendpointquerier/willowquerierparser.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,54 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
type Entry struct { | ||
ID string `json:"id"` | ||
Name string `json:"name"` | ||
LogoURL string `json:"logoUrl,omitempty"` | ||
URL string `json:"url"` | ||
} | ||
|
||
type Bundle struct { | ||
ResourceType string `json:"resourceType"` | ||
Type string `json:"type"` | ||
Total int `json:"total"` | ||
Entry []Entry `json:"entry"` | ||
ID string `json:"id"` | ||
} | ||
|
||
func WillowQuerierParser(willowURL string, fileToWriteTo string) { | ||
|
||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
respBody, err := helpers.QueryEndpointList(willowURL) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
var willowArr Bundle | ||
err = json.Unmarshal(respBody, &willowArr) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
for _, willowEntry := range willowArr.Entry { | ||
var entry LanternEntry | ||
|
||
entry.URL = willowEntry.URL | ||
entry.OrganizationName = willowEntry.Name | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
{ | ||
"Endpoints": [ | ||
{ | ||
"URL": "https://providerapi.advancedmd.com/v1/r4", | ||
"OrganizationName": "", | ||
"NPIID": "", | ||
"OrganizationZipCode": "" | ||
} | ||
] | ||
"Endpoints": null | ||
} |
10 changes: 10 additions & 0 deletions
10
resources/dev_resources/BroadStreet_Health_LLC_EndpointSources.json
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,10 @@ | ||
{ | ||
"Endpoints": [ | ||
{ | ||
"URL": "https://broadstreet.arsanahealth.com/api/fhir/", | ||
"OrganizationName": "", | ||
"NPIID": "", | ||
"OrganizationZipCode": "" | ||
} | ||
] | ||
} |
Oops, something went wrong.