Skip to content

Commit

Permalink
Feb endpoints, refresh landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
svginc committed Feb 20, 2024
1 parent 57a9e4b commit eea613f
Show file tree
Hide file tree
Showing 56 changed files with 93,537 additions and 84,588 deletions.
42 changes: 42 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/aidboxquerier.go
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)
}

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package chplendpointquerier

import (
"fmt"
"strings"

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

func BridgePatientPortalWebscraper(chplURL string, fileToWriteTo string) {
Expand All @@ -17,7 +17,6 @@ func BridgePatientPortalWebscraper(chplURL string, fileToWriteTo string) {
if err != nil {
log.Fatal(err)
}
fmt.Println(doc.Html())
fhirEndpointsHeaderElem := doc.Find("#introduction/fhir-bridge-patient-portal/fhir-endpoints")
if fhirEndpointsHeaderElem.Length() > 0 {
spanElem := fhirEndpointsHeaderElem.Eq(0).Next()
Expand Down
39 changes: 39 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@ var officePracticumURL = "https://fhir-documentation.patientmedrecords.com/endpo
var modernizingMedicineURL = "https://mm-fhir-endpoint-display.prod.fhir.ema-api.com/"
var welligentURL = "https://fhir.qa.welligent.com/"
var willowURL = "https://www.willowgladetechnologies.com/requirements"
var aidboxURL = "https://aidbox.cx360.net/service-base-urls"
var medicaURL = "https://code.medicasoft.us/fhir_r4_endpoints.html"
var dss2URL = "https://dssjess-dev-web.dssinc.com/fhir/r4/endpoints"
var dynamicfhirURL = "https://dynamicfhirpresentation.dynamicfhirsandbox.com/"
var cozevaURL = "https://fhir.cozeva.com/endpoints"
var fhirjunoURL = "https://fhirjuno-prod-web.dssinc.com/fhir/r4/endpoints"
var hcsincURL = "https://hcswebportal.corporate.hcsinc.net/HCSClinicals_FHIR/api/Endpoint?connection-type=hl7-fhir-rest"
var greenwayURL = "https://developers.greenwayhealth.com/developer-platform/page/fhir-base-urls"
var snfistURL = "https://fhir.thesnfist.com/endpointlist"
var criterionsURL = "https://criterions.com/fhir-end-points/"
var maximusURL = "https://documents.maximus.care"
var tenzingURL = "https://tenzing.docs.apiary.io/#introduction/fhir-endpoints"
var inpracsysURL = "https://inpracsys.com/fhir/"

func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {

Expand Down Expand Up @@ -275,8 +288,16 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
CSVParser(chplURL, fileToWriteTo, "./ezdocs_fhir_base_urls.csv", 1, 0, true, 3, 1)
} else if URLsEqual(chplURL, netsmarttechnologiesURL) {
CSVParser(chplURL, fileToWriteTo, "./fhir_base_urls.csv", -1, 0, false, 1, 0)
} else if URLsEqual(chplURL, snfistURL) {
CSVParser(chplURL, fileToWriteTo, "./fhir_base_urls.csv", 2, 1, true, 1, 0)
} else if URLsEqual(chplURL, athenaClinicalsURL) {
CSVParser("https://fhir.athena.io/athena-fhir-urls/athenanet-fhir-base-urls.csv", fileToWriteTo, "./athenanet-fhir-base-urls.csv", 17136, 2, true, 3, 1)
} else if URLsEqual(chplURL, criterionsURL) {
CriterionsWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, tenzingURL) {
TenzingURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, inpracsysURL) {
InpracsysURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, medicscloudURL) {
MedicsCloudWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, advancedmdURL) {
Expand Down Expand Up @@ -377,6 +398,8 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, CarepathsURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, greenwayURL) {
CSVParser("https://greenway-fhir-base-url-list20230524071017901000000001.s3.us-east-2.amazonaws.com/greenwayFhirBaseUrls.csv", fileToWriteTo, "./ServiceBaseURLs.csv", -1, 1, true, 3, 0)
} else if URLsEqual(chplURL, mPNSoftwareURL) {
CSVParser("https://mpnproxyfhirstore.blob.core.windows.net/serviceurl/ServiceBaseURLs.csv", fileToWriteTo, "./ServiceBaseURLs.csv", 1, 0, true, 3, 2)
} else if URLsEqual(chplURL, NexusURL) {
Expand All @@ -385,12 +408,28 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
CSVParser(MEDENTURL, fileToWriteTo, "./ServiceBaseURL.csv", 1, 0, true, 1, 0)
} else if URLsEqual(chplURL, canvasMedicalURL) {
CanvasMedicalURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, maximusURL) {
MaximusURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, broadStreetURL) {
BroadStreetURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, officePracticumURL) {
OfficePracticumURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, willowURL) {
WillowQuerierParser("https://ccdoc.phn.care/service-base-urls", fileToWriteTo)
} else if URLsEqual(chplURL, aidboxURL) {
AidboxQuerierParser(aidboxURL, fileToWriteTo)
} else if URLsEqual(chplURL, dss2URL) {
BundleQuerierParser(dss2URL, fileToWriteTo)
} else if URLsEqual(chplURL, cozevaURL) {
BundleQuerierParser("https://fhir.cozeva.com/r4Endpoints.json", fileToWriteTo)
} else if URLsEqual(chplURL, medicaURL) {
BundleQuerierParser("https://code.medicasoft.us/fhir_r4_endpoints.json", fileToWriteTo)
} else if URLsEqual(chplURL, hcsincURL) {
BundleQuerierParser(hcsincURL, fileToWriteTo)
} else if URLsEqual(chplURL, fhirjunoURL) {
BundleQuerierParser(fhirjunoURL, fileToWriteTo)
} else if URLsEqual(chplURL, dynamicfhirURL) {
BundleQuerierParser("https://dynamicfhirpresentation.dynamicfhirsandbox.com/fhir/r4/endpoints", fileToWriteTo)
} else if URLsEqual(chplURL, veradigmURL) {
BundleQuerierParser("https://open.platform.veradigm.com/fhirendpoints/download/R4", fileToWriteTo)
}
Expand Down
45 changes: 45 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/criterionswebscraper.go
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)
}

}
1 change: 0 additions & 1 deletion endpointmanager/pkg/chplendpointquerier/csvparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func CSVParser(CHPLURL string, fileToWriteTo string, csvFilePath string, numreco
if numrecords >= 0 && records >= numrecords+startrecord {
break
}

if records >= startrecord {
var entry LanternEntry

Expand Down
44 changes: 44 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/inpracsyswebscraper.go
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 endpointmanager/pkg/chplendpointquerier/maximuswebscraper.go
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)
}

}
8 changes: 4 additions & 4 deletions endpointmanager/pkg/chplendpointquerier/tenzingwebscraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ func TenzingURLWebscraper(chplURL string, fileToWriteTo string) {

var lanternEntryList []LanternEntry
var endpointEntryList EndpointList
doc, err := helpers.ChromedpQueryEndpointList(chplURL, "main")

doc, err := helpers.ChromedpQueryEndpointList(chplURL, ".humanColumnApiDescription.markdown.formalTheme")
if err != nil {
log.Fatal(err)
}

fhirEndpointsHeaderElem := doc.Find("#introduction/terms-and-conditions/fhir-endpoints")
fhirEndpointsHeaderElem := doc.Find(".humanColumnApiDescription.markdown.formalTheme")
if fhirEndpointsHeaderElem.Length() > 0 {
spanElem := fhirEndpointsHeaderElem.Eq(0).Next()
spanElem.Find("ul").Each(func(index int, ulElems *goquery.Selection) {
fhirEndpointsHeaderElem.Find("ul").Each(func(index int, ulElems *goquery.Selection) {
ulElems.Find("li").Each(func(index int, liElems *goquery.Selection) {
liElems.Find("p").Each(func(index int, pElems *goquery.Selection) {
if strings.HasPrefix(pElems.Text(), "FHIR ") {
Expand Down
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": ""
}
]
}
22 changes: 17 additions & 5 deletions resources/dev_resources/CHPLEndpointResourcesList.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
},
{
"FormatType": "Lantern",
"URL": "https://api.meldrx.com/Directories/fhir/endpoints",
"URL": "https://app.meldrx.com/api/Directories/fhir/endpoints",
"EndpointName": "Darena Solutions LLC",
"FileName": "Darena_Solutions_LLC_EndpointSources.json"
},
Expand Down Expand Up @@ -553,13 +553,13 @@
},
{
"FormatType": "Lantern",
"URL": "https://dssjuno-dev-web.dssinc.com/dss/01ho/r4/Home/ApiDocumentation#Api_Urls",
"URL": "https://fhirjuno-prod-web.dssinc.com/fhir/r4/endpoints",
"EndpointName": "DSS, Inc.",
"FileName": "DSS_Inc_EndpointSources.json"
},
{
"FormatType": "Lantern",
"URL": "https://fhirjuno-prod-web.dssinc.com/fhir/r4/endpoints",
"URL": "https://dssjuno-dev-web.dssinc.com/dss/01ho/r4/Home/ApiDocumentation#Api_Urls",
"EndpointName": "DSS, Inc.",
"FileName": "DSS_Inc_1_EndpointSources.json"
},
Expand Down Expand Up @@ -917,6 +917,12 @@
"EndpointName": "Doc-tor.com",
"FileName": "Doctorcom_EndpointSources.json"
},
{
"FormatType": "Lantern",
"URL": "https://fhir.pointclickcare.com/",
"EndpointName": "PointClickCare Technologies Inc.",
"FileName": "PointClickCare_Technologies_Inc_EndpointSources.json"
},
{
"FormatType": "Lantern",
"URL": "https://dataapi.practiceehr.com",
Expand Down Expand Up @@ -949,7 +955,7 @@
},
{
"FormatType": "Lantern",
"URL": "https://fhir-dev.procentive.com/fhir/r4/endpoints",
"URL": "https://fhir.procentive.com/",
"EndpointName": "Procentive",
"FileName": "Procentive_EndpointSources.json"
},
Expand Down Expand Up @@ -1199,6 +1205,12 @@
"EndpointName": "Zoobook Systems LLC",
"FileName": "Zoobook_Systems_LLC_EndpointSources.json"
},
{
"FormatType": "Lantern",
"URL": "https://www.zoommd.com/zoommd-file-api-endpoints",
"EndpointName": "Metasolutions Inc",
"FileName": "Metasolutions_Inc_EndpointSources.json"
},
{
"FormatType": "Lantern",
"URL": "https://docs.athenahealth.com/api/guides/base-fhir-urls",
Expand Down Expand Up @@ -1279,7 +1291,7 @@
},
{
"FormatType": "Lantern",
"URL": "https://fhir-dev.10e11.com/fhir/r4/endpoints",
"URL": "https://fhir.10e11.com/",
"EndpointName": "TenEleven Group",
"FileName": "TenEleven_Group_EndpointSources.json"
},
Expand Down
Loading

0 comments on commit eea613f

Please sign in to comment.