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

Medicaid and Medicare list #370

Merged
merged 10 commits into from
Apr 23, 2024
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ lint:
make lint_R || exit $?

lint_go:
cd ./capabilityquerier; golangci-lint run -E gofmt --deadline=3m
cd ./lanternmq; golangci-lint run -E gofmt --deadline=3m
cd ./endpointmanager; golangci-lint run -E gofmt --deadline=3m
cd ./capabilityreceiver; golangci-lint run -E gofmt --deadline=3m
cd ./capabilityquerier; golangci-lint run -E gofmt --timeout=3m
cd ./lanternmq; golangci-lint run -E gofmt --timeout=3m
cd ./endpointmanager; golangci-lint run -E gofmt --timeout=3m
cd ./capabilityreceiver; golangci-lint run -E gofmt --timeout=3m

lint_R:
@cd ./scripts; chmod +rx lintr.sh; ./lintr.sh || exit 1
Expand Down
22 changes: 22 additions & 0 deletions endpointmanager/cmd/medicaidendpointquerier/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"os"

querier "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/medicaidendpointquerier"

log "github.com/sirupsen/logrus"
)

func main() {

var fileToWriteTo string

if len(os.Args) >= 1 {
fileToWriteTo = os.Args[1]
} else {
log.Fatalf("ERROR: Missing command-line arguments")
}

querier.QueryMedicaidEndpointList(fileToWriteTo)
}
22 changes: 22 additions & 0 deletions endpointmanager/cmd/medicareendpointquerier/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"os"

querier "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/medicareendpointquerier"

log "github.com/sirupsen/logrus"
)

func main() {

var fileToWriteTo string

if len(os.Args) >= 1 {
fileToWriteTo = os.Args[1]
} else {
log.Fatalf("ERROR: Missing command-line arguments")
}

querier.QueryMedicareEndpointList(fileToWriteTo)
}
24 changes: 10 additions & 14 deletions endpointmanager/pkg/chplendpointquerier/advancedmdwebscraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ func AdvancedMdWebscraper(chplURL string, fileToWriteTo string) {
log.Fatal(err)
}

