Skip to content

Commit

Permalink
Merge pull request #392 from onc-healthit/LANTERN-577-HealthSamuraiWe…
Browse files Browse the repository at this point in the history
…bscraper

LANTERN-577, LANTERN-581: Modified HealthSamurai and Healthie webscrapers
  • Loading branch information
vishnu-mettles authored Sep 10, 2024
2 parents ed1cb49 + c786dc0 commit dea9e38
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ 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 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"
Expand Down Expand Up @@ -244,7 +244,7 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
} else if URLsEqual(chplURL, firstInsightURL) {
FirstInsightBundleParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, healthSamuraiURL) {
HealthSamuraiWebscraper("https://smartbox.aidbox.app/service-base-urls", fileToWriteTo)
CustomBundleQuerierParser("https://smartbox.aidbox.app/service-base-urls", fileToWriteTo)
} else if URLsEqual(chplURL, triarqURL) {
TRIARQPracticeWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, cyfluentURL) {
Expand Down Expand Up @@ -407,8 +407,8 @@ 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, healthieURL) {
CustomBundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, medConnectURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, citiusTechURL) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package chplendpointquerier

import (
"encoding/json"

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

type CustomBundle struct {
Entries []CustomBundleEntry `json:"entry"`
}

type CustomBundleEntry struct {
Id string `json:"id"`
Name string `json:"name"`
Url string `json:"url"`
}

func CustomBundleQuerierParser(CHPLURL string, fileToWriteTo string) {

var entry LanternEntry
var lanternEntryList []LanternEntry
var endpointEntryList EndpointList

respBody, err := helpers.QueryEndpointList(CHPLURL)
if err != nil {
log.Fatal(err)
}

var customBundle CustomBundle
err = json.Unmarshal(respBody, &customBundle)
if err != nil {
log.Fatal(err)
}

for _, bundleEntry := range customBundle.Entries {
entry.URL = bundleEntry.Url
entry.OrganizationName = bundleEntry.Name

lanternEntryList = append(lanternEntryList, entry)
}

endpointEntryList.Endpoints = lanternEntryList

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

}
45 changes: 0 additions & 45 deletions endpointmanager/pkg/chplendpointquerier/healthsamuraiparser.go

This file was deleted.

0 comments on commit dea9e38

Please sign in to comment.