From 659b4b9eb246cb1bdd0bf065a47758d34dcacfb6 Mon Sep 17 00:00:00 2001 From: daedalus-s Date: Tue, 21 Jan 2025 15:26:19 -0500 Subject: [PATCH] Removed Deprecated source URL web scrapers --- .../allegiancemdwebscraper.go | 40 ---------- .../pkg/chplendpointquerier/alteraquerier.go | 32 -------- .../pkg/chplendpointquerier/athenaparser.go | 57 ------------- .../chplendpointquerier/canvaswebscraper.go | 48 ----------- .../chplendpointquerier/cernerBundleParser.go | 34 -------- .../chplendpointquerier.go | 80 +------------------ .../eclinicalworksquerier.go | 34 -------- .../emedpracticewebscraper.go | 67 ---------------- .../escribehostwebscraper.go | 49 ------------ .../chplendpointquerier/ethizowebscraper.go | 48 ----------- .../indianhealthwebscraper.go | 59 -------------- .../chplendpointquerier/kodjinwebscraper.go | 47 ----------- .../magilenenterpriseswebscraper.go | 64 --------------- .../chplendpointquerier/maximuswebscraper.go | 49 ------------ .../pkg/chplendpointquerier/medhostquerier.go | 56 ------------- .../nextgenapiIwebscraper.go | 53 ------------ .../novomedicwebscraper.go | 58 -------------- 17 files changed, 4 insertions(+), 871 deletions(-) delete mode 100644 endpointmanager/pkg/chplendpointquerier/allegiancemdwebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/alteraquerier.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/athenaparser.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/canvaswebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/cernerBundleParser.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/eclinicalworksquerier.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/emedpracticewebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/escribehostwebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/ethizowebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/indianhealthwebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/kodjinwebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/magilenenterpriseswebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/maximuswebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/medhostquerier.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/nextgenapiIwebscraper.go delete mode 100644 endpointmanager/pkg/chplendpointquerier/novomedicwebscraper.go diff --git a/endpointmanager/pkg/chplendpointquerier/allegiancemdwebscraper.go b/endpointmanager/pkg/chplendpointquerier/allegiancemdwebscraper.go deleted file mode 100644 index f0421dbcc..000000000 --- a/endpointmanager/pkg/chplendpointquerier/allegiancemdwebscraper.go +++ /dev/null @@ -1,40 +0,0 @@ -package chplendpointquerier - -import ( - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" - "strings" -) - -func AllegianceMDWebscraper(chplURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(chplURL, ".banner2_value") - - if err != nil { - log.Fatal(err) - } - doc.Each(func(index int, pElem *goquery.Selection) { - 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) - } - }) - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/alteraquerier.go b/endpointmanager/pkg/chplendpointquerier/alteraquerier.go deleted file mode 100644 index 90926ba3c..000000000 --- a/endpointmanager/pkg/chplendpointquerier/alteraquerier.go +++ /dev/null @@ -1,32 +0,0 @@ -package chplendpointquerier - -import ( - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func AlteraQuerier(chplURL string, fileToWriteTo string) { - DSTU2URL := chplURL + "/download/DSTU2" - R4URL := chplURL + "/download/R4" - - var endpointEntryList EndpointList - - respBody, err := helpers.QueryEndpointList(DSTU2URL) - if err != nil { - log.Fatal(err) - } - - endpointEntryList.Endpoints = BundleToLanternFormat(respBody) - - respBody, err = helpers.QueryEndpointList(R4URL) - if err != nil { - log.Fatal(err) - } - - endpointEntryList.Endpoints = append(endpointEntryList.Endpoints, BundleToLanternFormat(respBody)...) - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } -} diff --git a/endpointmanager/pkg/chplendpointquerier/athenaparser.go b/endpointmanager/pkg/chplendpointquerier/athenaparser.go deleted file mode 100644 index 9a9074a8e..000000000 --- a/endpointmanager/pkg/chplendpointquerier/athenaparser.go +++ /dev/null @@ -1,57 +0,0 @@ -package chplendpointquerier - -import ( - "io" - "strings" - - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - - "os" - - log "github.com/sirupsen/logrus" -) - -func AthenaCSVParser(CHPLURL string, fileToWriteTo string) { - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - csvFilePath := "./athenanet-fhir-base-urls.csv" - - csvReader, file, err := helpers.QueryAndOpenCSV(CHPLURL, csvFilePath, true) - if err != nil { - log.Fatal(err) - } - defer file.Close() - - for { - rec, err := csvReader.Read() - if err == io.EOF { - break - } - if err != nil { - log.Fatal(err) - } - - var entry LanternEntry - - organizationName := strings.TrimSpace(rec[1]) - URL := strings.TrimSpace(rec[3]) - - entry.OrganizationName = organizationName - entry.URL = URL - - lanternEntryList = append(lanternEntryList, entry) - } - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - - err = os.Remove(csvFilePath) - if err != nil { - log.Fatal(err) - } -} diff --git a/endpointmanager/pkg/chplendpointquerier/canvaswebscraper.go b/endpointmanager/pkg/chplendpointquerier/canvaswebscraper.go deleted file mode 100644 index 4263bea0e..000000000 --- a/endpointmanager/pkg/chplendpointquerier/canvaswebscraper.go +++ /dev/null @@ -1,48 +0,0 @@ -package chplendpointquerier - -import ( - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func Canvaswebscraper(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) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/cernerBundleParser.go b/endpointmanager/pkg/chplendpointquerier/cernerBundleParser.go deleted file mode 100644 index 5c48b3748..000000000 --- a/endpointmanager/pkg/chplendpointquerier/cernerBundleParser.go +++ /dev/null @@ -1,34 +0,0 @@ -package chplendpointquerier - -import ( - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func CernerBundleParser(CHPLURL string, fileToWriteTo string) { - - milleniumR4URL := "https://raw.githubusercontent.com/cerner/ignite-endpoints/main/millennium_patient_r4_endpoints.json" - milleniumDSTU2URL := "https://raw.githubusercontent.com/cerner/ignite-endpoints/main/millennium_patient_dstu2_endpoints.json" - - var endpointEntryList EndpointList - - respBody, err := helpers.QueryEndpointList(milleniumR4URL) - if err != nil { - log.Fatal(err) - } - - // convert bundle data to lantern format - endpointEntryList.Endpoints = BundleToLanternFormat(respBody) - - respBody, err = helpers.QueryEndpointList(milleniumDSTU2URL) - if err != nil { - log.Fatal(err) - } - - endpointEntryList.Endpoints = append(endpointEntryList.Endpoints, BundleToLanternFormat(respBody)...) - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } -} diff --git a/endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go b/endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go index 245a66d9b..7da41449c 100644 --- a/endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go +++ b/endpointmanager/pkg/chplendpointquerier/chplendpointquerier.go @@ -19,26 +19,19 @@ type LanternEntry struct { OrganizationZipCode string `json:"OrganizationZipCode"` } -var MedHostURL = "https://api.mhdi10xasayd.com/medhost-developer-composition/v1/fhir-base-urls.json" 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" var MeditechURL = "https://fhir.meditech.com/explorer/endpoints" -var DocsAthenaURL = "https://docs.athenahealth.com/api/base-fhir-urls" var MyDataAthenaURL = "https://mydata.athenahealth.com/home" var OneMedicalURL = "https://apidocs.onemedical.io/fhir/overview/" var unifyURL = "https://unify-developer.chbase.com/?page=FHIRAPI" var trimedtechURL = "https://www.trimedtech.com/Documentation/FHIRAPI/FHIRAPI.html" var trimedtechv8URL = "https://www.trimedtech.com/Documentation/FHIRAPI/V8FHIRAPI.html" -var cernerGitHubURL = "https://github.com/cerner/ignite-endpoints" -var cernerSoarianR4URL = "https://github.com/cerner/ignite-endpoints/blob/main/soarian_patient_r4_endpoints.json" // var techCareURL = "https://devportal.techcareehr.com/Serviceurls" var carefluenceURL = "https://carefluence.com/carefluence-fhir-endpoints/" var practiceSuiteURL = "https://academy.practicesuite.com/fhir-server-links/" var bizmaticsURL = "https://prognocis.com/fhir/index.html" -var indianHealthServiceURL = "https://www.ihs.gov/cis/" var geniusSolutionsURL = "http://www.media.geniussolutions.com/ehrTHOMAS/ehrWebApi/Help/html/ServiceUrl.html" var assureCareURL = "https://ipatientcare.com/onc-acb-certified-2015-edition/" var intelichartURL = "https://fhirtest.intelichart.com/Help/BaseUrl" @@ -52,20 +45,17 @@ var qualifactsInsyncURL = "https://qualifacts.com/api-page/platform/insync/insyn var qualifactsCredibleURL = "https://qualifacts.com/api-page/_downloads/credible-fhir-org-list.json" 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/external/practiceList" var integraconnectURL = "https://portal.minerva.integracloud.com/minerva/fhir/r4/us-core/bundle" 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" var microfourURL = "https://oauth.patientwebportal.com/Fhir/Documentation#serviceBaseUrls" -var magilenenterprisesURL = "https://www.qsmartcare.com/api-documentation.html" var interopxURL = "https://demo.interopx.com/ix-auth-server/#/endpoints" var mphrxURL = "https://www.mphrx.com/fhir-service-base-url-directory/" var varianmedicalURL = "https://varian.dynamicfhir.com/" var caretrackerURL = "https://hag-fhir.amazingcharts.com/ac/endpoints" var zhhealthcareURL = "https://blueehr.com/fhir-urls/" -var emedpracticeURL = "https://emedpractice.com/fhir/fhirhelpdocument.html" 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/" @@ -85,14 +75,11 @@ var webedoctorURL = "https://www.webedoctor.com/docs/fhir-base-urls.csv" var medicscloudURL = "https://staging.medicscloud.com/MCExtAPI/FHIRMedicsCloud.htm" var advancedmdURL = "https://developer.advancedmd.com/fhir/base-urls" var agasthaURL = "http://agastha.com/production-links.html" -var allegiancemdURL = "https://fhir.allegiancemd.io/R4/" var elationURL = "https://elationfhir.readme.io/reference/service-base-urls" var betterdayhealthURL = "https://betterdayhealth.net/fhir-docs" var carecloudURL = "https://api-datamanager.carecloud.com/" -var ethizoURL = "https://fhir-api.ethizo.com/#55b1b3d2-fd9a-4afa-8d17-5bf78943702d" var hmsfirstURL = "https://fhir-api.hmsfirst.com/r4/EndPoints" var praxisemrURL = "https://www.praxisemr.com/applicationaccess/api/help/" -var escribeHOSTURL = "https://ehr.escribe.com/ehr/api/fhir/swagger-ui/" var mdlogicEHRURL = "https://www.mdlogic.com/solutions/standard-api-documentation" var altheaURL = "https://altheafhir.mdsynergy.com" var webchartnowURL = "https://docs.webchartnow.com/resources/system-specifications/fhir-application-programming-interface-api/endpoints/" @@ -108,7 +95,6 @@ var pcesystemsURL = "https://www.pcesystems.com/g10APIInfo.html" var medicsdaextURL = "https://staging.medicscloud.com/MedicsDAExtAPI/FHIRMedicsDocAssistant.htm" var azaleahealthr4URL = "https://app.azaleahealth.com/fhir/R4/Endpoint" var dssincURL = "https://dssjuno-dev-web.dssinc.com/dss/01ho/r4/Home/ApiDocumentation#Api_Urls" -var kodjinURL = "https://docs.kodjin.com/service-base-urls" var firelyURL = "https://docs.fire.ly/projects/Firely-Server/en/latest/_static/g10/EndpointBundleFirely.json" var azurewebsitesURL = "https://sfp-proxy9794.azurewebsites.net/fhir/base-url" var viewmymedURL = "https://portal.viewmymed.com/fhir/Endpoint" @@ -117,19 +103,15 @@ var imedemrURL2 = "https://icom.imedemr.com/icom50/html/emr/mvc/pages/fhir_endpo var moyaeURL = "https://documenter.getpostman.com/view/15917486/UyxojQMd#a24aa40c-fe15-478e-a555-3c2cb10d56c9" var myheloURL = "https://www.myhelo.com/api/" 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" @@ -145,7 +127,6 @@ var officePracticumURL = "https://fhir-documentation.patientmedrecords.com/endpo var modernizingMedicineURL = "https://mm-fhir-endpoint-display.prod.fhir.ema-api.com/" var welligentURL = "https://fhir.qa.welligent.com/" var willowURL = "https://www.willowgladetechnologies.com/requirements" -var aidboxURL = "https://aidbox.cx360.net/service-base-urls" var medicaURL = "https://code.medicasoft.us/fhir_r4_endpoints.html" var dss2URL = "https://dssjess-dev-web.dssinc.com/fhir/r4/endpoints" var cozevaURL = "https://fhir.cozeva.com/endpoints" @@ -154,9 +135,7 @@ var hcsincURL = "https://hcswebportal.corporate.hcsinc.net/HCSClinicals_FHIR/api var greenwayURL = "https://developers.greenwayhealth.com/developer-platform/page/fhir-base-urls" var snfistURL = "https://fhir.thesnfist.com/endpointlist" var criterionsURL = "https://criterions.com/fhir-end-points/" -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" @@ -184,7 +163,6 @@ 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" var footholdURL = "https://fhir.footholdtechnology.com/demodb/endpoints" @@ -201,14 +179,14 @@ var fhirptURL = "https://fhirpt-stage.officeally.com/fhir/r4/endpoints" var chntechURL = "https://onc.chntechsolutions.com/ic-ehr-fhir-api/" var zoobooksystemsURL = "https://zoobooksystems.com/api-documentation/" -var bundleQuerierArray = [30]string{"https://ac-fhir.harrisambulatory.com/endpoints/r4", "https://dynamicfhirpresentation.dynamicfhirsandbox.com/fhir/r4/endpoints", +var bundleQuerierArray = [30]string{"https://ac-fhir.harrisambulatory.com/endpoints/r4", "https://ct-fhir.harrisambulatory.com/Endpoints/R4", "https://kantime.com/wp-content/uploads/2024/03/fhir-base-urls.json", "https://api.mhdi10xasayd.com/medhost-developer-composition/v1/fhir-base-service-url-bundle", "https://bill.medgenehr.com/MedgenAPI/medgenbundle.json", "https://fhirpresentation.assertus.com/fhir/r4/endpoints", "https://www.medplum.com/onc/base.json", "https://raw.githubusercontent.com/oracle-samples/ignite-endpoints/main/millennium_patient_r4_endpoints.json", "https://mmdpcf.modulemd.com/cf.fhir.r4/ServiceBaseURL.json", "https://smartserver.novoclinical.com/.well-known/bundle", "https://fhir.prod.flatiron.io/fhir", "https://public-files.oystehr.com/endpoint.json", - "https://fhirpresentation.pcsdataxchg.com/fhir/r4/endpoints", "https://pic-fhir.harrisambulatory.com/endpoints/r4", "https://pul-fhir.harrisambulatory.com/endpoints/r4", "https://fhir.qsmartcare.com:8000", + "https://fhirpresentation.pcsdataxchg.com/fhir/r4/endpoints", "https://pul-fhir.harrisambulatory.com/endpoints/r4", "https://fhir.qsmartcare.com:8000", "https://appstudio.interopengine.com/partner/fhirR4endpoints-umc.json", "https://testauth.strateqhealth.com/SmartOnFHIR/ValidURLs.json", - "https://fhir.ethizo.com/api/4.0.0/service_based_url", "https://fhir.maximus.care/api/service_based_url"} + "https://fhir.ethizo.com/api/4.0.0/service_based_url", "https://fhir.maximus.care/api/service_based_url", "https://open.allscripts.com/fhirendpoints/download/R4?endpointFilter=Patient", "https://aidbox.cx360.net/service-base-urls"} var ontadaURL = "https://g2fhir-int.mckesson.com/docs/index.html" var mdlandURL = "https://api-fhir-proxy-2.mdland.net/" @@ -231,22 +209,14 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { var err error - if URLsEqual(chplURL, MedHostURL) { - MedHostQuerier(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, NextGenURL) { + if URLsEqual(chplURL, NextGenURL) { NextGenwebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, CanvasURL) { - Canvaswebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, AlteraURL) { - AlteraQuerier(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, modernizingMedicineURL) { ModernizingMedicineQuerier(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, EpicURL) { EpicQuerier(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, MeditechURL) { MeditechWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, DocsAthenaURL) { - AthenaCSVParser("https://fhir.athena.io/athena-fhir-urls/athenanet-fhir-base-urls.csv", fileToWriteTo) } else if URLsEqual(chplURL, MyDataAthenaURL) { Athenawebscraper("https://mydata.athenahealth.com/aserver", fileToWriteTo) } else if URLsEqual(chplURL, OneMedicalURL) { @@ -257,14 +227,6 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { TriMedTechWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, trimedtechv8URL) { TriMedTechV8Webscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, cernerSoarianR4URL) { - chplURL = strings.ReplaceAll(chplURL, "github.com", "raw.githubusercontent.com") - chplURL = strings.Replace(chplURL, "/blob", "", 1) - BundleQuerierParser(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, cernerGitHubURL) { - CernerBundleParser(chplURL, fileToWriteTo) - // } else if URLsEqual(chplURL, techCareURL) { - // Techcarewebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, carefluenceURL) { CarefluenceWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, bizmaticsURL) { @@ -273,8 +235,6 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { CSVParser("https://ipatientcare.com/wp-content/uploads/2022/10/fhir-base-urls.csv", fileToWriteTo, "./fhir-base-urls.csv", 1, 2, true, 1, -1) } else if URLsEqual(chplURL, practiceSuiteURL) { PracticeSuiteWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, indianHealthServiceURL) { - IndianHealthWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, geniusSolutionsURL) { GeniusSolutionsWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, intelichartURL) { @@ -299,8 +259,6 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { MedicalInformaticsEngineeringWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, relimedsolutionsURL) { 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, streamlinemdURL) { @@ -311,8 +269,6 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { MedicalMineWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, microfourURL) { MicroFourWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, magilenenterprisesURL) { - MagilenEnterprisesWebscraper(chplURL, fileToWriteTo) } else if chplURL == interopxURL { InteropxWebscraper(chplURL, fileToWriteTo) } else if chplURL == mphrxURL { @@ -325,8 +281,6 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { ZHHealthcareWebscraper(chplURL, fileToWriteTo) } else if chplURL == medinfoengineeringURL { MedicalInformaticsEngineeringWebscraper(chplURL, fileToWriteTo) - } else if chplURL == emedpracticeURL { - eMedPracticeWebscraper(chplURL, fileToWriteTo) } else if chplURL == doc_torURL { BundleQuerierParser(chplURL+"/r4", fileToWriteTo) } else if URLsEqual(chplURL, azaleahealthURL) { @@ -370,30 +324,22 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { CriterionsWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, tenzingURL) { TenzingURLWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, inpracsysURL) { - InpracsysURLWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, medicscloudURL) { MedicsCloudWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, advancedmdURL) { AdvancedMdWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, agasthaURL) { AgasthaWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, allegiancemdURL) { - AllegianceMDWebscraper("https://fhir.allegiancemd.io/R4/swagger-ui/", fileToWriteTo) } else if URLsEqual(chplURL, elationURL) { ElationWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, betterdayhealthURL) { BetterdayHealthWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, carecloudURL) { CareCloudWebscraper("https://api-datamanager.carecloud.com/fhirurl", fileToWriteTo) - } else if URLsEqual(chplURL, ethizoURL) { - EthizoWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, hmsfirstURL) { HMSfirstWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, praxisemrURL) { PraxisEMRWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, escribeHOSTURL) { - EscribeHOSTWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, mdlogicEHRURL) { MDLogicEHRWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, altheaURL) { @@ -424,8 +370,6 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { BundleQuerierParser("https://app.azaleahealth.com/fhir/R4/Endpoint?_format=application/json", fileToWriteTo) } else if URLsEqual(chplURL, dssincURL) { DssIncWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, kodjinURL) { - KodjinWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, firelyURL) { BundleQuerierParser(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, azurewebsitesURL) { @@ -442,14 +386,10 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { MyheloURLWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, nextechURL) { NextechURLCSVParser(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, novomediciURL) { - NovomediciURLWebscraper("https://www.novomedici.com/wp-content/uploads/2022/11/fhir-base-urls.csv", fileToWriteTo) } else if URLsEqual(chplURL, patientpatternURL) { PatientpatternURLCSVParser(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, pcisgoldURL) { PCISgoldURLWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, healthieURL) { - CustomBundleQuerierParser(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, medConnectURL) { BundleQuerierParser(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, citiusTechURL) { @@ -462,10 +402,6 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { 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) { @@ -484,16 +420,12 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { CSVParser(MEDENTURL, fileToWriteTo, "./ServiceBaseURL.csv", -1, 2, true, 1, 0) } else if URLsEqual(chplURL, canvasMedicalURL) { CanvasMedicalURLWebscraper(chplURL, fileToWriteTo) - } else if URLsEqual(chplURL, maximusURL) { - MaximusURLWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, broadStreetURL) { BroadStreetURLWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, officePracticumURL) { OfficePracticumURLWebscraper(chplURL, fileToWriteTo) } else if URLsEqual(chplURL, willowURL) { WillowQuerierParser("https://ccdoc.phn.care/service-base-urls", fileToWriteTo) - } else if URLsEqual(chplURL, aidboxURL) { - AidboxQuerierParser(aidboxURL, fileToWriteTo) } else if URLsEqual(chplURL, dss2URL) { BundleQuerierParser(dss2URL, fileToWriteTo) } else if URLsEqual(chplURL, cozevaURL) { @@ -530,14 +462,10 @@ func QueryCHPLEndpointList(chplURL string, fileToWriteTo string) { 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) { diff --git a/endpointmanager/pkg/chplendpointquerier/eclinicalworksquerier.go b/endpointmanager/pkg/chplendpointquerier/eclinicalworksquerier.go deleted file mode 100644 index 090c92af3..000000000 --- a/endpointmanager/pkg/chplendpointquerier/eclinicalworksquerier.go +++ /dev/null @@ -1,34 +0,0 @@ -package chplendpointquerier - -import ( - "os" - - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func eClinicalWorksBundleParser(CHPLURL string, fileToWriteTo string) { - bundleFilePath := "practiceList.json" - - var endpointEntryList EndpointList - - respBodyJSON, err := helpers.QueryAndReadFile(CHPLURL, bundleFilePath) - if err != nil { - log.Fatal(err) - } - - // convert bundle data to lantern format - bundleLanternFormat := BundleToLanternFormat(respBodyJSON) - - endpointEntryList.Endpoints = bundleLanternFormat - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - - err = os.Remove(bundleFilePath) - if err != nil { - log.Fatal(err) - } -} diff --git a/endpointmanager/pkg/chplendpointquerier/emedpracticewebscraper.go b/endpointmanager/pkg/chplendpointquerier/emedpracticewebscraper.go deleted file mode 100644 index 6876dd336..000000000 --- a/endpointmanager/pkg/chplendpointquerier/emedpracticewebscraper.go +++ /dev/null @@ -1,67 +0,0 @@ -package chplendpointquerier - -import ( - "fmt" - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func eMedPracticeWebscraper(CHPLURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, "#bulkDataExport") - if err != nil { - log.Fatal(err) - } - - urlFound := false - - doc.Find("ul").Each(func(index int, ulElems *goquery.Selection) { - ulElems.Find("li").Each(func(index int, liElems *goquery.Selection) { - if strings.Contains(liElems.Text(), "https:") && !urlFound { - divElems := liElems.Find("div") - if divElems.Length() > 0 { - preElems := liElems.Find("pre") - if preElems.Length() > 0 { - var entry LanternEntry - - urlStart := strings.Index(preElems.Text(), "https://") - if urlStart == -1 { - fmt.Println("URL not found") - return - } - - urlEnd := strings.Index(preElems.Text()[urlStart:], "8443/") - if urlEnd == -1 { - fmt.Println("End of base URL not found") - return - } - - fhirURL := preElems.Text()[urlStart : urlStart+urlEnd+len("8443")] - entry.URL = fhirURL - lanternEntryList = append(lanternEntryList, entry) - - urlFound = true - - return - } - } - } - }) - - if urlFound { - return - } - }) - - endpointEntryList.Endpoints = lanternEntryList - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } -} diff --git a/endpointmanager/pkg/chplendpointquerier/escribehostwebscraper.go b/endpointmanager/pkg/chplendpointquerier/escribehostwebscraper.go deleted file mode 100644 index 460d61334..000000000 --- a/endpointmanager/pkg/chplendpointquerier/escribehostwebscraper.go +++ /dev/null @@ -1,49 +0,0 @@ -package chplendpointquerier - -import ( - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func EscribeHOSTWebscraper(CHPLURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".banner2") - if err != nil { - log.Fatal(err) - } - - doc.Find("div").Each(func(index int, divElems *goquery.Selection) { - subDivEntries := divElems.Find("div") - if subDivEntries.Length() > 1 { - label := strings.TrimSpace(subDivEntries.Eq(0).Text()) - - if strings.Contains(label, "FHIR Server Base URL") { - urlDiv := subDivEntries.Eq(1) - aElem := urlDiv.Find("a").First() - hrefText, exists := aElem.Attr("href") - if exists { - var entry LanternEntry - - entryURL := strings.TrimSpace(hrefText) - entry.URL = entryURL - - lanternEntryList = append(lanternEntryList, entry) - } - } - } - }) - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/ethizowebscraper.go b/endpointmanager/pkg/chplendpointquerier/ethizowebscraper.go deleted file mode 100644 index 397c0cd80..000000000 --- a/endpointmanager/pkg/chplendpointquerier/ethizowebscraper.go +++ /dev/null @@ -1,48 +0,0 @@ -package chplendpointquerier - -import ( - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func EthizoWebscraper(chplURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(chplURL, "ul") - if err != nil { - log.Fatal(err) - } - - doc.Find("li").Each(func(index int, liElem *goquery.Selection) { - spanEntries := liElem.Find("span") - if spanEntries.Length() > 0 { - name := strings.TrimSpace(spanEntries.Eq(0).Text()) - if strings.Contains(name, "Production") { - aElems := liElem.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) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/indianhealthwebscraper.go b/endpointmanager/pkg/chplendpointquerier/indianhealthwebscraper.go deleted file mode 100644 index a72a5e4a4..000000000 --- a/endpointmanager/pkg/chplendpointquerier/indianhealthwebscraper.go +++ /dev/null @@ -1,59 +0,0 @@ -package chplendpointquerier - -import ( - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func IndianHealthWebscraper(CHPLURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(CHPLURL+"api-documentation/", ".container-fluid") - if err != nil { - log.Fatal(err) - } - - doc.Find("#site_content").Each(func(index int, siteContentElems *goquery.Selection) { - siteContentElems.Find(".mura-region-loose").Each(func(index int, muraRegionElems *goquery.Selection) { - muraRegionElems.Find(".mura-region-local").Each(func(index int, muraRegionLocalElems *goquery.Selection) { - muraRegionLocalElems.Find(".row").Each(func(index int, rowElems *goquery.Selection) { - rowElems.Find(".col-md-4").Each(func(index int, colElems *goquery.Selection) { - colElems.Find(".panel").Each(func(index int, panelElems *goquery.Selection) { - panelElems.Find(".panel-body").Each(func(index int, panelBodyElems *goquery.Selection) { - panelBodyElems.Find("ul").Each(func(index int, ulElems *goquery.Selection) { - panelBodyElems.Find("li").Each(func(index int, liElems *goquery.Selection) { - aElem := liElems.Find("a").First() - if strings.Contains(aElem.Text(), "Single Patient EndPoint") { - hrefText, exists := aElem.Attr("href") - if exists { - var entry LanternEntry - - entryURL := strings.TrimSpace(hrefText) - entry.URL = entryURL - - lanternEntryList = append(lanternEntryList, entry) - } - } - }) - }) - }) - }) - }) - }) - }) - }) - }) - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/kodjinwebscraper.go b/endpointmanager/pkg/chplendpointquerier/kodjinwebscraper.go deleted file mode 100644 index fbcceae8c..000000000 --- a/endpointmanager/pkg/chplendpointquerier/kodjinwebscraper.go +++ /dev/null @@ -1,47 +0,0 @@ -package chplendpointquerier - -import ( - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" - "strings" -) - -func KodjinWebscraper(CHPLURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".md-typeset__table") - if err != nil { - log.Fatal(err) - } - - doc.Find("table").Each(func(index int, tableElems *goquery.Selection) { - tableElems.Find("tbody").Each(func(index int, tbodyElems *goquery.Selection) { - tbodyElems.Find("tr").Each(func(index int, trElems *goquery.Selection) { - trElems.Find("td").Each(func(index int, tdElems *goquery.Selection) { - if strings.HasPrefix(tdElems.Text(), "FHIR API Endpoint") { - endpointURLEntry := tdElems.Next() - urlText := endpointURLEntry.Text() - var entry LanternEntry - - entryURL := strings.TrimSpace(urlText) - entry.URL = entryURL - - lanternEntryList = append(lanternEntryList, entry) - - } - }) - }) - }) - }) - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/magilenenterpriseswebscraper.go b/endpointmanager/pkg/chplendpointquerier/magilenenterpriseswebscraper.go deleted file mode 100644 index 527b4089f..000000000 --- a/endpointmanager/pkg/chplendpointquerier/magilenenterpriseswebscraper.go +++ /dev/null @@ -1,64 +0,0 @@ -package chplendpointquerier - -import ( - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func MagilenEnterprisesWebscraper(CHPLURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, "table") - if err != nil { - log.Fatal(err) - } - - tableElems := doc.Find("table") - if tableElems.Length() > 0 { - tableElem := tableElems.Eq(0) - - tableElem.Find("tbody").Each(func(index int, tbodyElem *goquery.Selection) { - tbodyElem.Find("tr").Each(func(trIndex int, trElem *goquery.Selection) { - if trIndex == 1 { - trElem.Find("td").Each(func(tdIndex int, tdElem *goquery.Selection) { - if trIndex == 1 { - pElem := tdElem.Find("p") - if pElem.Length() > 1 { - firstHalfURLSpan := pElem.Eq(0).Find("span") - secondHalfURLSpan := pElem.Eq(1).Find("span") - - firstHalfURLAElem := firstHalfURLSpan.Find("a") - if firstHalfURLAElem.Length() > 0 { - fhirstHalfURLText, exists := firstHalfURLAElem.Eq(0).Attr("href") - if exists { - - secondHalfURLText := secondHalfURLSpan.Text() - - var entry LanternEntry - - fhirURL := strings.TrimSpace(fhirstHalfURLText + secondHalfURLText) - entry.URL = fhirURL - lanternEntryList = append(lanternEntryList, entry) - } - } - } - } - }) - } - }) - }) - } - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/maximuswebscraper.go b/endpointmanager/pkg/chplendpointquerier/maximuswebscraper.go deleted file mode 100644 index f3a64f8e3..000000000 --- a/endpointmanager/pkg/chplendpointquerier/maximuswebscraper.go +++ /dev/null @@ -1,49 +0,0 @@ -package chplendpointquerier - -import ( - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func MaximusURLWebscraper(chplURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - doc, err := helpers.ChromedpQueryEndpointList(chplURL, ".width50padd") - if err != nil { - log.Fatal(err) - } - - fhirEndpointsHeaderElem := doc.Find(".width50padd") - if fhirEndpointsHeaderElem.Length() > 0 { - fhirEndpointsHeaderElem.Find("ul").Each(func(index int, ulElems *goquery.Selection) { - ulElems.Find("li").Each(func(index int, liElems *goquery.Selection) { - if strings.Contains(liElems.Text(), "FHIR Base URL:") { - divElems := liElems.Find("div") - if divElems.Length() > 0 { - preElems := liElems.Find("pre") - if preElems.Length() > 0 { - var entry LanternEntry - - fhirURL := strings.TrimSpace(preElems.Text()) - entry.URL = fhirURL - lanternEntryList = append(lanternEntryList, entry) - } - } - } - }) - }) - } - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/medhostquerier.go b/endpointmanager/pkg/chplendpointquerier/medhostquerier.go deleted file mode 100644 index fe8d2c85b..000000000 --- a/endpointmanager/pkg/chplendpointquerier/medhostquerier.go +++ /dev/null @@ -1,56 +0,0 @@ -package chplendpointquerier - -import ( - "encoding/json" - - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" - "strings" -) - -func MedHostQuerier(medhostURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - respBody, err := helpers.QueryEndpointList(medhostURL) - if err != nil { - log.Fatal(err) - } - - var medhostArr []map[string]interface{} - err = json.Unmarshal(respBody, &medhostArr) - if err != nil { - log.Fatal(err) - } - - for _, medhostEntry := range medhostArr { - var entry LanternEntry - - serviceBaseURL, ok := medhostEntry["serviceBaseUrl"].(string) - if !ok { - log.Fatal("Error converting serviceBaseUrl to type string") - } else { - entry.URL = strings.TrimSpace(serviceBaseURL) - } - - developerName, ok := medhostEntry["facilityName"].(string) - if ok { - entry.OrganizationName = strings.TrimSpace(developerName) - } - - npiID, ok := medhostEntry["npi"].(string) - if ok { - entry.NPIID = strings.TrimSpace(npiID) - } - - lanternEntryList = append(lanternEntryList, entry) - } - - endpointEntryList.Endpoints = lanternEntryList - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/nextgenapiIwebscraper.go b/endpointmanager/pkg/chplendpointquerier/nextgenapiIwebscraper.go deleted file mode 100644 index 487725b6a..000000000 --- a/endpointmanager/pkg/chplendpointquerier/nextgenapiIwebscraper.go +++ /dev/null @@ -1,53 +0,0 @@ -package chplendpointquerier - -import ( - "strings" - - "github.com/PuerkitoBio/goquery" - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - log "github.com/sirupsen/logrus" -) - -func NextgenAPIWebscraper(CHPLURL string, fileToWriteTo string) { - - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - doc, err := helpers.ChromedpQueryEndpointList(CHPLURL, ".container") - if err != nil { - log.Fatal(err) - } - doc.Find(".container").Each(func(index int, containerhtml *goquery.Selection) { - containerhtml.Find("ul").Each(func(indextr int, ulhtml *goquery.Selection) { - ulhtml.Find("li").Each(func(indextr int, lihtml *goquery.Selection) { - lihtml.Find("ul").Each(func(indextr int, ul2html *goquery.Selection) { - ul2html.Find("li").Each(func(indextr int, li2html *goquery.Selection) { - li2html.Find("ul").Each(func(indextr int, ul3html *goquery.Selection) { - ul3html.Find("li").Each(func(indextr int, li3html *goquery.Selection) { - if strings.Contains(li3html.Text(), "R4 Version Base URL") { - aElem := li3html.Find("a").First() - hrefText, exists := aElem.Attr("href") - if exists { - var entry LanternEntry - - entryURL := strings.TrimSpace(hrefText) - entry.URL = entryURL - - lanternEntryList = append(lanternEntryList, entry) - } - } - }) - }) - }) - }) - }) - }) - }) - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - -} diff --git a/endpointmanager/pkg/chplendpointquerier/novomedicwebscraper.go b/endpointmanager/pkg/chplendpointquerier/novomedicwebscraper.go deleted file mode 100644 index 63a939ba7..000000000 --- a/endpointmanager/pkg/chplendpointquerier/novomedicwebscraper.go +++ /dev/null @@ -1,58 +0,0 @@ -package chplendpointquerier - -import ( - "github.com/onc-healthit/lantern-back-end/endpointmanager/pkg/helpers" - "io" - "os" - "strings" - - log "github.com/sirupsen/logrus" -) - -func NovomediciURLWebscraper(CHPLURL string, fileToWriteTo string) { - var lanternEntryList []LanternEntry - var endpointEntryList EndpointList - - csvFilePath := "./novomedic-fhir-base-urls.csv" - csvReader, file, err := helpers.QueryAndOpenCSV(CHPLURL, csvFilePath, true) - if err != nil { - log.Fatal(err) - } - defer file.Close() - - for { - rec, err := csvReader.Read() - if err == io.EOF { - break - } - if err != nil { - log.Fatal(err) - } - - var entry LanternEntry - orgName := strings.TrimSpace(rec[0]) - if !strings.HasPrefix(orgName, "Prod FHIR ") { - continue - } - URL := strings.TrimSpace(rec[1]) - if strings.TrimSpace(URL) == "" { - continue - } - - //entry.OrganizationName = orgName - entry.URL = URL - lanternEntryList = append(lanternEntryList, entry) - } - - endpointEntryList.Endpoints = lanternEntryList - - err = WriteCHPLFile(endpointEntryList, fileToWriteTo) - if err != nil { - log.Fatal(err) - } - - err = os.Remove(csvFilePath) - if err != nil { - log.Fatal(err) - } -}