|
| 1 | +-- Add columns for connection tracking |
| 2 | +ALTER TABLE fhir_servers |
| 3 | +ADD COLUMN last_connection_attempt TIMESTAMP WITH TIME ZONE, |
| 4 | +ADD COLUMN last_connection_successful BOOLEAN DEFAULT FALSE; |
| 5 | + |
| 6 | +-- Update existing rows to have null values for new columns |
| 7 | +UPDATE fhir_servers |
| 8 | +SET last_connection_attempt = NULL, |
| 9 | + last_connection_successful = NULL; |
| 10 | + |
| 11 | +-- Convert name index to unique constraint |
| 12 | +DROP INDEX fhir_servers_name_index; |
| 13 | +CREATE UNIQUE INDEX fhir_servers_name_index ON fhir_servers (name); |
| 14 | + |
| 15 | +-- Truncate existing table |
| 16 | +TRUNCATE TABLE fhir_servers; |
| 17 | + |
| 18 | +-- Direct FHIR servers |
| 19 | +INSERT INTO fhir_servers (name, hostname, last_connection_attempt, last_connection_successful) |
| 20 | +VALUES |
| 21 | + ('Public HAPI: Direct', 'https://hapi.fhir.org/baseR4', current_timestamp, true), |
| 22 | + ('HELIOS Meld: Direct', 'https://gw.interop.community/HeliosConnectathonSa/open', current_timestamp, true), |
| 23 | + ('JMC Meld: Direct', 'https://gw.interop.community/JMCHeliosSTISandbox/open', current_timestamp, true), |
| 24 | + ('Local e2e HAPI Server: Direct', 'http://hapi-fhir-server:8080/fhir', current_timestamp, true), |
| 25 | + ('OPHDST Meld: Direct', 'https://gw.interop.community/CDCSepHL7Connectatho/open', current_timestamp, true); |
| 26 | + |
| 27 | +-- eHealthExchange FHIR servers |
| 28 | +INSERT INTO fhir_servers (name, hostname, headers, last_connection_attempt, last_connection_successful) |
| 29 | +VALUES |
| 30 | + ('HELIOS Meld: eHealthExchange', |
| 31 | + 'https://concept01.ehealthexchange.org:52780/fhirproxy/r4/', |
| 32 | + '{ |
| 33 | + "Accept": "application/json, application/*+json, */*", |
| 34 | + "Accept-Encoding": "gzip, deflate, br", |
| 35 | + "Content-Type": "application/fhir+json; charset=UTF-8", |
| 36 | + "X-DESTINATION": "MeldOpen", |
| 37 | + "X-POU": "PUBHLTH", |
| 38 | + "prefer": "return=representation", |
| 39 | + "Cache-Control": "no-cache" |
| 40 | + }', |
| 41 | + current_timestamp, |
| 42 | + true), |
| 43 | + ('JMC Meld: eHealthExchange', |
| 44 | + 'https://concept01.ehealthexchange.org:52780/fhirproxy/r4/', |
| 45 | + '{ |
| 46 | + "Accept": "application/json, application/*+json, */*", |
| 47 | + "Accept-Encoding": "gzip, deflate, br", |
| 48 | + "Content-Type": "application/fhir+json; charset=UTF-8", |
| 49 | + "X-DESTINATION": "JMCHelios", |
| 50 | + "X-POU": "PUBHLTH", |
| 51 | + "prefer": "return=representation", |
| 52 | + "Cache-Control": "no-cache" |
| 53 | + }', |
| 54 | + current_timestamp, |
| 55 | + true), |
| 56 | + ('OpenEpic: eHealthExchange', |
| 57 | + 'https://concept01.ehealthexchange.org:52780/fhirproxy/r4/', |
| 58 | + '{ |
| 59 | + "Accept": "application/json, application/*+json, */*", |
| 60 | + "Accept-Encoding": "gzip, deflate, br", |
| 61 | + "Content-Type": "application/fhir+json; charset=UTF-8", |
| 62 | + "X-DESTINATION": "OpenEpic", |
| 63 | + "X-POU": "PUBHLTH", |
| 64 | + "prefer": "return=representation", |
| 65 | + "Cache-Control": "no-cache" |
| 66 | + }', |
| 67 | + current_timestamp, |
| 68 | + true), |
| 69 | + ('CernerHelios: eHealthExchange', |
| 70 | + 'https://concept01.ehealthexchange.org:52780/fhirproxy/r4/', |
| 71 | + '{ |
| 72 | + "Accept": "application/json, application/*+json, */*", |
| 73 | + "Accept-Encoding": "gzip, deflate, br", |
| 74 | + "Content-Type": "application/fhir+json; charset=UTF-8", |
| 75 | + "X-DESTINATION": "CernerHelios", |
| 76 | + "X-POU": "PUBHLTH", |
| 77 | + "prefer": "return=representation", |
| 78 | + "Cache-Control": "no-cache", |
| 79 | + "OAUTHSCOPES": "system/Condition.read system/Encounter.read system/Immunization.read system/MedicationRequest.read system/Observation.read system/Patient.read system/Procedure.read system/MedicationAdministration.read system/DiagnosticReport.read system/RelatedPerson.read" |
| 80 | + }', |
| 81 | + current_timestamp, |
| 82 | + true); |
0 commit comments