Skip to content

Commit

Permalink
Fixes for endpoint errors, skip NPPES
Browse files Browse the repository at this point in the history
  • Loading branch information
svginc committed Jan 24, 2024
1 parent 4238b66 commit 1712803
Show file tree
Hide file tree
Showing 47 changed files with 133,417 additions and 115,876 deletions.
2 changes: 1 addition & 1 deletion api/download/downloadsmodule.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ download_data <- function(db_tables) {
rename(api_information_source_name = endpoint_names, certified_api_developer_name = vendor_name) %>%
rename(created_at = info_created, updated = info_updated) %>%
rename(http_response_time_second = response_time_seconds)
write.csv(csvdata, file, row.names = FALSE)
#write.csv(csvdata, file, row.names = FALSE)
}
27 changes: 19 additions & 8 deletions capabilityreceiver/pkg/capabilityhandler/supportedProfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,27 @@ func getCapabilityStatementProfiles(capInt map[string]interface{}, supportedProf
}

if resourceInt["supportedProfile"] != nil {
supportedProfileArr := resourceInt["supportedProfile"].([]interface{})
for _, profileEntry := range supportedProfileArr {
profileURL := profileEntry.(string)
var profileInfo endpointmanager.SupportedProfile
profileInfo.ProfileURL = profileURL
profileInfo.Resource = resourceType

supportedProfiles = append(supportedProfiles, profileInfo)
supportedProfileArr, ok := resourceInt["supportedProfile"].([]interface{})
if !ok {
// Handle the case where "supportedProfile" is not a []interface{}
//fmt.Println("Error: 'supportedProfile' is not a []interface{}")
// Add appropriate error handling or return from the function
}

for _, profileEntry := range supportedProfileArr {
// Check if profileEntry is a string
if profileURL, ok := profileEntry.(string); ok {
var profileInfo endpointmanager.SupportedProfile
profileInfo.ProfileURL = profileURL
profileInfo.Resource = resourceType

supportedProfiles = append(supportedProfiles, profileInfo)
} else {
// Handle the case where profileEntry is not a string
//fmt.Println("Error: 'supportedProfile' entry is not a string")
// Add appropriate error handling or return from the function
}
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion endpointmanager/cmd/CHPLpopulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ func main() {
var chplJSON CHPLEndpointList
err = json.Unmarshal(respBody, &chplJSON)
if err != nil {
log.Fatal(err)
//log.Fatal(err)
continue
}

if savedEntries >= chplJSON.RecordCount {
Expand Down
29 changes: 11 additions & 18 deletions endpointmanager/pkg/chplendpointquerier/NextGenwebscraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,23 @@ func NextGenwebscraper(CHPLURL string, fileToWriteTo string) {

var lanternEntryList []LanternEntry
var endpointEntryList EndpointList

doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".api-search-result")
doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, "#api-search-results")
if err != nil {
log.Fatal(err)
}

doc.Find("table").Each(func(index int, tablehtml *goquery.Selection) {
tablehtml.Find("tbody").Each(func(indextr int, rowhtml *goquery.Selection) {
rowhtml.Find("tr").Each(func(indextr int, rowbodyhtml *goquery.Selection) {
doc.Find("#api-search-results").Each(func(index int, div1html *goquery.Selection) {
div2html := div1html.Find("div").First()
ulhtml := div2html.Find("ul").First()
ulhtml.Find("li").Each(func(indextr int, lihtml *goquery.Selection) {
if strings.Contains(lihtml.Text(), "DSTU2") || strings.Contains(lihtml.Text(), "FHIR R4") {
var litext = lihtml.Text()
var URL = litext[strings.Index(litext, " https")+1 : len(litext)-1]
var entry LanternEntry
entry.URL = strings.TrimSpace(URL)

tableEntries := rowbodyhtml.Find("td")
if tableEntries.Length() > 0 {
organizationName := strings.TrimSpace(tableEntries.Eq(1).Text())
zipCode := strings.TrimSpace(tableEntries.Eq(5).Text())
URL := strings.TrimSpace(tableEntries.Eq(6).Text())

entry.OrganizationName = organizationName
entry.URL = URL
entry.OrganizationZipCode = zipCode

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

Expand Down
3 changes: 3 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/bundleparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func BundleToLanternFormat(bundle []byte) []LanternEntry {
var entry LanternEntry

if strings.EqualFold(strings.TrimSpace(bundleEntry.Resource.ResourceType), "Endpoint") {
if bundleEntry.Resource.Address == nil {
continue
}
entryURL := bundleEntry.Resource.Address.(string)
// Do not add entries that do not have URLs
if entryURL != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type LanternEntry struct {
}

var MedHostURL = "https://api.mhdi10xasayd.com/medhost-developer-composition/v1/fhir-base-urls.json"
var NextGenURL = "https://nextgen.com/api/practice-search/"
var NextGenURL = "https://nextgen.com/api/practice-search"
var CanvasURL = "https://docs.canvasmedical.com/reference/service-base-urls"
var AlteraURL = "https://open.allscripts.com/fhirendpoints"
var EpicURL = "https://open.epic.com/MyApps/Endpoints"
Expand All @@ -43,7 +43,6 @@ var healthCare2000URL = "https://www.provider.care/FHIR/MDVitaFHIRUrls.csv"
var firstInsightURL = "https://www.first-insight.com/maximeyes_fhir_base_url_endpoints/"
var healthSamuraiURL = "https://cmpl.aidbox.app/smart"
var triarqURL = "https://fhir.myqone.com/Endpoints"
var goldblattURL = "https://www.goldblattsystems.com/apis"
var cyfluentURL = "https://app.swaggerhub.com/apis-docs/Cyfluent/ProviderPortalApi/3.3#/FHIR/fhir"
var meridianURL = "https://api-datamanager.carecloud.com:8081/fhirurl"
var qualifactsInsyncURL = "https://qualifacts.com/api-page/platform/insync/insync-fhir-org-list.html"
Expand Down Expand Up @@ -192,11 +191,9 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
} else if URLsEqual(chplURL, firstInsightURL) {
FirstInsightBundleParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, healthSamuraiURL) {
HealthSamuraiWebscraper(chplURL, fileToWriteTo)
HealthSamuraiWebscraper("https://smartbox.aidbox.app/service-base-urls", fileToWriteTo)
} else if URLsEqual(chplURL, triarqURL) {
TRIARQPracticeWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, goldblattURL) {
BundleQuerierParser("https://fhir-test.csn.health/gs-fhir-domain-server/public-base-service-endpoints.json", fileToWriteTo)
} else if URLsEqual(chplURL, cyfluentURL) {
SwaggerUIWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, meridianURL) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
"Endpoints": [
{
"URL": "https://fhir.colaneph.com/fhir",
"OrganizationName": "Columbia Nephrology Associates",
"URL": "https://AH1SCM2FHIR.altahospitals.com/fhir",
"OrganizationName": "Alta Hospitals System - ALTA_SCM_PROD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://fhir.colaneph.com/R4/fhir-R4",
"OrganizationName": "Columbia Nephrology Associates",
"URL": "https://AH1SCM2FHIR.altahospitals.com/R2/fhir",
"OrganizationName": "Alta Hospitals System - ALTA_SCM_PROD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://fhir.colaneph.com/open",
"OrganizationName": "Columbia Nephrology Associates",
"URL": "https://AH1SCM2FHIR.altahospitals.com/R2/open",
"OrganizationName": "Alta Hospitals System - ALTA_SCM_PROD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://fhir.colaneph.com/R4/open-R4",
"OrganizationName": "Columbia Nephrology Associates",
"URL": "https://AH1SCM2FHIR.altahospitals.com/open",
"OrganizationName": "Alta Hospitals System - ALTA_SCM_PROD",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://fhirprod.whs.org/R4/fhir-Prod",
"OrganizationName": "Washington Health System - WH01",
"URL": "https://fhirprod.atlanticgeneral.org/open",
"OrganizationName": "Atlantic General Hospital - AG01",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://fhirprod.whs.org/open",
"OrganizationName": "Washington Health System - WH01",
"URL": "https://fhirprod.atlanticgeneral.org/R2/fhir",
"OrganizationName": "Atlantic General Hospital - AG01",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://fhirprod.whs.org/R4/open-Prod",
"OrganizationName": "Washington Health System - WH01",
"URL": "https://fhirprod.atlanticgeneral.org/R2/open",
"OrganizationName": "Atlantic General Hospital - AG01",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://fhirprod.whs.org/fhir",
"OrganizationName": "Washington Health System - WH01",
"URL": "https://fhirprod.atlanticgeneral.org/fhir",
"OrganizationName": "Atlantic General Hospital - AG01",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://sunexch.cmc-nh.org/R4/fhir-Prod",
"OrganizationName": "Catholic Medical Center - PRODUCTION",
"URL": "https://fhir.blessinghospital.com/R2/fhir",
"OrganizationName": "Blessing Hospital - PROD1",
"NPIID": "",
"OrganizationZipCode": ""
},
{
"URL": "https://sunexch.cmc-nh.org/R4/open-Prod",
"OrganizationName": "Catholic Medical Center - PRODUCTION",
"URL": "https://fhir.blessinghospital.com/R2/open",
"OrganizationName": "Blessing Hospital - PROD1",
"NPIID": "",
"OrganizationZipCode": ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
"URL": "https://appcert.api.playground.bridgepatientportal.com/fhir/r4/",
"OrganizationName": "",
"NPIID": ""
"NPIID": "",
"OrganizationZipCode": ""
}
]
}
Loading

0 comments on commit 1712803

Please sign in to comment.