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

Adding Oct endpoints #366

Merged
merged 1 commit into from
Nov 8, 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
48 changes: 48 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/canvasmedicalwebscraper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package chplendpointquerier

import (
"strings"

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

func CanvasMedicalURLWebscraper(CHPLURL string, fileToWriteTo string) {

var lanternEntryList []LanternEntry
var endpointEntryList EndpointList

doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, "")
if err != nil {
log.Fatal(err)
}

doc.Find("table").Each(func(index int, tablehtml *goquery.Selection) {
if index == 1 {
tablehtml.Find("tbody").Each(func(indextr int, rowhtml *goquery.Selection) {
rowhtml.Find("tr").Each(func(indextr int, rowbodyhtml *goquery.Selection) {
var entry LanternEntry
tableEntries := rowbodyhtml.Find("td")
if tableEntries.Length() > 0 {
organizationName := strings.TrimSpace(tableEntries.Eq(0).Text())
URL := strings.TrimSpace(tableEntries.Eq(1).Text())

entry.OrganizationName = organizationName
entry.URL = URL

lanternEntryList = append(lanternEntryList, entry)
}
})
})
}
})

endpointEntryList.Endpoints = lanternEntryList

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

}
13 changes: 9 additions & 4 deletions endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ var healthInnovationURL = "https://revolutionehrdev.dynamicfhir.com/fhir/r4/endp
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"
var CarepathsURL = "https://carepaths.com/uploads/org_endpoint_bundle.json"
var athenaClinicalsURL = "https://docs.athenahealth.com/api/guides/base-fhir-urls"
var canvasMedicalURL = "https://docs.canvasmedical.com/api/service-base-urls/"

func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {

Expand Down Expand Up @@ -273,6 +274,8 @@ 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, 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, medicscloudURL) {
MedicsCloudWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, advancedmdURL) {
Expand Down Expand Up @@ -371,14 +374,16 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, healthInnovationURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, CarepathsURL) {
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)
} else if URLsEqual(chplURL, canvasMedicalURL) {
CanvasMedicalURLWebscraper(chplURL, fileToWriteTo)
}
}

Expand Down
2 changes: 2 additions & 0 deletions endpointmanager/pkg/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ func QueryAndOpenCSV(csvURL string, csvFilePath string, header bool) (*csv.Reade

// read csv values using csv.Reader
csvReader := csv.NewReader(f)
csvReader.Comma = ',' // Set the delimiter (default is ',')
csvReader.LazyQuotes = true // Enable handling of lazy quotes

if header {
// Read first line to skip over headers
Expand Down
64 changes: 64 additions & 0 deletions resources/dev_resources/AthenaClinicals_EndpointSources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"Endpoints": [
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "NC - Sollus Pediatrics",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "KY - Scott \u0026 Jonah Mds",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "First Physicians",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "TX - Trophy Club Pediatrics, PA",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "MA - The Sharewood Project",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "GA - Contemporary Women's Healthcare",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "WA - Dr. Stephen B. Hillis, MD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "FL - Margarita M Vendrell MD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "Boca Integrative Health",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://api.platform.athenahealth.com/fhir/r4",
"OrganizationName": "Center for Emotional Wellness at RPCA",
"NPIID": "",
"OrganizationZipCode": ""
}
]
}
10 changes: 10 additions & 0 deletions resources/dev_resources/CanvasMedical_EndpointSources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Endpoints": [
{
"URL": "https://fumage-modernfamilypractice.canvasmedical.com",
"OrganizationName": "modernfamilypractice",
"NPIID": "",
"OrganizationZipCode": ""
}
]
}
64 changes: 64 additions & 0 deletions resources/dev_resources/Carepaths_EHR_EndpointSources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"Endpoints": [
{
"URL": "http://developer.carepaths.com/beauchene/api/",
"OrganizationName": "Beauchene Family Therapy LLC",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/qcounseling/api/",
"OrganizationName": "Q Counseling Services",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/1390898-152525/api/",
"OrganizationName": "Kristen O'Shea, PhD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/salt/api/",
"OrganizationName": "Salt and Light Counseling",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/frcc/api/",
"OrganizationName": "Firmly Rooted Counseling \u0026 Consulting",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/rochford/api/",
"OrganizationName": "Lisa Rochford, PhD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/pacificsky/api/",
"OrganizationName": "Pacific Sky Counseling",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/yelk/api/",
"OrganizationName": "Dawn L. Yelk, LCSW",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/scl/api/",
"OrganizationName": "Sharon Chatkupt Lee, Psy.D.",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "http://developer.carepaths.com/1385102-145752/api/",
"OrganizationName": "Embrace Life Counseling",
"NPIID": "",
"OrganizationZipCode": ""
}
]
}
Loading
Loading