From f2d3edbc90260d311fbd8f76f2d1d66a65c88cd3 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Thu, 9 Mar 2023 17:35:33 -0800 Subject: [PATCH] Working nextgen api. Adding platform_type key for use in filters. fixing docker-compose file referencing couchdb. --- CONTRIBUTING.md | 3 +-- docker-compose.yml | 15 ++++++++------- frontend/src/app/models/fasten/metadata-source.ts | 1 + .../app/pages/dashboard/dashboard.component.ts | 1 + .../medical-sources/medical-sources.component.ts | 9 ++++++++- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71753d5a..10ac8913 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,11 +47,10 @@ make backend-test # Start Development Environment -To run Fasten from source, you'll need to create 3 separate processes: +To run Fasten from source, you'll need to create 2 separate processes: - Angular Frontend - Go Backend -- CouchDB Database First we'll create a development config file (`config.dev.yaml`) diff --git a/docker-compose.yml b/docker-compose.yml index 07f9590e..dde19bc7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,17 @@ version: "3.9" services: - couchdb: + fasten: + # NOTE: only developers need to build Fasten from source + # For production, use the pre-built image from GitHub Packages + # ghcr.io/fastenhealth/fasten-onprem:main build: context: . dockerfile: Dockerfile -# environment: -# - COUCHDB_USER=admin -# - COUCHDB_PASSWORD=password + args: + - FASTEN_ENV=prod +# - FASTEN_ENV=sandbox ports: - "9090:8080" - - "5984:5984" volumes: - - ./.couchdb/data:/opt/couchdb/data - - ./.couchdb/config:/opt/couchdb/etc/local.d + - ./db:/opt/fasten/db # - ./config.example.yaml:/opt/fasten/config/config.yaml diff --git a/frontend/src/app/models/fasten/metadata-source.ts b/frontend/src/app/models/fasten/metadata-source.ts index 8af9bc7c..d3d502c8 100644 --- a/frontend/src/app/models/fasten/metadata-source.ts +++ b/frontend/src/app/models/fasten/metadata-source.ts @@ -1,4 +1,5 @@ export class MetadataSource { + platform_type: string source_type: string display: string category: string[] diff --git a/frontend/src/app/pages/dashboard/dashboard.component.ts b/frontend/src/app/pages/dashboard/dashboard.component.ts index c03a510b..c6932c67 100644 --- a/frontend/src/app/pages/dashboard/dashboard.component.ts +++ b/frontend/src/app/pages/dashboard/dashboard.component.ts @@ -43,6 +43,7 @@ export class DashboardComponent implements OnInit { this.metadataSource = metadataSource this.metadataSource["manual"] = { "source_type": "manual", + "platform_type": "manual", "display": "Manual", "category": ["Manual"], "hidden": false, diff --git a/frontend/src/app/pages/medical-sources/medical-sources.component.ts b/frontend/src/app/pages/medical-sources/medical-sources.component.ts index 25aec72b..64f08916 100644 --- a/frontend/src/app/pages/medical-sources/medical-sources.component.ts +++ b/frontend/src/app/pages/medical-sources/medical-sources.component.ts @@ -218,7 +218,14 @@ export class MedicalSourcesComponent implements OnInit { console.log("NO PATIENT ID present, decoding jwt to extract patient") //const introspectionResp = await Oauth.introspectionRequest(as, client, payload.access_token) //console.log(introspectionResp) - payload.patient = this.jwtDecode(payload.id_token)["profile"].replace(/^(Patient\/)/,'') + let decodedIdToken = this.jwtDecode(payload.id_token) + //nextGen uses fhirUser instead of profile. + payload.patient = decodedIdToken["profile"] || decodedIdToken["fhirUser"] + + if(payload.patient){ + payload.patient = payload.patient.replace(/^(Patient\/)/,'') + } + }