doc.Find("p").Each(func(index int, pElem *goquery.Selection) {
spanElem := pElem.Find("span").First()
if strings.Contains(spanElem.Text(), "Production environment") {
aElem := pElem.Find("a").First()
hrefText, exists := aElem.Attr("href")
if exists {
var entry LanternEntry

entryURL := strings.TrimSpace(hrefText)
entry.URL = entryURL

lanternEntryList = append(lanternEntryList, entry)
}
}
doc.Find(".container").Each(func(index int, cElem *goquery.Selection) {
cElem.Find("p").Each(func(index int, pElem *goquery.Selection) {
spanElem := pElem.Find("span").First()
var entry LanternEntry

entryURL := strings.TrimSpace(spanElem.Text())
entry.URL = entryURL

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

endpointEntryList.Endpoints = lanternEntryList
Expand Down
47 changes: 47 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/aetnawebscraper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package chplendpointquerier

import (
"regexp"
"strings"

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

func AetnaURLWebscraper(CHPLURL string, fileToWriteTo string) {

var lanternEntryList []LanternEntry
var endpointEntryList EndpointList

doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".base-url")
if err != nil {
log.Fatal(err)
}
doc.Find("hgroup").Each(func(index int, hElems *goquery.Selection) {
doc.Find("pre").Each(func(index int, pElems *goquery.Selection) {
if strings.Contains(pElems.Text(), "Base URL:") {
re := regexp.MustCompile(`(?m)Base URL: (\S+)`)
// Find the submatches
matches := re.FindStringSubmatch(pElems.Text())
// Check if any matches were found
if len(matches) >= 2 {
url := matches[1]
url = "https://" + url + "/patientaccess"
var entry LanternEntry
entryURL := url
entry.URL = entryURL
lanternEntryList = append(lanternEntryList, entry)
}

}
})
})
endpointEntryList.Endpoints = lanternEntryList

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

}
2 changes: 0 additions & 2 deletions endpointmanager/pkg/chplendpointquerier/aidboxquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package chplendpointquerier

import (
"encoding/json"
"fmt"

"github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers"
log "github.com/sirupsen/logrus"
Expand All @@ -13,7 +12,6 @@ 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)
Expand Down
51 changes: 51 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/anthemparser.go
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 AntemOrganization struct {
Prefix string `json:"Prefix"`
SiteBase string `json:"SiteBase"`
EndPoint string `json:"EndPoint"`
Version string `json:"Version"`
EndPointType string `json:"EndPointType"`
LogoUrl string `json:"LogoUrl"`
Name string `json:"Name"`
}

func AnthemURLParser(willowURL string, fileToWriteTo string) {

var lanternEntryList []LanternEntry
var endpointEntryList EndpointList

respBody, err := helpers.QueryEndpointList(willowURL)
if err != nil {
log.Fatal(err)
}
var organizations []AntemOrganization

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

for _, org := range organizations {
var entry LanternEntry

entry.URL = org.EndPoint
entry.OrganizationName = org.Name

lanternEntryList = append(lanternEntryList, entry)
}

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

}
41 changes: 41 additions & 0 deletions endpointmanager/pkg/chplendpointquerier/centenewebscraper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package chplendpointquerier

import (
"strings"

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

func CenteneURLWebscraper(CHPLURL string, fileToWriteTo string) {

var lanternEntryList []LanternEntry
var endpointEntryList EndpointList

doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".apiDetails_item__1bp0n.MuiBox-root.css-1xdhyk6")
if err != nil {
log.Fatal(err)
}

doc.Find("div").Each(func(index int, divhtml *goquery.Selection) {
dElem := divhtml.Find("div")
if dElem.Length() > 1 {

if strings.Contains(dElem.Eq(0).Text(), "Production") && strings.Contains(dElem.Eq(1).Text(), "production") {
var entry LanternEntry
URL := strings.TrimSpace(dElem.Eq(1).Text())
entry.URL = URL
lanternEntryList = append(lanternEntryList, entry)
}
}
})

endpointEntryList.Endpoints = lanternEntryList

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

}
95 changes: 89 additions & 6 deletions endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ var qualifactsCredibleURL = "https://qualifacts.com/api-page/_downloads/credible
var medinfoengineeringURL = "https://docs.webchartnow.com/resources/system-specifications/fhir-application-programming-interface-api/endpoints/"
var relimedsolutionsURL = "https://help.relimedsolutions.com/fhir/fhir-service-urls.csv"
var eclinicalworksURL = "https://fhir.eclinicalworks.com/ecwopendev"
var integraconnectURL = "https://www.integraconnect.com/certifications/"

// No endpoint listed
// var integraconnectURL = "https://www.integraconnect.com/certifications/"
var streamlinemdURL = "https://patientportal.streamlinemd.com/FHIRReg/Practice%20Service%20based%20URL%20List.csv"
var bridgepatientportalURL = "https://bridgepatientportal.docs.apiary.io/#/introduction/fhir-bridge-patient-portal/fhir-endpoints"
var medicalmineURL = "https://www.charmhealth.com/resources/fhir/index.html#api-endpoints"
Expand Down Expand Up @@ -116,7 +118,8 @@ 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 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 @@ -154,6 +157,34 @@ var maximusURL = "https://documents.maximus.care"
var tenzingURL = "https://tenzing.docs.apiary.io/#introduction/fhir-endpoints"
var inpracsysURL = "https://inpracsys.com/fhir/"

// State Payer list
var atenaURL = "https://developerportal.aetna.com/fhirapis"
var centeneURL = "https://partners.centene.com/apiDetail/2718669d-6e2e-42b5-8c90-0a82f13a30ba"
var cignaURL = "https://developer.cigna.com/docs/service-apis/patient-access/implementation-guide#Implementation-Guide-Base-URL"
var anthemURL = "https://patient360.anthem.com/P360Member/fhir"

// var guidewellURL = "https://developer.bcbsfl.com/interop/interop-developer-portal/product/469/api/466#/PatientAccessAPI_105/overview"
// var hcscURL = "https://interoperability.hcsc.com/s/patient-access-api"
// var humanaURL = "https://developers.humana.com/patient-api/doc"
// var kaiserURL = "https://developer.kp.org/#/apis/639c015049655aa96ab5b2f1"
// var molinaURL = "https://developer.interop.molinahealthcare.com/api-details#api=patient-access&operation=5f72ab665269f310ef58b361"
var unitedHealthURL = "https://www.uhc.com/legal/interoperability-apis"
var meldrxURL = "https://app.meldrx.com/api/Directories/fhir/endpoints"
var emr4MDURL = "https://appstudio.interopengine.com/partner/fhirR4endpoints-mednetmedical.json"
var smartCareURL = "https://dhfhirpresentation.smartcarenet.com/"
var dssEmergencyURL = "https://dssjess-dev-web.dssinc.com"
var e11URL = "https://fhir.10e11.com/"
var practicegatewayURL = "https://fhir.practicegateway.net/smart/Endpoint?_format=application/json"
var procentiveFhirURL = "https://fhir.procentive.com/"
var fhirDssjunoURL = "https://fhirjuno-prod-web.dssinc.com"
var officeallyURL = "https://fhirpt.officeally.com/"
var epicURL = "https://open.epic.com/Endpoints/R4"
var qualifactsURL = "https://qualifacts.com/api-page/_downloads/carelogic-fhir-org-list.json"
var myeyecarerecordsURL = "https://smartonfhir.myeyecarerecords.com/fhir/Endpoint?_format=application/fhir+json&status=active"
var nextgenAPIURL = "https://www.nextgen.com/patient-access-api"
var sabiamedURL = "https://www.sabiamed.com/api-endpoints"
var zoommdURL = "https://www.zoommd.com/zoommd-file-api-endpoints"

func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {

if URLsEqual(chplURL, MedHostURL) {
Expand Down Expand Up @@ -226,8 +257,8 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
CSVParser(chplURL, fileToWriteTo, "./fhir_service_urls.csv", 1, 3, true, 1, -1)
} else if URLsEqual(chplURL, eclinicalworksURL) {
eClinicalWorksBundleParser("https://fhir.eclinicalworks.com/ecwopendev/external/practiceList", fileToWriteTo)
} else if URLsEqual(chplURL, integraconnectURL) {
IntegraConnectWebscraper(chplURL, fileToWriteTo)
// } else if URLsEqual(chplURL, integraconnectURL) {
// IntegraConnectWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, streamlinemdURL) {
StreamlineMDCSVParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, bridgepatientportalURL) {
Expand Down Expand Up @@ -372,8 +403,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) {
// BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, medConnectURL) {
BundleQuerierParser(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, citiusTechURL) {
Expand Down Expand Up @@ -432,6 +463,58 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) {
BundleQuerierParser("https://dynamicfhirpresentation.dynamicfhirsandbox.com/fhir/r4/endpoints", fileToWriteTo)
} else if URLsEqual(chplURL, veradigmURL) {
BundleQuerierParser("https://open.platform.veradigm.com/fhirendpoints/download/R4", fileToWriteTo)
} else if URLsEqual(chplURL, meldrxURL) {
BundleQuerierParser(meldrxURL, fileToWriteTo)
} else if URLsEqual(chplURL, emr4MDURL) {
BundleQuerierParser(emr4MDURL, fileToWriteTo)
} else if URLsEqual(chplURL, smartCareURL) {
BundleQuerierParser(smartCareURL, fileToWriteTo)
} else if URLsEqual(chplURL, dssEmergencyURL) {
BundleQuerierParser(dssEmergencyURL, fileToWriteTo)
} else if URLsEqual(chplURL, e11URL) {
BundleQuerierParser(e11URL, fileToWriteTo)
} else if URLsEqual(chplURL, practicegatewayURL) {
BundleQuerierParser(practicegatewayURL, fileToWriteTo)
} else if URLsEqual(chplURL, procentiveFhirURL) {
BundleQuerierParser(procentiveFhirURL, fileToWriteTo)
} else if URLsEqual(chplURL, fhirDssjunoURL) {
BundleQuerierParser(fhirDssjunoURL, fileToWriteTo)
} else if URLsEqual(chplURL, officeallyURL) {
BundleQuerierParser(officeallyURL, fileToWriteTo)
} else if URLsEqual(chplURL, epicURL) {
BundleQuerierParser(epicURL, fileToWriteTo)
} else if URLsEqual(chplURL, myeyecarerecordsURL) {
BundleQuerierParser(myeyecarerecordsURL, fileToWriteTo)
} else if URLsEqual(chplURL, sabiamedURL) {
BundleQuerierParser(sabiamedURL, fileToWriteTo)
} else if URLsEqual(chplURL, myeyecarerecordsURL) {
BundleQuerierParser(myeyecarerecordsURL, fileToWriteTo)
} else if URLsEqual(chplURL, zoommdURL) {
ZoomMDCSVParser("https://www.zoommd.com/FHIRServerURLs_ZoomMD.csv", fileToWriteTo)
} else if URLsEqual(chplURL, qualifactsURL) {
QualifactsWebscraper(qualifactsURL, fileToWriteTo)
} else if URLsEqual(chplURL, nextgenAPIURL) {
NextgenAPIWebscraper(nextgenAPIURL, fileToWriteTo)
} else if URLsEqual(chplURL, atenaURL) {
AetnaURLWebscraper("https://developerportal.aetna.com/fhir/apis/swagger/_v2_patientaccess_Binary_%7Bid%7D.yaml", fileToWriteTo)
} else if URLsEqual(chplURL, centeneURL) {
CenteneURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, cignaURL) {
CignaURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, anthemURL) {
AnthemURLParser("https://patient360.anthem.com/P360Member/fhir/endpoints", fileToWriteTo)
// } else if URLsEqual(chplURL, guidewellURL) {
// GuidewellURLWebscraper(chplURL, fileToWriteTo)
// } else if URLsEqual(chplURL, hcscURL) {
// HcscURLWebscraper(chplURL, fileToWriteTo)
// } else if URLsEqual(chplURL, humanaURL) {
// HumanaURLWebscraper(chplURL, fileToWriteTo)
//} else if URLsEqual(chplURL, kaiserURL) {
//KaiserURLWebscraper(chplURL, fileToWriteTo)
// } else if URLsEqual(chplURL, molinaURL) {
// MolinaURLWebscraper(chplURL, fileToWriteTo)
} else if URLsEqual(chplURL, unitedHealthURL) {
UnitedHealthURLWebscraper(chplURL, fileToWriteTo)
}
}

Expand Down
Loading
Loading