-
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
56 changed files
with
93,537 additions
and
84,588 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
|
||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
func AidboxQuerierParser(aidboxURL string, fileToWriteTo string) { | ||
|
||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
fmt.Println(aidboxURL) | ||
respBody, err := helpers.QueryEndpointList(aidboxURL) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
var aidboxArr Bundle | ||
err = json.Unmarshal(respBody, &aidboxArr) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
for _, aidboxEntry := range aidboxArr.Entry { | ||
var entry LanternEntry | ||
|
||
entry.URL = aidboxEntry.URL | ||
entry.OrganizationName = aidboxEntry.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
45 changes: 45 additions & 0 deletions
45
endpointmanager/pkg/chplendpointquerier/criterionswebscraper.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,45 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/PuerkitoBio/goquery" | ||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
func CriterionsWebscraper(CHPLURL string, fileToWriteTo string) { | ||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".et_pb_text_inner") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
doc.Find(".et_pb_text_inner").Each(func(index int, divhtml *goquery.Selection) { | ||
divhtml.Find("h3").Each(func(indextr int, h3html *goquery.Selection) { | ||
parts := strings.SplitN(h3html.Text(), "https://", 2) | ||
organization := parts[0] | ||
url := "https://" + parts[1] | ||
|
||
if strings.HasSuffix(organization, "-") { | ||
organization = strings.TrimSuffix(organization, "-") | ||
} | ||
|
||
var entry LanternEntry | ||
|
||
entry.URL = strings.TrimSpace(url) | ||
entry.OrganizationName = strings.TrimSpace(organization) | ||
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
44 changes: 44 additions & 0 deletions
44
endpointmanager/pkg/chplendpointquerier/inpracsyswebscraper.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 ( | ||
"strings" | ||
|
||
"github.com/PuerkitoBio/goquery" | ||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
func InpracsysURLWebscraper(CHPLURL string, fileToWriteTo string) { | ||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".elementor-element.elementor-element-832f39a.elementor-widget.elementor-widget-text-editor") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
doc.Find(".elementor-element.elementor-element-832f39a.elementor-widget.elementor-widget-text-editor").Each(func(index int, mainhtml *goquery.Selection) { | ||
mainhtml.Find("div").Each(func(indextr int, divhtml *goquery.Selection) { | ||
mainhtml.Find("span").Each(func(indextr int, spanhtml *goquery.Selection) { | ||
preElem := spanhtml.Find("pre").First() | ||
parts := strings.SplitN(preElem.Text(), ".com", 2) | ||
url := parts[0] + ".com" | ||
|
||
parts = strings.SplitN(url, "GET", 2) | ||
|
||
var entry LanternEntry | ||
|
||
entry.URL = strings.TrimSpace(parts[1]) | ||
lanternEntryList = append(lanternEntryList, entry) | ||
}) | ||
}) | ||
}) | ||
|
||
endpointEntryList.Endpoints = lanternEntryList | ||
|
||
err = WriteCHPLFile(endpointEntryList, fileToWriteTo) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
endpointmanager/pkg/chplendpointquerier/maximuswebscraper.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,49 @@ | ||
package chplendpointquerier | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/PuerkitoBio/goquery" | ||
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
func MaximusURLWebscraper(chplURL string, fileToWriteTo string) { | ||
|
||
var lanternEntryList []LanternEntry | ||
var endpointEntryList EndpointList | ||
|
||
doc, err := helpers.ChromedpQueryEndpointList(chplURL, ".width50padd") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fhirEndpointsHeaderElem := doc.Find(".width50padd") | ||
if fhirEndpointsHeaderElem.Length() > 0 { | ||
fhirEndpointsHeaderElem.Find("ul").Each(func(index int, ulElems *goquery.Selection) { | ||
ulElems.Find("li").Each(func(index int, liElems *goquery.Selection) { | ||
if strings.Contains(liElems.Text(), "FHIR Base URL:") { | ||
divElems := liElems.Find("div") | ||
if divElems.Length() > 0 { | ||
preElems := liElems.Find("pre") | ||
if preElems.Length() > 0 { | ||
var entry LanternEntry | ||
|
||
fhirURL := strings.TrimSpace(preElems.Text()) | ||
entry.URL = fhirURL | ||
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
10 changes: 10 additions & 0 deletions
10
resources/dev_resources/Applied_Research_Works_Inc_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://fhir.cozeva.com/4_0_0", | ||
"OrganizationName": "Cozeva", | ||
"NPIID": "", | ||
"OrganizationZipCode": "" | ||
} | ||
] | ||
} |
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
Oops, something went wrong.