Skip to content

Commit

Permalink
LANTERN-760: Add axeium web scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
archita-ekkirala committed Oct 18, 2024
1 parent 220ba76 commit 8c92564
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
33 changes: 33 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/axeiumwebscraper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package chplendpointquerier

import (
"strings"
"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers"
log "github.com/sirupsen/logrus"
)

func AxeiumeWebscraper(vendorURL string, fileToWriteTo string) {

var lanternEntryList []LanternEntry
var endpointEntryList EndpointList
doc, err := helpers.ChromedpQueryEndpointList(vendorURL, "")
if err != nil {
log.Fatal(err)
}

fhirEndpoint, exists := doc.Find("input#fhirEndpoint").Attr("value")
if exists {
var entry LanternEntry

fhirURL := strings.TrimSpace(fhirEndpoint)
entry.URL = fhirURL
lanternEntryList = append(lanternEntryList, entry)
}

endpointEntryList.Endpoints = lanternEntryList

err = WriteCHPLFile(endpointEntryList, fileToWriteTo)
if err != nil {
log.Fatal(err)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ var zoommdURL = "https://www.zoommd.com/zoommd-file-api-endpoints"
var footholdURL = "https://fhir.footholdtechnology.com/demodb/endpoints"
var pointclickURL = "https://fhir.pointclickcare.com/"
var nextgenPracticeURL = "https://www.nextgen.com/api/practice-search"
var axeiumURL="https://apifhir.axeium.net:8443/reference-server/"

func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {

Expand Down Expand Up @@ -528,6 +529,8 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
PointclickWebscraper(pointclickURL, fileToWriteTo)
} else if URLsEqual(chplURL, nextgenPracticeURL) {
NextgenPracticeWebscraper(nextgenPracticeURL, fileToWriteTo)
} else if URLsEqual(chplURL, axeiumURL){
AxeiumeWebscraper(axeiumURL, fileToWriteTo)
} else {
log.Warnf("Handler is required for url %s", chplURL)
}
Expand Down

0 comments on commit 8c92564

Please sign in to comment.