Skip to content

Commit b5c29df

Browse files
committed
env update backend
1 parent fc53f2a commit b5c29df

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ The backend environment variables are configured in `backend/env.json`:
5555
| USE_INTERMEDIARY | `true` | Set to `true` to route ETASU checks through the REMS intermediary instead of directly to REMS admin. |
5656
| INTERMEDIARY_FHIR_URL | `http://localhost:3003/4_0_0` | Base URL of the REMS intermediary FHIR server. Used when `USE_INTERMEDIARY` is true. |
5757
| REMS_ADMIN_NCPDP | `http://localhost:8090/ncpdp/script` | URL endpoint for sending NCPDP Script messages directly to REMS admin. |
58+
| INTERMEDIARY_URL | `http://localhost:3003` | Base URL of the REMS intermediary. Used when `USE_INTERMEDIARY` is true to route NCPDP Script and RxFill messages. |
59+
| EHR_NCPDP_URL | `http://localhost:8080/ncpdp/script` | URL endpoint for sending NCPDP Script messages directly to the EHR system. Used when `USE_INTERMEDIARY` is false. |
5860

5961
## Setup
6062

@@ -119,5 +121,4 @@ Unless required by applicable law or agreed to in writing, software
119121
distributed under the License is distributed on an "AS IS" BASIS,
120122
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121123
See the License for the specific language governing permissions and
122-
limitations under the License.
123-
124+
limitations under the License.

backend/env.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
},
6262
"EHR_NCPDP_URL": {
6363
"type": "string",
64-
"default": "|| 'http://localhost:8080/ncpdp/script'"
64+
"default": "http://localhost:8080/ncpdp/script"
6565
}
66-
}
66+
}

backend/src/lib/pharmacyConfig.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
// Configuration state
1+
import env from 'var';
2+
3+
// Configuration state
24
let config = {
3-
useIntermediary: process.env.USE_INTERMEDIARY === 'true',
4-
intermediaryUrl: process.env.INTERMEDIARY_URL || '',
5-
remsAdminUrl: process.env.REMS_ADMIN_NCPDP || '',
6-
ehrUrl: process.env.EHR_NCPDP_URL || ''
5+
useIntermediary: env.USE_INTERMEDIARY,
6+
intermediaryUrl: env.INTERMEDIARY_URL,
7+
remsAdminUrl: env.REMS_ADMIN_NCPDP,
8+
ehrUrl: env.EHR_NCPDP_URL
79
};
810

911
export function getConfig() {

0 commit comments

Comments
 (0)