Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CHPL endpoint list #364

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 51 additions & 2 deletions endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var modernizingmedicineURL = "https://mm-fhir-endpoint-display.qa.fhir.ema-api.c
var doc_torURL = "https://hag-fhir.amazingcharts.com/pc/endpoints"
var azaleahealthURL = "https://api.azaleahealth.com/fhir/R4/Endpoint"
var cloudcraftURL = "https://fhirapitest.naiacorp.net/fhir/r4/endpoints/"
var darenasolutionsURL = "https://hub.meldrx.com"
var darenasolutionsURL = "https://api.meldrx.com/Directories/fhir/endpoints"
var glenwoodsystemsURL = "https://static.glaceemr.com/endpoints/urls.json"
var practicefusionURL = "https://www.practicefusion.com/assets/static_files/ServiceBaseURLs.json"
var universalEHRURL = "https://appstudio.interopengine.com/partner/fhirR4endpoints-universalehr.json"
Expand Down Expand Up @@ -119,6 +119,23 @@ var nextechURL = "https://www.nextech.com/hubfs/Nextech%20FHIR%20Base%20URL.csv"
var novomediciURL = "https://www.novomedici.com/api-documents/"
var patientpatternURL = "https://patientpattern-static.s3.us-west-2.amazonaws.com/static/documents/fhir-base-urls.csv"
var pcisgoldURL = "https://fhir.pcisgold.com/fhirdocs/practices.json"
var healthieURL = "https://app-52512.on-aptible.com/service-base-urls"
var medConnectURL = "https://api.medconnecthealth.com/fhir/r4/endpoints"
var citiusTechURL = "https://8759937.fs1.hubspotusercontent-na1.net/hubfs/8759937/assets/pdfs/Perform+ConnectServerEndpoints.json"
var enableHealthcareURL = "https://ehifire.ehiconnect.com/fhir/r4/endpoints"
var drchronoURL = "https://drchrono-fhirpresentation.everhealthsoftware.com/fhir/r4/endpoints"
var visionWebURL = "https://dhpresentation.youruprise.com/fhir/r4/endpoints"
var streamlineURL = "https://dhfhirpresentation.smartcarenet.com/fhir/r4/endpoints"
var procentiveURL = "https://fhir-dev.procentive.com/fhir/r4/endpoints"
var tenElevenURL = "https://fhir-dev.10e11.com/fhir/r4/endpoints"
var henryScheinURL = "https://micromddev.dynamicfhir.com/fhir/r4/endpoints"
var iSALUSURL = "https://isalus-fhirpresentation.everhealthsoftware.com/fhir/r4/endpoints"
var healthInnovationURL = "https://revolutionehrdev.dynamicfhir.com/fhir/r4/endpoints"
var mPNSoftwareURL = "https://mpnproxyfhirstore.blob.core.windows.net/serviceurl/ServiceBaseURLs.csv"
var NexusURL = "https://www.nexusclinical.net/nexusehr-fhirapi-base-urls.csv"
var MEDENTURL = "https://www.medent.com/std_api/ServiceBaseURL.csv"

//var tenzingURL = "https://tenzing.docs.apiary.io/#introduction/fhir-endpoints"

func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {

Expand Down Expand Up @@ -229,7 +246,7 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
} else if URLsEqual(chplURL, cloudcraftURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, darenasolutionsURL) {
BundleQuerierParser("https://api.meldrx.com/Directories/fhir/endpoints", fileToWriteTo)
BundleQuerierParser(darenasolutionsURL, fileToWriteTo)
} else if URLsEqual(chplURL, glenwoodsystemsURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, practicefusionURL) {
Expand Down Expand Up @@ -330,6 +347,38 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
PatientpatternURLCSVParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, pcisgoldURL) {
PCISgoldURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, healthieURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, medConnectURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, citiusTechURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, enableHealthcareURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, drchronoURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, visionWebURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, streamlineURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, procentiveURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, tenElevenURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, henryScheinURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, iSALUSURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, healthInnovationURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} 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) {
CSVParser("https://www.nexusclinical.net/nexusehr-fhirapi-base-urls.csv", fileToWriteTo, "./nexusehr-fhirapi-base-urls.csv", 1, 0, true, 2, 1)
} else if URLsEqual(chplURL, MEDENTURL) {
CSVParser(MEDENTURL, fileToWriteTo, "./ServiceBaseURL.csv", 1, 0, true, 1, 0)
// } else if URLsEqual(chplURL, tenzingURL) {
// TenzingURLWebscraper("https://tenzing.docs.apiary.io/#introduction/terms-and-conditions/fhir-endpoints", fileToWriteTo)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func DssIncWebscraper(CHPLURL string, fileToWriteTo string) {
doc.Find("#Api_Urls").Each(func(index int, tableElems *goquery.Selection) {
tableElems.Find("div").Each(func(index1 int, divElems *goquery.Selection) {
divElems.Find("p").Each(func(indextr int, phtml *goquery.Selection) {
if strings.HasPrefix(phtml.Text(), "The FHIR API Base URL") {
if strings.Contains(phtml.Text(), "API Base URL") {
aElems := phtml.Find("a")
if aElems.Length() > 0 {
hrefText, exists := aElems.Eq(0).Attr("href")
Expand Down
51 changes: 51 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/tenzingwebscraper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package chplendpointquerier

import (
"strings"

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

func TenzingURLWebscraper(chplURL string, fileToWriteTo string) {

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

fhirEndpointsHeaderElem := doc.Find("#introduction/terms-and-conditions/fhir-endpoints")
if fhirEndpointsHeaderElem.Length() > 0 {
spanElem := fhirEndpointsHeaderElem.Eq(0).Next()
spanElem.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 ") {
aElems := pElems.Find("a")
if aElems.Length() > 0 {
hrefText, exists := aElems.Eq(0).Attr("href")
if exists {
var entry LanternEntry

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

endpointEntryList.Endpoints = lanternEntryList

err = WriteCHPLFile(endpointEntryList, fileToWriteTo)
if err != nil {
log.Fatal(err)
}

}
Loading
Loading